HTML笔记 9.嵌入内容

嵌入内容

<!DOCTYPE html>
<html>
<head>
    <title>Example</title>
    <meta charset="utf-8">
    <meta name="author" content="Hu QiLin">
    <meta name="description" content="确保输入值是电子邮箱地址或URL">
    <link rel="shortcut icon" type="image/x-icon" href="favicon.icn">
</head>
<body>
    Here is a common form for representing the three activities in a triathlon.
    <p>
        <!--嵌入图像-->
        <!--src属性:指定图像URL-->
        <!--alt属性:img元素的备用内容-->
        <!--指定 width 和 height 能让浏览器在图像尚未载入时正确摆放网页里的各个元素-->
        <img src="triathlon.png" alt="Triathlon Image" width="200" height="67"/>
    </p>
    <p>
        <!--在超链接里嵌入图像-->
        <a href="otherpage.html">
            <!--ismap, 创建了一个服务器端分区响应图:在图像上点击的位置会附加到URL上-->
            <!--服务器端分区响应图,意味着服务器会根据用户在图像上点击区域的不同作出有差别的反应。-->
            <img src="triathlon.png" ismap alt="Triathlon Image" width="200" height="67"/>
        </a>
    </p>
    <p>
        <!--客户端分区响应图-->
        <!--usemap属性:将map元素与图像关联-->
        <img src="triathlon.png" usemap="#mymap" alt="Triathlon Image">
    </p>

    <map name="mymap">
        <area shape="rect" coords="3,5,68,62" href="swimpage.html" alt="Swimimg"/>
        <area shape="rect" coords="70,5,130,62" href="cyclepage.html" alt="Running"/>
        <area shape="default" href="otherpage.html" alt="default">
    </map>

    <!--点击此处的超链接,URL会在下方的 iframe 区域中被打开-->
    <a href="fruits.html" target="frame">Fruits i Like</a>

    <!--iframe元素:在现有的HTML文档中嵌入另一张文档-->
    <iframe name="myframe" width="300" height="300">
    </iframe>

    <!--embed元素:用于添加插件支持-->
    <embed src="http://www.youtube.com/v/qzA60hHca9s?version=3"
       type="application/x-shockwave-flash" width="560" height="349"
       allowfullscreen="true"/>

    <!--使用object嵌入插件内容-->
    <object width="500" height="349" 
        dada="http://www.youtube.com/v/qzA60hHca9s?version=3" 
        type="application/x-shockwave-flash">
        <!--param 元素,定义将要传递给插件的参数-->
        <param name="allowfullscreen" value="true"/>
        <!--指定备用内容,当指定内容不可用时显示-->
        <b>Sorry!</b>We can't display this content
    </object>

    <!--使用object元素嵌入图像-->
    <object data="triathlon.png" type="iamge/png">
    </object>

    <!--使用object元素创建客户端分区响应图-->
    <map name="mymap">
        <area shape="rect" coords="3,5,68,62" href="swimpage.html" alt="Swimimg"/>
        <area shape="rect" coords="70,5,130,62" href="cyclepage.html" alt="Running"/>
        <area shape="default" href="otherpage.html" alt="default">
    </map>

    <object data="triathlon.png" type="iamge/png" usemap="#mymap">
    </object>


    <!--将object元素作为浏览器上下文环境-->
    <!--点击此处的链接,在下方object所描述的区域显示内容-->
    <a href="activities.html" target="frame">Activities I Like</a>

    <object type="text/html" name="frame" width="300" height="100">
    </object>

</body>
</html>

progress 元素

<!DOCTYPE html>
<html>
<head>
    <title>Example</title>
    <meta charset="utf-8">
    <meta name="author" content="Hu QiLin">
    <meta name="description" content="确保输入值是电子邮箱地址或URL">
    <link rel="shortcut icon" type="image/x-icon" href="favicon.icn">
</head>
<body>
    <progress id="myprogress" value="10" max="100"></progress>
    <p>
        <button type="button" value="30">30%</button>
        <button type="button" value="60">60%</button>
        <button type="button" value="90">90%</button>
    </p>

    <script type="text/javascript">
        var buttons = document.getElementsByTagName('BUTTON');
        var progress = document.getElementById('myprogress');
        for (var i = buttons.length - 1; i >= 0; i--) {
            buttons[i].onclick = function(e) {
                progress.value = e.target.value;
            }
        }
    </script>
</body>
</html>

meter 元素

<!DOCTYPE html>
<html>
<head>
    <title>Example</title>
    <meta charset="utf-8">
    <meta name="author" content="Hu QiLin">
    <meta name="description" content="确保输入值是电子邮箱地址或URL">
    <link rel="shortcut icon" type="image/x-icon" href="favicon.icn">
</head>
<body>

    <!--meter 元素显示了某个范围内所有可能值中的一个。-->
    <!--低于 low 属性设置的值为过低值-->
    <!--高于 high 属性设置的值为过高值-->
    <!--optimum 属性设置的值为最佳值-->
    <meter id="mymeter" value="90" min="10" max="100" low="40" high="80" optimum="60"></meter>
    <p>
        <button type="button" value="30">30%</button>
        <button type="button" value="60">60%</button>
        <button type="button" value="90">90%</button>
    </p>

    <script type="text/javascript">
        var buttons = document.getElementsByTagName('BUTTON');
        var meter = document.getElementById('mymeter');
        for (var i = buttons.length - 1; i >= 0; i--) {
            buttons[i].onclick = function(e) {
                meter.value = e.target.value;
            }
        }
    </script>
</body>
</html>
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • HTML5新增的元素和废除的元素 HTML5的结构 <a name="1">HTML5新增的元素和废除的元素</...
    寒桥阅读 224评论 0 1
  • 问答题47 /72 常见浏览器兼容性问题与解决方案? 参考答案 (1)浏览器兼容问题一:不同浏览器的标签默认的外补...
    _Yfling阅读 13,815评论 1 92
  • 1. 浏览器页面有哪三层构成,分别是什么,作用是什么? 构成:结构层、表示层、行为层分别是:HTML、CSS、Ja...
    程序猿人王小贱阅读 1,896评论 1 11
  • 问答题1 /72浏览器页面有哪三层构成,分别是什么,作用是什么?参考答案构成:结构层、表示层、行为层分别是:HTM...
    _Yfling阅读 1,242评论 0 23
  • 寒假期间,在家百无聊赖,好友静突然发来消息说要聚聚,后邀约一起回高中母校转悠,当时我的脑海能浮现出的唯一画面是苏历...
    空才阅读 242评论 0 0