.toptab {
02 min-width:60px;/*最小宽度*/
03 _width:60px; /*实现min-width兼容 IE6*/
04 overflow: hidden;/*不出现滚动条*/
05 float:left;/*左浮动*/
06 padding:2px 6px 0 6px;/*定义元素内边框,上右下左*/
07 margin:0 10px 0 0;/*定义元素外边框,上右下左*/
08 text-align:center;/*文本居中对齐*/
09 height:22px;
10 line-height:22px; /*两个高度一致,使文本上下垂直居中 */
11 font-size: 12px;/*文字大小*/
12 background-color:#ffffff;/*元素背景颜色*/
13 color: #333333;/*文字颜色*/
14 font-weight: normal;
15 text-decoration: none;/*不出现下划线*/
16 }
ps:内联(display:inline;)属于行布局,其特性是在一行里进行布局,不能设置宽高
02 min-width:60px;/*最小宽度*/
03 _width:60px; /*实现min-width兼容 IE6*/
04 overflow: hidden;/*不出现滚动条*/
05 float:left;/*左浮动*/
06 padding:2px 6px 0 6px;/*定义元素内边框,上右下左*/
07 margin:0 10px 0 0;/*定义元素外边框,上右下左*/
08 text-align:center;/*文本居中对齐*/
09 height:22px;
10 line-height:22px; /*两个高度一致,使文本上下垂直居中 */
11 font-size: 12px;/*文字大小*/
12 background-color:#ffffff;/*元素背景颜色*/
13 color: #333333;/*文字颜色*/
14 font-weight: normal;
15 text-decoration: none;/*不出现下划线*/
16 }
ps:内联(display:inline;)属于行布局,其特性是在一行里进行布局,不能设置宽高
本文深入探讨了CSS样式设计的基础知识,包括min-width、width、overflow、float、padding、margin、text-align、height、line-height、font-size、background-color、color等属性的使用方法,同时介绍了如何通过内联(display:inline)实现行布局,以及如何避免宽度和高度的设置在不同浏览器之间的差异。文章旨在帮助开发者理解并掌握CSS布局的核心技巧。
1117

被折叠的 条评论
为什么被折叠?



