Do you really understand HTML? _html/css_WEB-ITnose
Jun 24, 2016 am 11:58 AM
Many websites set {margin:0; padding:0;} for divs, right? Demo click here - -
心里懷著這樣的疑問,抱著試一試的態(tài)度,我們?nèi)タ纯闯S玫臉?biāo)簽?zāi)切┯心J(rèn)的margin/padding?
FF 32.0:
==== Margin ==== h1,21.4333px,0px,21.4333px,0pxh2,19.9167px,0px,19.9167px,0pxh3,18.7167px,0px,18.7167px,0pxh4,21.2833px,0px,21.2833px,0pxh5,22.1833px,0px,22.1833px,0pxh6,24.9667px,0px,24.9667px,0pxp,16px,0px,16px,0pxul,16px,0px,16px,0pxol,16px,0px,16px,0pxdl,16px,0px,16px,0pxdd,0px,0px,0px,40pxhr,8px,0px,8px,0pxpre,16px,0px,16px,0pxfigure,16px,40px,16px,40pxfieldset,0px,2px,0px,2pxblockquote,16px,40px,16px,40pxtextarea,1px,0px,1px,0pxtextarea,1px,0px,1px,0px==== Padding ====ul,0px,0px,0px,40pxol,0px,0px,0px,40pxth,1px,1px,1px,1pxtd,1px,1px,1px,1pxtd,1px,1px,1px,1pxfieldset,5.6px,10px,12px,10pxlegend,0px,2px,0px,2pxinput,2px,2px,2px,2pxselect,1px,1px,1px,1pxoption,0px,5px,0px,3pxoption,0px,5px,0px,3pxtextarea,2px,2px,2px,2pxbutton,0px,6px,0px,6pxselect,1px,1px,1px,1pxoption,0px,0px,0px,20pxoption,0px,0px,0px,20pxtextarea,2px,2px,2px,2px
Chrome 36.0:
==== Margin ==== h1,21.440000534057617px,0px,21.440000534057617px,0pxh2,19.920000076293945px,0px,19.920000076293945px,0pxh3,18.719999313354492px,0px,18.719999313354492px,0pxh4,21.280000686645508px,0px,21.280000686645508px,0pxh5,22.17759895324707px,0px,22.17759895324707px,0pxh6,27.959999084472656px,0px,27.959999084472656px,0pxp,16px,0px,16px,0pxul,16px,0px,16px,0pxol,16px,0px,16px,0pxdl,16px,0px,16px,0pxdd,0px,0px,0px,40pxhr,8px,0px,8px,0pxpre,13px,0px,13px,0pxfigure,16px,40px,16px,40pxfieldset,0px,2px,0px,2pxblockquote,16px,40px,16px,40pxinput,2px,2px,2px,2pxkeygen,2px,2px,2px,2pxtextarea,2px,2px,2px,2pxbutton,2px,2px,2px,2pxselect,2px,2px,2px,2pxtextarea,2px,0px,2px,0px==== Padding ====ul,0px,0px,0px,40pxol,0px,0px,0px,40pxth,1px,1px,1px,1pxtd,1px,1px,1px,1pxtd,1px,1px,1px,1pxfieldset,5.599999904632568px,12px,10px,12pxlegend,0px,2px,0px,2pxinput,1px,0px,1px,0pxtextarea,2px,2px,2px,2pxbutton,1px,6px,1px,6pxtextarea,2px,2px,2px,2px
IE 10:
==== Margin ==== h1,21.44px,0px,21.44px,0pxh2,19.92px,0px,19.92px,0pxh3,18.73px,0px,18.73px,0pxh4,21.28px,0px,21.28px,0pxh5,22.15px,0px,22.15px,0pxh6,25px,0px,25px,0pxp,16px,0px,16px,0pxul,16px,0px,16px,0pxol,16px,0px,16px,0pxdl,16px,0px,16px,0pxdd,0px,0px,0px,40pxhr,8px,0px,8px,0pxpre,13.33px,0px,13.33px,0pxfigure,16px,40px,16px,40pxfieldset,0px,2px,0px,2pxblockquote,16px,40px,16px,40px==== Padding ====ul,0px,0px,0px,40pxol,0px,0px,0px,40pxth,1px,1px,1px,1pxtd,1px,1px,1px,1pxtd,1px,1px,1px,1pxfieldset,2px,2px,3px,2pxlegend,0px,2px,0px,2pxinput,2px,1px,2px,1pxtextarea,2px,2px,2px,2pxbutton,3px,10px,3px,10pxtextarea,2px,2px,2px,2px
IE 9:
==== Margin ==== h1,21.44px,0px,21.44px,0pxh2,19.92px,0px,19.92px,0pxh3,18.73px,0px,18.73px,0pxh4,21.28px,0px,21.28px,0pxh5,22.15px,0px,22.15px,0pxh6,25px,0px,25px,0pxp,16px,0px,16px,0pxul,16px,0px,16px,0pxol,16px,0px,16px,0pxdl,16px,0px,16px,0pxdd,0px,0px,0px,40pxhr,8px,0px,8px,0pxpre,13.33px,0px,13.33px,0pxfigure,16px,40px,16px,40pxfieldset,0px,2px,0px,2pxblockquote,16px,40px,16px,40px==== Padding ====ul,0px,0px,0px,40pxol,0px,0px,0px,40pxth,1px,1px,1px,1pxtd,1px,1px,1px,1pxtd,1px,1px,1px,1pxfieldset,2px,2px,3px,2pxlegend,0px,2px,0px,2pxinput,2px,1px,2px,1pxtextarea,2px,2px,2px,2pxbutton,3px,10px,3px,10pxtextarea,2px,2px,2px,2px
IE 8:
==== Margin ==== h3,1em,0em,1em,0em h4,1.33em,0em,1.33em,0em h5,1.67em,0em,1.67em,0em h6,2.33em,0em,2.33em,0em p,1em,0px,1em,0px ul,1em,0px,1em,0px ol,1em,0px,1em,0px dl,1em,0px,1em,0px dd,auto,auto,auto,40px hr,0.5em,auto,0.5em,auto pre,1em,0px,1em,0px fieldset,0px,2px,0px,2px blockquote,1em,40px,1em,40px ==== Padding ==== ul,0px,0px,0px,30pt ol,0px,0px,0px,30pt th,1px,1px,1px,1px td,1px,1px,1px,1px td,1px,1px,1px,1px fieldset,0px,2px,3px,2px legend,0px,2px,0px,2px input,2px,1px,2px,1px textarea,2px,2px,2px,2px button,3px,10px,3px,10px textarea,2px,2px,2px,2px
IE 7:
==== Margin ==== ul,auto,auto,auto,30pt ol,auto,auto,auto,30pt dd,auto,auto,auto,30pt blockquote,auto,30pt,auto,30pt ==== Padding ==== caption,1px,300zzz,500zzz,300zzz th,1px,1px,1px,1px td,1px,1px,1px,1px td,1px,1px,1px,1px fieldset,0px,2px,3px,2px legend,0px,2px,0px,2px input,2px,1px,2px,1px textarea,2px,2px,2px,2px button,1px,0.5px,1px,0.5px textarea,2px,2px,2px,2px
IE 6:
==== Margin ==== ul,auto,auto,auto,30pt ol,auto,auto,auto,30pt dd,auto,auto,auto,30pt blockquote,auto,30pt,auto,30pt ==== Padding ==== caption,1px,3px,5px,3px th,1px,1px,1px,1px td,1px,1px,1px,1px td,1px,1px,1px,1px fieldset,0px,2px,3px,2px legend,0px,2px,0px,2px input,1px,1px,1px,1px textarea,2px,2px,2px,2px textarea,2px,2px,2px,2px
Sogou:
==== Margin ==== h1,21.440000534057617px,0px,21.440000534057617px,0pxh2,19.920000076293945px,0px,19.920000076293945px,0pxh3,18.719999313354492px,0px,18.719999313354492px,0pxh4,21.280000686645508px,0px,21.280000686645508px,0pxh5,22.17759895324707px,0px,22.17759895324707px,0pxh6,27.959999084472656px,0px,27.959999084472656px,0pxp,16px,0px,16px,0pxul,16px,0px,16px,0pxol,16px,0px,16px,0pxdl,16px,0px,16px,0pxdd,0px,0px,0px,40pxhr,8px,0px,8px,0pxpre,13px,0px,13px,0pxfigure,16px,40px,16px,40pxfieldset,0px,2px,0px,2pxblockquote,16px,40px,16px,40pxinput,2px,2px,2px,2pxkeygen,2px,2px,2px,2pxtextarea,2px,2px,2px,2pxbutton,2px,2px,2px,2pxselect,2px,2px,2px,2pxtextarea,2px,0px,2px,0px==== Padding ====ul,0px,0px,0px,40pxol,0px,0px,0px,40pxth,1px,1px,1px,1pxtd,1px,1px,1px,1pxtd,1px,1px,1px,1pxfieldset,5.599999904632568px,12px,10px,12pxlegend,0px,2px,0px,2pxinput,1px,0px,1px,0pxtextarea,2px,2px,2px,2pxbutton,1px,6px,1px,6pxtextarea,2px,2px,2px,2px
360 Security:
==== Margin ==== h1,21.440000534057617px,0px,21.440000534057617px,0pxh2,19.920000076293945px,0px,19.920000076293945px,0pxh3,18.719999313354492px,0px,18.719999313354492px,0pxh4,21.280000686645508px,0px,21.280000686645508px,0pxh5,22.17759895324707px,0px,22.17759895324707px,0pxh6,27.959999084472656px,0px,27.959999084472656px,0pxp,16px,0px,16px,0pxul,16px,0px,16px,0pxol,16px,0px,16px,0pxdl,16px,0px,16px,0pxdd,0px,0px,0px,40pxhr,8px,0px,8px,0pxpre,13px,0px,13px,0pxfigure,16px,40px,16px,40pxfieldset,0px,2px,0px,2pxblockquote,16px,40px,16px,40pxinput,2px,2px,2px,2pxkeygen,2px,2px,2px,2pxtextarea,2px,2px,2px,2pxbutton,2px,2px,2px,2pxselect,2px,2px,2px,2pxtextarea,2px,0px,2px,0px==== Padding ====ul,0px,0px,0px,40pxol,0px,0px,0px,40pxth,1px,1px,1px,1pxtd,1px,1px,1px,1pxtd,1px,1px,1px,1pxfieldset,5.599999904632568px,12px,10px,12pxlegend,0px,2px,0px,2pxinput,1px,0px,1px,0pxtextarea,2px,2px,2px,2pxbutton,1px,6px,1px,6pxtextarea,2px,2px,2px,2px
Opera 24.0:
==== Margin ==== h1,21.4400005340576px,0px,21.4400005340576px,0pxh2,19.9200000762939px,0px,19.9200000762939px,0pxh3,18.7199993133545px,0px,18.7199993133545px,0pxh4,21.2800006866455px,0px,21.2800006866455px,0pxh5,22.1775989532471px,0px,22.1775989532471px,0pxh6,27.9599990844727px,0px,27.9599990844727px,0pxp,16px,0px,16px,0pxul,16px,0px,16px,0pxol,16px,0px,16px,0pxdl,16px,0px,16px,0pxdd,0px,0px,0px,40pxhr,8px,0px,8px,0pxpre,13px,0px,13px,0pxfigure,16px,40px,16px,40pxfieldset,0px,2px,0px,2pxblockquote,16px,40px,16px,40pxinput,2px,2px,2px,2pxkeygen,2px,2px,2px,2pxtextarea,2px,2px,2px,2pxbutton,2px,2px,2px,2pxselect,2px,2px,2px,2pxtextarea,2px,0px,2px,0px==== Padding ====ul,0px,0px,0px,40pxol,0px,0px,0px,40pxth,1px,1px,1px,1pxtd,1px,1px,1px,1pxtd,1px,1px,1px,1pxfieldset,5.59999990463257px,12px,10px,12pxlegend,0px,2px,0px,2pxinput,1px,0px,1px,0pxtextarea,2px,2px,2px,2pxbutton,1px,6px,1px,6pxtextarea,2px,2px,2px,2px
Safari 5.17:
==== Margin ==== h1,21px,0px,21px,0pxh2,19px,0px,19px,0pxh3,18px,0px,18px,0pxh4,21px,0px,21px,0pxh5,22px,0px,22px,0pxh6,24px,0px,24px,0pxp,16px,0px,16px,0pxul,16px,0px,16px,0pxol,16px,0px,16px,0pxdl,16px,0px,16px,0pxdd,0px,0px,0px,40pxhr,8px,0px,8px,0pxpre,13px,0px,13px,0pxfigure,16px,40px,16px,40pxfieldset,0px,2px,0px,2pxblockquote,16px,40px,16px,40pxinput,2px,2px,2px,2pxkeygen,2px,2px,2px,2pxtextarea,2px,2px,2px,2pxbutton,2px,2px,2px,2pxselect,2px,2px,2px,2pxtextarea,2px,0px,2px,0px==== Padding ====ul,0px,0px,0px,40pxol,0px,0px,0px,40pxth,1px,1px,1px,1pxtd,1px,1px,1px,1pxtd,1px,1px,1px,1pxfieldset,5px,12px,10px,12pxlegend,0px,2px,0px,2pxinput,1px,0px,1px,0pxtextarea,2px,2px,2px,2pxbutton,1px,6px,1px,6pxselect,2px,21px,2px,4pxtextarea,2px,2px,2px,2px
Common block elements and features:
<!-- 塊元素:獨(dú)占一行,寬(100%)、高、行高、padding、margin可控 --><h1>h1</h1><h2>h2</h2><h3>h3</h3><h4>h4</h4><h5>h5</h5><h6>h6</h6><p>p</p><ul> <li>無序列表</li></ul><ol> <li>有序列表</li></ol><dl> <dt>自定義列表項(xiàng)目</dt> <dd>自定義列表描述</dd></dl><table> <caption>表格標(biāo)題</caption> <!-- 設(shè)置表格中列 --> <col align="right" /> <thead> <tr> <th>表格頭欄目</th> </tr> </thead> <tbody> <tr> <td>表格單元格</td> </tr> </tbody> <tfoot> <!-- 設(shè)置表格中多列 --> <colgroup span="1" align="left"></colgroup> <tr> <td>表格單元格</td> </tr> </tfoot></table><div>div</div><nav></nav><header>header</header><footer>footer</footer><section>section</section><article>article</article><aside>aside</aside><hr /><pre class="brush:php;toolbar:false">預(yù)格式文本
塊引用
Commonly used inline elements and characteristics:
<!-- 內(nèi)聯(lián)元素:不獨(dú)占一行,寬、高、行高、豎向padding、豎向margin不可控 --><span>span</span><strong>強(qiáng)調(diào)文本</strong><em>強(qiáng)調(diào)文本</em><a href=""></a><label>label:</label><b>粗體文本</b><var>文本中的變量</var><bdo dir="rtl">定義文字方向ltr/rtl</bdo><code>代碼</code><del>被刪除文本</del><i>斜體文本</i><ins>被插入文本</ins><small>小號文本</small><sup>上標(biāo)</sup><sub>下標(biāo)</sub><time datatime="2008-08-08">日期/時間</time><br /><wbr>在文本中何處換行</wbr><q>短引用</q>
Commonly used inline block elements and characteristics:
<!-- 內(nèi)聯(lián)塊元素:不獨(dú)占一行,寬、高、行高、padding、margin可控 --><input type="text"><keygen name="security" /><textarea>多行文本</textarea><button>按鈕</button><select> <optgroup> <option>選項(xiàng)1-1</option> </optgroup> <optgroup> <option>選項(xiàng)2-1</option> </optgroup> </select><iframe frameborder="0" src=""></iframe><img usemap="#map" src="" alt="" /><map name="map" id="map"> <area shape="rect" coords="0, 0, 20, 20" href="" alt=""></map><embed src="no.swf"><object> <param name="min" value="0" /></object><!-- 預(yù)定義范圍內(nèi)的度量 --><meter value="3" min="0" max="10">3/10</meter><!-- progress 進(jìn)度 --><progress value="30" max="100"></progress>
Event reference:
<!-- 常用屬性:類名: class唯一標(biāo)示: id行內(nèi)樣式: style額外提示信息: title是否可編輯: contenteditable = true/false是否可拖拽: draggable = true/false是否自動提示: autocomplete = on/offtab鍵次序: tabindex = number私有數(shù)據(jù): data-*--><!-- window:onafterprint 文檔打印之后運(yùn)行的腳本onbeforeprint 文檔打印之前運(yùn)行的腳本onbeforeunload 文檔卸載之前運(yùn)行的腳本onerror 在錯誤發(fā)生時運(yùn)行的腳本onhaschange 當(dāng)文檔已改變時運(yùn)行的腳本onload 頁面結(jié)束加載之后觸發(fā)onmessage 在消息被觸發(fā)時運(yùn)行的腳本onoffline 當(dāng)文檔離線時運(yùn)行的腳本ononline 當(dāng)文檔上線時運(yùn)行的腳本onpagehide 當(dāng)窗口隱藏時運(yùn)行的腳本onpageshow 當(dāng)窗口成為可見時運(yùn)行的腳本onpopstate 當(dāng)窗口歷史記錄改變時運(yùn)行的腳本onredo 當(dāng)文檔執(zhí)行撤銷(redo)時運(yùn)行的腳本onresize 當(dāng)瀏覽器窗口被調(diào)整大小時觸發(fā)onstorage 在 Web Storage 區(qū)域更新后運(yùn)行的腳本onundo 在文檔執(zhí)行 undo 時運(yùn)行的腳本onunload 一旦頁面已下載時觸發(fā)(或者瀏覽器窗口已被關(guān)閉)--><!-- form:onblur 元素失去焦點(diǎn)時運(yùn)行的腳本onchange 在元素值被改變時運(yùn)行的腳本oncontextmenu 當(dāng)上下文菜單被觸發(fā)時運(yùn)行的腳本onfocus 當(dāng)元素失去焦點(diǎn)時運(yùn)行的腳本onformchange 在表單改變時運(yùn)行的腳本onforminput 當(dāng)表單獲得用戶輸入時運(yùn)行的腳本oninput 當(dāng)元素獲得用戶輸入時運(yùn)行的腳本oninvalid 當(dāng)元素?zé)o效時運(yùn)行的腳本onreset 當(dāng)表單中的重置按鈕被點(diǎn)擊時觸發(fā)。HTML5 中不支持onselect 在元素中文本被選中后觸發(fā)onsubmit 在提交表單時觸發(fā)--><!-- 鍵盤事件:onkeydown 在用戶按下按鍵時觸發(fā)onkeypress 在用戶敲擊按鈕時觸發(fā)onkeyup 當(dāng)用戶釋放按鍵時觸發(fā)--><!-- 鼠標(biāo)事件:onclick 元素上發(fā)生鼠標(biāo)點(diǎn)擊時觸發(fā)ondblclick 元素上發(fā)生鼠標(biāo)雙擊時觸發(fā)ondrag 元素被拖動時運(yùn)行的腳本ondragend 在拖動操作末端運(yùn)行的腳本ondragenter 當(dāng)元素元素已被拖動到有效拖放區(qū)域時運(yùn)行的腳本ondragleave 當(dāng)元素離開有效拖放目標(biāo)時運(yùn)行的腳本ondragover 當(dāng)元素在有效拖放目標(biāo)上正在被拖動時運(yùn)行的腳本ondragstart 在拖動操作開端運(yùn)行的腳本ondrop 當(dāng)被拖元素正在被拖放時運(yùn)行的腳本onmousedown 當(dāng)元素上按下鼠標(biāo)按鈕時觸發(fā)onmousemove 當(dāng)鼠標(biāo)指針移動到元素上時觸發(fā)onmouseout 當(dāng)鼠標(biāo)指針移出元素時觸發(fā)onmouseover 當(dāng)鼠標(biāo)指針移動到元素上時觸發(fā)onmouseup 當(dāng)在元素上釋放鼠標(biāo)按鈕時觸發(fā)onmousewheel 當(dāng)鼠標(biāo)滾輪正在被滾動時運(yùn)行的腳本onscroll 當(dāng)元素滾動條被滾動時運(yùn)行的腳本--><!-- 媒體事件:onabort 在退出時運(yùn)行的腳本oncanplay 當(dāng)文件就緒可以開始播放時運(yùn)行的腳本(緩沖已足夠開始時)oncanplaythrough 當(dāng)媒介能夠無需因緩沖而停止即可播放至結(jié)尾時運(yùn)行的腳本ondurationchange 當(dāng)媒介長度改變時運(yùn)行的腳本onemptied 當(dāng)發(fā)生故障并且文件突然不可用時運(yùn)行的腳本(比如連接意外斷開時)onended 當(dāng)媒介已到達(dá)結(jié)尾時運(yùn)行的腳本(可發(fā)送類似“感謝觀看”之類的消息)onerror 當(dāng)在文件加載期間發(fā)生錯誤時運(yùn)行的腳本onloadeddata 當(dāng)媒介數(shù)據(jù)已加載時運(yùn)行的腳本onloadedmetadata 當(dāng)元數(shù)據(jù)(比如分辨率和時長)被加載時運(yùn)行的腳本onloadstart 在文件開始加載且未實(shí)際加載任何數(shù)據(jù)前運(yùn)行的腳本onpause 當(dāng)媒介被用戶或程序暫停時運(yùn)行的腳本onplay 當(dāng)媒介已就緒可以開始播放時運(yùn)行的腳本onplaying 當(dāng)媒介已開始播放時運(yùn)行的腳本onprogress 當(dāng)瀏覽器正在獲取媒介數(shù)據(jù)時運(yùn)行的腳本onratechange 每當(dāng)回放速率改變時運(yùn)行的腳本(比如當(dāng)用戶切換到慢動作或快進(jìn)模式)onreadystatechange 每當(dāng)就緒狀態(tài)改變時運(yùn)行的腳本(就緒狀態(tài)監(jiān)測媒介數(shù)據(jù)的狀態(tài))onseeked 當(dāng) seeking 屬性設(shè)置為 false(指示定位已結(jié)束)時運(yùn)行的腳本onseeking 當(dāng) seeking 屬性設(shè)置為 true(指示定位是活動的)時運(yùn)行的腳本onstalled 在瀏覽器不論何種原因未能取回媒介數(shù)據(jù)時運(yùn)行的腳本onsuspend 在媒介數(shù)據(jù)完全加載之前不論何種原因終止取回媒介數(shù)據(jù)時運(yùn)行的腳本ontimeupdate 當(dāng)播放位置改變時(比如當(dāng)用戶快進(jìn)到媒介中一個不同的位置時)運(yùn)行的腳本onvolumechange 每當(dāng)音量改變時(包括將音量設(shè)置為靜音)時運(yùn)行的腳本onwaiting 當(dāng)媒介已停止播放但打算繼續(xù)播放時(比如當(dāng)媒介暫停已緩沖更多數(shù)據(jù))運(yùn)行腳本-->

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

It is a block-level element, used to divide large block content areas; it is an inline element, suitable for wrapping small segments of text or content fragments. The specific differences are as follows: 1. Exclusively occupy a row, width and height, inner and outer margins can be set, which are often used in layout structures such as headers, sidebars, etc.; 2. Do not wrap lines, only occupy the content width, and are used for local style control such as discoloration, bolding, etc.; 3. In terms of usage scenarios, it is suitable for the layout and structure organization of the overall area, and is used for small-scale style adjustments that do not affect the overall layout; 4. When nesting, it can contain any elements, and block-level elements should not be nested inside.

To get started with HTML quickly, you only need to master a few basic tags to build a web skeleton. 1. The page structure is essential, and, which is the root element, contains meta information, and is the content display area. 2. Use the title. The higher the level, the smaller the number. Use tags to segment the text to avoid skipping the level. 3. The link uses tags and matches the href attributes, and the image uses tags and contains src and alt attributes. 4. The list is divided into unordered lists and ordered lists. Each entry is represented and must be nested in the list. 5. Beginners don’t have to force memorize all tags. It is more efficient to write and check them while you are writing. Master the structure, text, links, pictures and lists to create basic web pages.

ShadowDOM is a technology used in web component technology to create isolated DOM subtrees. 1. It allows the mount of an independent DOM structure on ordinary HTML elements, with its own styles and behaviors, and does not affect the main document; 2. Created through JavaScript, such as using the attachShadow method and setting the mode to open; 3. When used in combination with HTML, it has three major features: clear structure, style isolation and content projection (slot); 4. Notes include complex debugging, style scope control, performance overhead and framework compatibility issues. In short, ShadowDOM provides native encapsulation capabilities for building reusable and non-polluting UI components.

Image not displayed is usually caused by a wrong file path, incorrect file name or extension, HTML syntax issues, or browser cache. 1. Make sure that the src path is consistent with the actual location of the file and use the correct relative path; 2. Check whether the file name case and extension match exactly, and verify whether the image can be loaded by directly entering the URL; 3. Check whether the img tag syntax is correct, ensure that there are no redundant characters and the alt attribute value is appropriate; 4. Try to force refresh the page, clear the cache, or use incognito mode to eliminate cache interference. Troubleshooting in this order can solve most HTML image display problems.

The style placement method needs to be selected according to the scene. 1. Inline is suitable for temporary modification of single elements or dynamic JS control, such as the button color changes with operation; 2. Internal CSS is suitable for projects with few pages and simple structure, which is convenient for centralized management of styles, such as basic style settings of login pages; 3. Priority is given to reuse, maintenance and performance, and it is better to split external link CSS files for large projects.

?Youcannotnesttagsinsideanothertagbecauseit’sinvalidHTML;browsersautomaticallyclosethefirstbeforeopeningthenext,resultinginseparateparagraphs.?Instead,useinlineelementslike,,orforstylingwithinaparagraph,orblockcontainerslikeortogroupmultipleparagraph

Thenameattributeinaninputtagisusedtoidentifytheinputwhentheformissubmitted;itservesasthekeyinthekey-valuepairsenttotheserver,wheretheuser'sinputisthevalue.1.Whenaformissubmitted,thenameattributebecomesthekeyandtheinputvaluebecomesthevalueinthedatasen

Pre-resolving DNS can speed up page loading speed, and using HTML link tags for DNS pre-resolving is an effective method; DNSPrefetching saves subsequent request time by resolving domain names in advance; applicable scenarios include third-party fonts, advertising statistics scripts, resource hosting and CDN domain names; it is recommended to prioritize the main page dependency resources, reasonably control the number between 3 and 5, and use it with preconnect to better effect.
