codecamp

Multimedia and embedding

先决条件

在开始此模块之前,您应该了解HTML的基本知识,如 HTML简介所述。 如果你没有通过这个模块(或类似的东西),先通过它,然后回来!

注意:如果您在计算机/平板电脑/其他设备上工作,但您无法创建自己的文件,则可以在在线编码中尝试(大部分)代码示例 程序,例如 JSBin > Thimble

指南

此模块包含以下文章,将带您了解在网页上嵌入多媒体的所有基本知识。

Images in HTML
There are other types of multimedia to consider, but it is logical to start with the humble <img> element, used to embed a simple image in a webpage. In this article we'll look at how to use it in depth, including basics, annotating it with captions using <figure>, and how it relates to CSS background images.
Video and audio content
Next, we'll look at how to use the HTML5 <video> and <audio> elements to embed video and audio on our pages, including basics, providing access to different file formats to different browsers, adding captions and subtitles, and how to add fallbacks for older browsers.
From <object> to <iframe> — other embedding technologies
At this point we'd like to take somewhat of a sideways step, looking at a couple of elements that allow you to embed a wide variety of content types into your webpages: the <iframe><embed> and <object> elements. <iframe>s are for embedding other web pages, and the other two allow you to embed PDFs, SVG, and even Flash — a technology that is on the way out, but which you'll still see semi-regularly.
Adding vector graphics to the Web
Vector graphics can be very useful in certain situations. Unlike regular formats like PNG/JPG, they don't distort/pixellate when zoomed in — they can remain smooth when scaled. This article introduces you to what vector graphics are, and how to include the popular SVG format in web pages.
Responsive images
With so many differerent device types now able to browse the Web — from mobile phones to desktop computers — an essential concept to master in the modern web world is responsive design. This refers to the creation of webpages that can automatically change their features to suit different screen sizes, resolutions, etc. This will be looked at in much more detail in a CSS module later on, but for now we'll look at the tools HTML has available to create responsive images, including the <picture> element.

评估

以下评估将测试您对上述指南中HTML基础知识的理解。

Mozilla splash page
In this assessment, we'll test your knowledge of some of the techniques discussed in this module's articles, getting you to add some images and video to a funky splash page all about Mozilla!

也可以看看

Add a hitmap on top of an image
Image maps provide a mechanism to make different parts of an image link to different places (think of a map, linking through to further information about each different country you click on.) This technique can sometimes be useful.
Web literacy basics 2

一个优秀的Mozilla基础课程,探索和测试在多媒体和嵌入模块中讨论的一些技能。 深入了解撰写网页的基础知识,设计无障碍功能,共享资源,使用在线媒体和开放工作。

Structuring a page of content
Images in HTML
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录
CSS

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }