热搜:NVER node 开发 php

你真的了解HTML吗?_html/css_WEB-ITnose

2024-11-22 20:35:01
你真的了解HTML吗?_html/css_WEB-ITnose

很多网站都对div设置{margin:0; padding:0;}对吗?Demo戳这里 - -

心里怀着这样的疑问,抱着试一试的态度,我们去看看常用的标签那些有默认的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

搜狗:

==== 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 安全:

==== 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

常用块元素及特点:

h1

h2

h3

h4

h5
h6

p

  • 无序列表
  1. 有序列表
自定义列表项目
自定义列表描述
表格标题
表格头栏目
表格单元格
表格单元格
div
header
footer
section
article
aside
预格式文本
标题
表单标题:
文档作者或拥有者的联系信息
块引用

常用内联元素及特点:

span强调文本强调文本粗体文本文本中的变量定义文字方向ltr/rtl代码被删除文本斜体文本被插入文本小号文本上标下标
在文本中何处换行短引用

常用内联块元素及特点:

        3/10 

事件参考: