html的一些自见解

  • html 5 自带语义化,就是让标签带上感情色彩,方便人或浏览器区分
  • <b></b><strong></strong>的区别

    图片描述

    <b> 的默认样式只是将文本加粗
    <strong> 在默认样式上和 <b> 一样,将文本加粗
    但是 <strong> 在语义上更为强烈,方便浏览器或开发人员识别重点
  • <i></i><em></em>的区别

    同上
  • 内联和块元素由 css(display: block/inline) 控制
    通常说的内联元素、块元素都是标签自带的默认 display 样式
  • 常用的标签解释

    alt           可选内容,加载失败用这个代替
    src           路径
    <img>         图片
    <hr>          水平分割线
    <br>          强制换行
    <nav></nav>   导航
    <main></main> 主要内容
    <noscript></noscript> 浏览器不支持js时显示的内容
  • 最最完整的<head>标签metalinktitlestylescriptnoscriptbase

    <meta charset="utf-8">
    <meta name="author" content="xxx">
    <meta name="keyword" content="xxx">
    <meta name="discription content="xxx">
    
    <link rel="stylesheet" href="xxx/xxx.css">
    <script src="xxx/xxx.js">
  • 空标签就是只需要一个开始标签就可以了,不需要结束标签的标签
  • 可替换标签(元素)就是在没有css制定的渲染下,标签本身的样式渲染由浏览器来决定的标签(元素)
  • w3c 一个编写web各种规范的组织,任何人都能参与并书写
  • mdn 2005年mozilla发起的收集各种web规范的网站(项目)
  • 关于html所有的标签(https://www.w3.org/html/wiki/...

    The root element
    
        <html>
    
    Document metadata
    
        <head>    <title>    <base>    <isindex>
        <link>    <meta>     <style>
    
    Scripting
    
        <script>    <noscript>
    
    Sections
    
        <body>     <section>    <nav>      <article>    <aside>
        <h1>       <h2>         <h3>       <h4>         <h5>       <h6>
        <hgroup>   <header>     <footer>   <address>
    Grouping content
        
        <p>        <hr>            <pre>    <blockquote>
        <ol>       <ul>            <li>     <dl>            <dt>    <dd>
        <figure>   <figcaption>    <div>    <center>
    
    Text-level semantics
    
        <a>       <em>           <strong>    <small>      <s>        <cite>    <q>  <dfn>
        <abbr>    <time>         <code>      <var>        <samp>
        <kbd>     <sub>、<sup>   <i>         <b>
        <mark>    <ruby>         <rt>        <rp>         <bdo>
        <span>    <br>           <wbr>       <tt>         <u>        <strike>
        <big>     <basefont>     <font>      <acronym>    <blink>    <marquee>
        <nobr>    <spacer>       <listing>   <xmp>        <nextid>
    
    Edits
    
        <ins>    <del>
    Embedded content
    
        <img>      <iframe>      <embed>       <object>      <param>
        <video>    <audio>       <source>      <track>       <canvas>
        <map>      <area>        <math>        <svg>         <applet>
        <frame>    <frameset>    <noframes>    <bgsound>     <noembed>    <plaintext>
     
    Tables
    
        <table>    <caption>    <colgroup>    <col>
        <tbody>    <thead>      <tfoot>
        <tr>       <td>         <th>
    
    Forms
    
        <form>       <fieldset>    <legend>      <label>
        <input>      <button>      <select>      <datalist>
        <optgroup>   <option>      <textarea>    <keygen>
        <output>     <progress>    <meter>
    
    Interactive
    
        <details>    <summary>    <command>    <menu>
    Previous HTML Elements
    
        <acronym>
        <applet>     (deprecated in HTML 4.01, non conformant in HTML5)
        <basefont>   (deprecated in HTML 4.01, non conformant in HTML5)
        <bgsound>
        <big>
        <blink>
        <c>          (never deployed, was a proposal before span)
        <center>     (deprecated in HTML 4.01, non conformant in HTML5)
        <font>       (deprecated in HTML 4.01, non conformant in HTML5)
        <frame>
        <frameset>
        <isindex>    (deprecated in HTML 4.01, non conformant in HTML5)
        <listing>
        <marquee>
        <nextid>
        <nobr>    <noembed>    <noframes>    <plaintext>
        <spacer>
        <strike>     (deprecated in HTML 4.01, non conformant in HTML5)
        <tt>
        <u>          (deprecated in HTML 4.01, non conformant in HTML5)
        <xmp>

    see also in:
    https://en.wikipedia.org/wiki...
    https://www.w3.org/TR/html/
    https://www.w3.org/TR/html51/


BreezingSummer
45 声望0 粉丝