语言小结
  • program-language-note
  • contact
  • common
    • 代码风格
    • 概念语法
      • 类型
      • 注释
      • 字符
      • 语句
      • 操作符
      • 函数
        • 递归
    • 格式化参数
    • 源码结构
    • 数据结构
    • 名词
  • 电路
    • 内存地址
    • Untitled
    • Code
  • C
    • note
    • overview
      • helloworld.c
      • c标准
      • 关键字
      • tips
      • util.c
    • 语法
      • 函数
        • main
      • const
      • static
      • 作用域
    • 编译和运行
      • c代码内存模型
      • 预处理
        • include
        • define
    • 头文件
    • 基本数据类型
      • 整型
      • 枚举
      • 浮点型
      • 指针
      • 数组
      • 结构和联合
    • 指针&数组、指针&函数
    • API
    • 存储结构
    • 操作符
      • sizeof
    • typedef
    • 输入输出
    • 格式化参数
    • 左値右値
    • 性能思考
    • volatile
    • 字符串
      • find_char.c
    • 动态分配
      • alloc.h
      • alloc.c
      • alloc_usage.c
    • note
  • cpp
    • 资源
    • note
    • 数据结构
    • 智能指针
    • 编译过程
  • shell
    • usage
    • Untitled
  • Rust
    • overview
  • Lisp
    • Untitled
  • web
    • overview
      • index
      • 软件工具
      • ARIA规范
      • SEO
    • style
    • html
      • 标签、元素
        • 标签快记
        • 联系信息
        • 引用
        • 列表
        • 语言设置
        • meta
      • 页面结构
        • 图片
        • 视频
        • 引用css、js文件
      • 等价字符
      • 链接
        • 邮件
      • 表单
        • note
      • 表格
    • css
      • 字体
      • 布局
        • position
        • float
        • display
        • flexbox
    • js
    • note
  • java
    • note
    • java语言程序设计
    • 设计模式
      • 大话设计模式-吴强-2010
      • 大话设计模式-程杰
      • 设计模式-gof
      • 设计模式解析
      • 原则
      • 单例
    • java程序设计第10版-基础
    • java程序设计第10版-进阶
    • java核心技术第9版-I
    • jar包
    • 安全
    • 反射
  • python
    • note
    • index
    • 个人记忆点
    • 疑惑
    • simple
    • 精通Python爬虫框架scrapy
    • 语法
    • scrapy
      • notice
      • index
  • 汇编
    • Untitled
  • kotlin
    • index
    • note
    • by android
      • note
      • index
  • groovy
    • gradle
Powered by GitBook
On this page
  • 整体
  • 主体各部分
  • 例子

Was this helpful?

  1. web
  2. html

页面结构

整体

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>My test page</title>
  </head>
  <body>
    <p>This is my page</p>
  </body>
  <footer>
  copyrights
  </footer>
</html>

head中的自定义图标

可以在收藏书签等场景出现:

<!-- third-generation iPad with high-resolution Retina display: -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="https://developer.cdn.mozilla.net/static/img/favicon144.a6e4162070f4.png">
<!-- iPhone with high-resolution Retina display: -->
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="https://developer.cdn.mozilla.net/static/img/favicon114.0e9fabd44f85.png">
<!-- first- and second-generation iPad: -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="https://developer.cdn.mozilla.net/static/img/favicon72.8ff9d87c82a0.png">
<!-- non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
<link rel="apple-touch-icon-precomposed" href="https://developer.cdn.mozilla.net/static/img/favicon57.a2490b9a2d76.png">
<!-- basic favicon -->
<link rel="shortcut icon" href="https://developer.cdn.mozilla.net/static/img/favicon32.e02854fdcf73.png">

这个标签也有属性:

type="image/x-icon"

主体各部分

<body>
    <header />
    <nav /> #页面导航,不能有二级页面
    <main>
        <article>
            <header />
        </article>
        <section />
        <div />
        <aside />  #侧边栏
    </main>
</body>

例子

<!-- 历史遗留标签,表示文档类型 -->
<!DOCTYPE html>
<!--  根元素  -->
<html lang="zh-CN">
    <!-- 非用户可见内容。包括搜索引擎关键字和页面描述,引用CSS和encode等   -->
    <head>
        <!-- 元数据,可以自定义并利用以提供更好的体验 -->
        <meta charset="utf-8">
        <meta name="author" content="TpOut">
        <meta name="description" content="Mdn learning area">
        <meta property="custome" content="custome content">
        <!-- 显示在浏览器的标签页  -->
        <title>My test page</title>

        <!-- 缩略icon的兼容显示方式 -->
        <!-- third-generation iPad with high-resolution Retina display: -->
        <link rel="apple-touch-icon-precomposed" sizes="144x144"
            href="https://developer.cdn.mozilla.net/static/img/favicon144.a6e4162070f4.png">
        <!-- iPhone with high-resolution Retina display: -->
        <link rel="apple-touch-icon-precomposed" sizes="114x114"
            href="https://developer.cdn.mozilla.net/static/img/favicon114.0e9fabd44f85.png">
        <!-- first- and second-generation iPad: -->
        <link rel="apple-touch-icon-precomposed" sizes="72x72"
            href="https://developer.cdn.mozilla.net/static/img/favicon72.8ff9d87c82a0.png">
        <!-- non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
        <link rel="apple-touch-icon-precomposed"
            href="https://developer.cdn.mozilla.net/static/img/favicon57.a2490b9a2d76.png">
        <!-- 默认icon -->
        <link rel="shortcut icon"
            href="https://developer.cdn.mozilla.net/static/img/favicon32.e02854fdcf73.png">
        <!-- 样式表 -->
        <link href="./styles/style.css" rel="stylesheet" type="text/css">
        <!-- 字体 -->
        <link href="https://fonts.googleapis.com/css?family=Roboto"
            rel="stylesheet"
            type="text/css">
        <!--内嵌-->
        <style> p { padding: 0% }</style>
    </head>

    <!-- 用户可见内容 -->
    <body>
        <!-- 页眉,可以配合<body>,<section>等 -->
        <header>
            <!--  主要导航功能  -->
            <nav>
                <ul>
                    <li><span>Home</span></li>
                    <li><a href="#">Get started</a></li>
                    <li><a href="#">Photos</a></li>
                    <li><a href="#">Gear</a></li>
                    <li><a href="#">Forum</a></li>
                </ul>
            </nav>
        </header>
        <!-- 独特内容,一个页面一次,放在<body>中  -->
        <main>
            <!-- 单独内容,与页面上的其他内容无关 -->
            <article class="">
                <h2>Welcome</h2>

                <p>Welcome</p>
            </article>
            <!-- 类似<article>,但是一般都是伴随出现 -->
            <section>
                <!--不要同时添加allow-scripts和allow-same-origin到你的sandbox,不然会被关闭沙盒 -->
                <iframe src="https://developer.mozilla.org/en-US/docs/Glossary"
                    width="100%" height="500" frameborder="1"
                    allowfullscreen sandbox>
                    <p> <a
                            href="https://developer.mozilla.org/en-US/docs/Glossary">
                            Fallback link for browsers that don't support
                            iframes
                        </a> </p>
                </iframe>
            </section>
            <!-- 和主要内容不会有直接联系,但是也是有间接联系 -->
            <aside class="">
                <h2>Favourite photos</h2>

                <a href="./images/favorite-1.jpg"><img
                        src="./images/favorite-1_th.jpg" alt="Small black bird,
                        black claws, long black slender beak, links to larger
                        version of the
                        image"></a>
                <a href="favorite-2.jpg"><img src="favorite-2_th.jpg" alt="Top
                        half of a
                        pretty bird with bright blue plumage on neck, light
                        colored beak, blue
                        headdress, links to larger version of the image"></a>
            </aside>
        </main>
        <!-- 页脚 -->
        <footer>
            <p>Chris Mills, 2016.</p>
            <p><a href="http://game-icons.net/lorc/originals/dove.html">Dove
                    icon</a> by Lorc.</p>
        </footer>
    </body>
</html>
PreviousmetaNext图片

Last updated 5 years ago

Was this helpful?