来源:ITPOW(www.itpow.com)
首字下沉的 CSS 代码很简单,其中的关键属性是:float 和 font-size,具体见以下代码。
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>首字下沉</title> <style type="text/css"> .first { float:left; font-size:180%; color:#990000; font-weight:bold; } </style> </head> <body> <div style="width:150px;"> <span class="first">首</span>字下沉首字下沉首字下沉首字下沉首字下沉首字下沉首字下沉 </div> </body> </html>[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
我们的文章内容一般是从数据库中读取出来的,原始的文章内容不可能为第一个文字加上<span class="first"></span>,所以输出前需要利用 ASP 等一些程序进行处理。
创建于2005年 渝ICP备05010272号-1
电邮:cftea@126.com