日期:2014-05-17  浏览次数:20552 次

怎么定义每一行的文字下面都有下划线虚线?
一个div里面,有很多文字,会自动分行显示。
我希望每行文字的下面都有下划线,且是虚线。

如何设置?

<div style="">
内容内容内容内容内容内容内容内容内容内容
</div>

------解决方案--------------------
border-bottom:1px dashed red;
------解决方案--------------------
定义好DIV的宽度, 内容不够也会用下滑线

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>star</title> 

</head>
<body>
<div style="border-bottom:1px dashed red; width:400px;">
内容内容内容内容内容内容内容内容内容内容内容
</div>
</body> 
</html>
------解决方案--------------------
<style type="text/css" media="all">
div{ background:url(line_bg.gif) repeat-y; line-height:28px; }
</style>

<div>xxxx</div>
-----------------------------
做一个虚线背景,高度和DIV行距保持一致,比如28px; 虚线背景宽度可以比DIV的宽度大一些。
------解决方案--------------------
你硬要的话就用text-decoration:去设置吧