zoukankan      html  css  js  c++  java
  • HTML高级(头元素)

    头元素是指位于<head></head>标签对之间的元素

    1,<title></title>

    设置标题

    2,<base>

    用于指定网页中超链接的基准地址,以改变网页中所有使用相同

    地址的URL的基准地址

    例如:

    <base href="http://www.baidu.com/teack/" target="_blank">

    作用:

    1,href属性指定该网页中所有使用HTTP协议的相对URL地址的

    基准地址,若网页中有如<a href="index.html"></a>这样的超连接

    它不会再像没有使用<base>标签时那样,表示当前网页相同目录下的网页文件

    2,target属性用于设定该网页中所有的超连接显示的目标窗口,

    在<base>标签中设定target属性,可省得所有的超连接<a>标签中都加上

    target属性。


    3,<link>:定义当前文档与另一文档或资源的关系

    主要属性:

    href:另一文档或资源的URL,必选


    rel,rev:link的两个资源之间的关系类型,必须具有2者中的一个,必选

    rel:

    rev:

    值:

    contents

    index

    glossary

    copyright

    next

    previous

    start

    help

    bookmark

    stylesheet

    alternate

    shortcut icon:图标,16*16像素

    <link rel="shortcut icon" href="favicon.ico">

    title:描述目标资源的字符串,可选

    type:目标资源类型

    type="text/css"

    type="text/javascript"


    media:媒体

    值:

    screen:显示器

    print:打印机

    projection:投影仪

    aural:扬声器

    braille:触觉,感觉设备

    tty:电传打字机

    tv:电视机

    all:所有设备


    4,<meta>

    属性:

    http-equiv:http响应消息头

    值:

    Content-Type:浏览器文本编码

    <html>
    
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=gb2312">
    </head>
    
    <body>
    啊哈哈
    </body>
    
    </html>

    Refresh:自动刷新

    <!--
    1秒后自动刷新
    -->
    <meta http-equiv="Refresh" content="1">
    
    <!--
    1秒后进行跳转
    -->
    <meta http-equiv="Refresh" content="1;url=http://www.baidu.com">

    Expires:设置缓存日期

    <!--
    content="0" 表示禁用浏览器缓存页面
    -->
    <meta http-equiv="Expires",content="Mon,12 May 2001 00:20:00 GMT">


    Widows-Target:强制显示

    <meta http-equiv="Windows-Target" content="_top">

    Pragma:禁止缓存当前页面

    <meta http-equiv="Pragma" content="no-cache">
    
    <!--
    也可以这样
    -->
    <meta http-equiv="Cache-Control" content="no-cache">

    Page-Enter和Pager-Exit

    设置网页开始和结束的显示方式

    <meta http-equiv="Page-Enter" content="revealTrans(Transition=23,Duration=1.000)">

    name:

    值:

    keywords

    description

    robots(此时content的值可为:index,noindex,follow,nofollow,all,none)

    generator

    author

    copyright



  • 相关阅读:
    [BZOJ4755][JSOI2016]扭动的回文串(manacher+Hash)
    十二省联考2019部分题解
    [BZOJ2959]长跑(LCT+并查集)
    [BZOJ4541][HNOI2016]矿区(平面图转对偶图)
    笛卡尔树
    [CF896C]Willem, Chtholly and Seniorious(珂朵莉树)
    [BZOJ4349]最小树形图
    [BZOJ1858][SCOI2010]序列操作(线段树)
    [PA2014]Parking
    [PA2014]Budowa
  • 原文地址:https://www.cnblogs.com/wjchang/p/3671567.html
Copyright © 2011-2022 走看看