`
objet888
  • 浏览: 61308 次
  • 性别: Icon_minigender_1
  • 来自: 东莞
最近访客 更多访客>>
社区版块
存档分类
最新评论

css杂

    博客分类:
  • css
阅读更多

用图像来作列表项标记:
list-style-image: url('/i/eg_arrow.gif')

使图像浮动于一个段落的右侧。
float:right

创建水平菜单
<style type="text/css">
ul
{
float:left;
width:100%;
padding:0;
margin:0;
list-style-type:none;
}
a
{
float:left;
width:7em;
text-decoration:none;//文字装饰为无,默认的连接是有下划线的,这样可以去除下划线
color:white;
background-color:purple;
padding:0.2em 0.6em;
border-right:1px solid white;
}
a:hover {background-color:#ff3300}
li {display:inline} //li 元素显示为行内元素
</style>
</head>

<body>
<ul>
<li><a href="#">Link one</a></li>
<li><a href="#">Link two</a></li>
<li><a href="#">Link three</a></li>
<li><a href="#">Link four</a></li>
</ul>

<p>
在上面的例子中,我们把 ul 元素和 a 元素浮向左浮动。li 元素显示为行内元素(元素前后没有换行)。这样就可以使列表排列成一行。ul 元素的宽度是 100%,列表中的每个超链接的宽度是 7em(当前字体尺寸的 7 倍)。我们添加了颜色和边框,以使其更漂亮。
</p>
</body>

给超连接着色:
a:link {color: #FF0000}
a:visited {color: #00FF00}
a:hover {color: #FF00FF}
a:active {color: #0000FF}

Z-index
如何使用滚动条来显示元素内溢出的内容
overflow: scroll

使用百分比来设置元素的宽度
img {width: 50%}

在无序列表中的不同类型的列表标记
<style type="text/css">
ul.disc {list-style-type: disc}
ul.circle {list-style-type: circle}
ul.square {list-style-type: square}
ul.none {list-style-type: none}
</style>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics