css边框样式虚线

div+css行与行之间的虚线怎么做

用CSS边框样式
border-bottom:1px dashed #ddd;
以下是一些边框样式参考,希望对你有用
边框样式
语法:
border-style : none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset

参数:
none :  无边框。与任何指定的border-width值无关
hidden :  隐藏边框。IE不支持
dotted :  在MAC平台上IE4+与WINDOWS和UNIX平台上IE5.5+为点线。否则为实线
dashed :  在MAC平台上IE4+与WINDOWS和UNIX平台上IE5.5+为虚线。否则为实线
solid :  实线边框
double :  双线边框。两条单线与其间隔的和等于指定的border-width值
groove :  根据border-color的值画3D凹槽
ridge :  根据border-color的值画菱形边框
inset :  根据border-color的值画3D凹边
outset :  根据border-color的值画3D凸边
边框宽度
语法:
border-width : medium | thin | thick | length

参数:
medium :  默认宽度
thin :  小于默认宽度
thick :  大于默认宽度
length :  由浮点数字和单位标识符组成的长度值。不可为负值。请参阅长度单位
边框颜色
语法:
border-color : color

参数:
color :  指定颜色。请参阅颜色单位和附录:颜色表

说明:
如果提供全部四个参数值,将按上-右-下-左的顺序作用于四个边框。
如果只提供一个,将用于全部的四条边。
如果提供两个,第一个用于上-下,第二个用于左-右。
如果提供三个,第一个用于上,第二个用于左-右,第三个用于下。
要使用该属性,必须先设定对象的height或width属性,或者设定position属性为absolute。
如果border-width等于0或border-style设置为none,本属性将失去作用。

css圆点边框间距太小

在网页前端设计过程中,少不了要使用边框,这样页面整体好看一些。边框通常分为两种,一种为实边框另一种为虚边框,实边框用得多一些,但有虚线或虚线边框点缀,网页会更漂亮,所以这两种边框都要使用。
在CSS中,设置边框用border属性,通常需要设置三个值,分别为:宽度、线条样式和颜色。把线条设置为实线或虚线主要设置线条样式,它主要有两个值,即:solid 和 dashed,前者表示实线,后者表示虚线。
一、CSS设置虚线
html代码:
CSS设置虚线
使用dashed
CSS样式:
.uldashed{border:1px solid #c22159; width:300px; height:60px;margin:0;padding:0; line-height:26px;}
.uldashed li{border-bottom:1px dashed #c22159;list-style:none;}
效果图:CSS设置虚线
使用dashed
以上CSS样式是给ul的每一行设置一条虚线,虚实结合比单用实线好看得多。在实际应用中,最后一行的虚线要隐藏掉,这样美观一些,只要再设置一个CSS样式把 border-bottom 设置为 none 即可。
二、CSS设置虚线边框
html代码:
CSS设置一虚线
使用dashed
CSS样式:
.uldashedborder{border:1px dashed #c22159; width:300px; height:60px;margin:0;padding:0; line-height:26px; padding-bottom:23px;}
.uldashedborder li{border-bottom:1px solid #c22159;list-style:none;}
效果图:CSS设置一虚线
使用dashed
以上的CSS样式是把边框设置为虚线,把行的底部设置为实线,跟上边恰好相反,效果没有上边的好看。一般来说,虚线常常用于实线边框内。
三、CSS 长虚线边框
html代码:
长虚线边框
CSS样式:
.longDashedBorder{position:relative; margin:68px 0 0 130px; height:44px;width:86px; display:inline-block; border:dashed 1px #b200ff; transform:scale(4); overflow:hidden;}
.text{position:relative; margin:-54px 0 0 -106px; float:left; height:150px;width:300px; line-height:28px; display:inline-block; transform:scale(0.28);}
效果图:
ee96bd1776d77c7f7c565d5cc3bf1f47.png
以上长虚线边框用 Css 放大属性 scale 实现,这样虚线会增长但不会加宽;如果只增长 X 轴方向,可以用 scalex;如果只增长 Y 轴方向,可以用 scaley。使用 scale,除放大边框外,还放大其它元素,需要把它们调回来,比较麻烦。
四、CSS 虚线间距
html代码:
CSS样式:
.dashedSpace {
width:350px;
height:1px;
margin-top:10px;
background-image:linear-gradient(to right, #b200ff 0%, #b200ff 50%, transparent 50%);
background-size:28px 1px;
background-repeat:repeat-x;
}
.linear {
background-image: linear-gradient(to right, #ccc 0%, #b200ff 50%, transparent 50%);
background-size:40px 1px;
}
效果图:
03cc24f8ec77382a351b9b73a6a9f5eb.png
dashed 样式的虚线不能调间距,只能用渐变生成函数 linear-gradient(),to right 表示从左到右渐变,#ccc 0% 表示起点颜色和颜色百分比,#b200ff 50% 表示终点颜色和颜色百分比,transparent 50% 表示透明度。

请问css虚线样式怎么实现

你是说border的虚线吗?如果是的话,因该是这样的
border: 1px dashed red;(边框宽度 边框样式(虚线) 边框颜色)

如何用CSS定义虚线间隔

在正式绘制边框前,我们先认识一下CSS3 border-image-slice 属性,它可以将border-image-source获取的边框背景图片切割为9份。语法如下:
border-image:border-image-source slice-width{1,4}
slice-width的值可以是具体像素,也可以是百分比。切割后的图片块分别是
border-top-left-imageborder-top-imageborder-top-right-image
border-left-imageborder-right-image
border-bottom-left-imageborder-bottom-imageborder-bottom-right-image
其中,border-top-image和border-bottom-image区域受到水平方向效果影响,如果是repeat则此区域图片会水平重复,如果是round则会水平平铺,责任stretch则被水平拉升。而我们设置虚线,则选择repeat/round都可以。

css怎么设置边框虚线为圆点而不是方的

《!DOCTYPE html》
《html lang=“en“》
《head》
《meta charset=“UTF-8“》
《title》test《/title》
《style》
div {
text-align: center;
margin-bottom: 20px;
width: 100px;
height: 100px;
line-height: 100px;
}
.a {
/*圆点*/
border: 10px dotted red;
}
.b {
/*实线*/
border: 10px solid red;
}
.c {
/*双实线*/
border: 10px double red;
}
.d {
/*虚线*/
border: 10px dashed red;
}
《/style》
《/head》
《body》
《div class=“a“》
圆点
《/div》
《div class=“b“》
实线
《/div》
《div class=“c“》
双实线
《/div》
《div class=“d“》
虚线
《/div》
《/body》
《/html》

 

div-css盒子怎么在里面添加虚线

已知的方式有2种(纯样式):
1.用标签(div、span这些标签都可以)的边框线设置虚线来实现,比如在需要的位置插入div然后设置border-top(或者border-bottom):1px dashed #e5e5e5;(3个属性分别表示:1像素的边宽 虚线 颜色);
2.用hr,不过因为实现方式和方式一一样,比如:《hr style=“height:1px;border:none;border-top:1px dashed #e5e5e5;“ /》,但是这个标签在H5种已经被淘汰了,完全可以靠第一种来实现。第二种就当做是知识扩展

div-css盒子怎么在里面添加虚线

那就看你要怎么去实现这个虚线了,比如实现虚线的方式有用div,有hr水平线方式。\x0d\x0adiv的方式就可以这样写: border-top:1px #ccc dashed;,只留一条边可见,其它边不可见,虚线的属性是 dashed;\x0d\x0a如果你用hr实现也是可以的,同样也可以在样式里写 dashed属性值;\x0d\x0a这样就实现虚线了。

表格边框以虚线显示的css样式

表格边框默认是以实线进行显示的,怎么才能把它变成虚线呢?其实很简单只要简单加一些样式属性便可搞定,希望下面的例子对大家有所帮助
复制代码
代码如下:
《style》
.table5{text-align:center;
border:1px
solid
#cccccc;
border-radius
:3px;
background-color:#FFFFFF;
width:650px;}
.table5
td{border-bottom:1px
dashed
#cccccc;}
.table5
.last
td{border-bottom:0;}
《/style》

复制代码
代码如下:
《table
width=“100%“
border=“0“
cellpadding=“2“
cellspacing=“0“
class=“table5“》
《tr

《td
colspan=“4“》 《/td》
《/tr》
《tr

《td
width=“4%“》《img
src=“images/greendot.jpg“
width=“4“
height=“4“
/》《/td》
《td
width=“17%“
class=“text-fl“》萍水相逢《/td》
《td
width=“63%“
align=“center“
class=“text-fl“》消费10个金币,对换10元手机费《/td》
《td
width=“16%“
align=“center“
valign=“middle“》2013.01.20《/td》
《/tr》
《tr
class=“last“》
《td
》《img
src=“images/greendot.jpg“
/》《/td》
《td
class=“text-fl“》M萍水相MM《/td》
《td
align=“center“
class=“text-fl“》消费500积分,对换500粉丝《/td》
《td
align=“center“
valign=“middle“》2013.01.20《/td》
《/tr》
《tr

《td
colspan=“4“》《/td》
《/tr》
《/table》

CSS加虚线是哪个属性

在CSS 中常见的边框(border) 属性有以下几种:

  • border-style

  • border-width

  • border-color

  • border-top-, border-left-, border-bottom-, border-right-

  • border

border-style

border-style属性指定边框的样式。以下的表格列出这个属性可能有的值,以及每一个值显现出来的结果。

border-width

border-width属性是用来设定边框的宽度。可用的值为thin (薄)、medium (中等)、thick (厚),或是一个数字。

border-color

border-color属性是用来设定边宽的颜色。

border-top-, border-left-, border-bottom-, border-right-

我们可以将方向(top -上、bottom -下、left -左、right -右)和样式、宽度、及颜色合起来而成为一个属性。举例来说, border-top-style属性就是用来设定上边框的样式。以下举几个例子:

border

若四边的边框属性都一样,那我们可以用一个border属性来描述,而不必四个边都描述一次。另外,我们可以在同一行一次宣告边框样式、边框宽度、以及边框颜色。

p {
border:#0000FF 5px solid; 
}

那以下的HTML,

《p》用一行来宣布所有边框的属性《/p》    

会显现出

CSS如何定义一条水平虚线

需要准备的材料分别有:电脑、浏览器、html器。

1、首先,打开html器,新建html文件,例如:index.html。

2、在index.html中的《style》标签中,输入css代码:div {height:60px;border-bottom:1px dashed}。

3、浏览器运行index.html页面,此时通过css定义了一个水平的虚线。