如何用css画虚线

5 篇文章 0 订阅

虚线 代码

<DIV 
style="BORDER-RIGHT: #000 1px solid; PADDING-RIGHT: 20px; BORDER-TOP: #000 1px dotted; 
PADDING-LEFT: 20px; PADDING-BOTTOM: 20px; MARGIN: 80px auto; BORDER-LEFT: #000 1px dotted; 
WIDTH: 360px; PADDING-TOP: 20px; BORDER-BOTTOM: #000 1px dotted; HEIGHT: 210px">虚线 代码</DIV>


这个就是显示虚线框的代码

solid 边框由实线组成、

dotted 边框由点组成、

dash 边框由短线组成、

double 边框由双实线组成、

groove 边框带有立体感的沟槽、

ridge 边框成畸形、

inset 边框内嵌一个立方体边框、

outset 边框外嵌一个立方体--


经常可以在网页上看到很多漂亮的虚线,
今天我也研究了一下它的实现方式,
还是比较easy的现在和大家共享一下。
水平虚线的代码: <td height="1"><div style="border-top:1px dashed #cccccc;height: 1px;overflow:hidden"/></td> 
垂直虚线的代码: <td height="214" style="border-right: 1px dashed #CCCCCC; " >&nbsp;</td>

如何用css画虚线

css样式:
1
.line {
margin-top: 1px;
border-top-style: dashed;
border-top-color: #CCCCCC;
}

2
.line {
border-top: 1px dashed #CCCCCC;
}


css画虚线
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>www.webjx.com</title> 
<style type="text/css"> 
<!-- 
#aaa {border-top:1px dashed #cccccc;height: 1px;overflow:hidden;} 
--> 
</style> 
</head> 
<body> 
<div id="aaa"></div> 
</body> 
</html>

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值