当前位置:学会吧培训频道电脑知识学习网页制作HTML与CSS教程最常用的CSS小把戏(Most used CSS tricks)» 正文

最常用的CSS小把戏(Most used CSS tricks)

[09-24 14:31:53]   来源:http://www.xuehuiba.com  HTML与CSS教程   阅读:8628
概要:电脑术语解释大全 http://www.xuehuiba.com版权声明:本文版权归原作者所有 译介仅供国内读者参考本文概要:最常用的CSS Trick,诸如圆角、首字下沉等等。之前有篇译介“8个一句话CSS小诀窍”介绍了8个非常使用的一句话CSS小技巧,这周再给大家带来一篇类似的文章,介绍了一些最常用的CSS Trick,或者叫做CSS小把戏。当然我相信每个设计师都会有一些个人的偏好,我个人对文中的一些小把戏就不太感冒。1. 不使用图片的圆角效果<div id=”container”><b class=”rtop”><b class=”r1″></b> <b class=”r2″></b> <b class=”r3″></b> <b class=”r4″></b></b><!–content goes here –><b class=”rbottom”>
最常用的CSS小把戏(Most used CSS tricks),标签:html与css教程,css教程,html网页设计教程,http://www.xuehuiba.com
电脑术语解释大全 http://www.xuehuiba.com

版权声明:本文版权归原作者所有 译介仅供国内读者参考

本文概要:最常用的CSS Trick,诸如圆角、首字下沉等等。

之前有篇译介“8个一句话CSS小诀窍”介绍了8个非常使用的一句话CSS小技巧,这周再给大家带来一篇类似的文章,介绍了一些最常用的CSS Trick,或者叫做CSS小把戏。当然我相信每个设计师都会有一些个人的偏好,我个人对文中的一些小把戏就不太感冒。

1. 不使用图片的圆角效果

<div id=”container”>
<b class=”rtop”>
<b class=”r1″></b> <b class=”r2″></b> <b class=”r3″></b> <b class=”r4″></b>
</b>
<!–content goes here –>
<b class=”rbottom”>
<b class=”r4″></b> <b class=”r3″></b> <b class=”r2″></b> <b class=”r1″></b>
</b>
</div>

.rtop, .rbottom{display:block}
.rtop *, .rbottom *{display: block; height: 1px; overflow: hidden}
.r1{margin: 0 5px}
.r2{margin: 0 3px}
.r3{margin: 0 2px}
.r4{margin: 0 1px; height: 2px}

(很多人喜欢运用这样的圆角技巧,但我个人不是很喜欢,虽然不用去做圆角的图片,但是多出的这些tag总觉得很多余)

2. 样式化列表

<ol>
<li>
<p>This is line one</p>
</li>
<li>
<p>Here is line two</p>
</li>
<li>
<p>And last line</p>
</li>
</ol>

ol {
font: italic 1em Georgia, Times, serif;
color: #999999;
}

ol p {
font: normal .8em Arial, Helvetica, sans-serif;
color: #000000;
}


这个效果我也是很喜欢的,可以在序号上应用不同的字体。


3. 无表格表单

4. 双引号技巧

5. 渐变字效果

6. 垂直居中

更多内容参见原文

10. 首字下沉

<p class=”introduction”> This paragraph has the class “introduction”. If your browser supports the pseudo-class “first-letter”, the first letter will be a drop-cap. </p>

p.introduction:first-letter {
font-size : 300%;
font-weight : bold;
float : left;
width : 1em;
}

电脑术语解释大全 http://www.xuehuiba.com
Tag:HTML与CSS教程html与css教程,css教程,html网页设计教程电脑知识学习 - 网页制作 - HTML与CSS教程
《最常用的CSS小把戏(Most used CSS tricks)》相关文章
Copyright 学会吧 All Right Reserved.
在线学习社区!--学会吧
1 2 3 4 5 6 7 7 8 9 10 11 12 13