HTML基础——头部与主体

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/JEYMING/article/details/80286200

<!--
    Html基础
    html文档由头部head和主体body两部分组成
        head——定义标题、样式等
        body——定义段落、标题字、超链接、脚本、表格、表单等
-->

<html>
    <head>
    <!--
        主要包含标题标记、元信息标记、样式标记、脚本标记、超链接标记等
            1.标题标记<title></title>
            2.元信息标记<meta /> 
                主要包含作者、日期和时间、网页描述、关键词、页面刷新等
                2.1<meta name="" content="" />
                    name属性用于描述网页,name属性的值所描述的内容通过content属性表示;
                    定义作者<meta name="author" content="信息参数" />
                    定义描述<meta name="description" content="信息参数" />
                    定义关键词<meta name="keywords" content="信息参数" />
                    定义编辑器<meta name="generator" content="信息参数" />
                    机器人<meta name="robots" content="信息参数" />
                        content="all"   //文件将被检索,页面所有链接可以被查询
                        content="none"  //文件将不被检索,页面所有链接不可以被查询
                        content="index" //文件将被检索
                        content="noindex"   //文件将不被检索,但页面上的链接可以被查询
                        content="follow"    //页面上的链接可以被查询
                        content="nofollow"  //文件被检索,但页面不可以查询

                2.2<meta http-equiv="" content="" />
                    http-equiv属性用于提供HTTP协议的响应头报文,http-equiv属性的值所描述的内容通过content属性表示;;
                    内容类型<meta http-equiv="content-type" content="" />
                    网页缓冲过期时间<meta http-equiv="expires" content="信息参数" />
                    刷新与跳转(重定向)页面<meta http-equiv="refresh" content="时间" url="网址参数" />
                    若过期,则删除本地cookies<meta http-equiv="set-cookie" content="" />
                    <meta http-equiv="cache-control" content="no-cache" />禁止浏览器从本地计算机缓存中读取数据,同时无法脱机访问

    -->
        <title>This is a title in this web</title>
        <meta charset="UTF-8"/>
        <meta name="author" content="JEYMING" />
        <meta name="description" content="This is a wed" />
        <meta name="keywords" content="网页,设计" />
        <meta name="robot" content="all" />
        <meta name="copyright" content="www.hello2018.cn" />
        <style type="text/css">
            div{
                background:#99cccc;
                width:500px;
                height:150px;
            }
        </style>
    </head>
    <body>
    <!--
        Web页面的主要部分
            1.body标记<body></body>
            2.body标记的属性
                属性  值       说明
                ------------------------
                text    颜色值 文字颜色
                bgcolor 颜色值 文档背景颜色
                alink   颜色值 活动链接的颜色
                link    颜色值 未访问链接的颜色
                vlink   颜色值 已访问链接的颜色
                background  URL 背景图像
                topmargin   pixel   上边框大小
                leftmargin  pixel   左边框大小
            3.4种颜色表达方法
                3.1 rgb(r,g,b),其中“r,g,b”是整数,范围0~255;
                3.2 rgb(r%,g%,b%),其中“r,g,b”是整数,范围0~100;
                3.3 十六进制表示  #rrggbb或#rgb 
                3.4 颜色英文名称

    -->
    <body text="rgb(00,00,00)",bgcolor="#f0f0f0",background="",link="rgb(0%,0%,0%)",alink="white",vlink="rad",topmargin="60px",leftmargin="60px">
        <div id="" class="">
            <p>欢迎访问我们的站点,我们为您提供网站地图。</p>
            网站导航:
            <a href="http://www.baidu.com">百度</a>
            <a href="http://www.163.com">网易</a>
            <a href="http://www.sina.com.cn">新浪</a>
            <a href="http://www.qq.com">腾讯</a>
        </div>
    </body>
    </body>
</html>

猜你喜欢

转载自blog.csdn.net/JEYMING/article/details/80286200