CSS border
As the name suggests, border means border. In CSS, you can use border syntax to make a variety of design changes to the border, such as setting the width, style, color, etc. of the border. You can also hide the border. In principle, CSS treats the border. The design of is not limited to the borders of DIV blocks or spans , but can also be applied to the borders of other web elements, such as the borders of the page title, the border of the picture ( img border )... etc. All major browsers support CSS border property.
Introduction to CSS border syntax
border: border thickness, border color, border style;
The standard css border rule has three parameters from left to right. Each parameter is separated by a half-shaped space. The first parameter is the thickness of the border ( border-width ). Generally, standard webpage units such as px and em are used. The two parameters indicate the color of the border ( border-color ), you can use the color standard color code or the English name of the color, and the third parameter is the border style ( border-style ), you can set solid line, dashed line, double solid line, continuous Point... Many different styles.
CSS border syntax example 1: Add a border directly to the DIV block
This is a border test
</div>
CSS border example two, independent design for the four sides
#BorderBox{
border-top:5px black solid; //The width of the upper border is set to 5px, and the color is black
border-right:8px red double; //The width of the right border is set to 8px , The color is red, and the style is double
border-left:7px yellow dotted; //The width of the left border is set to 7px, the color is yellow, and the style is dotted
border-bottom:3px blue dashed; //The width of the bottom border is set to 3px, The color is blue, the style is dashed
padding:30px;
}
</style>
<div id="BorderBox">Four different border designs</div>
Remarks, please use the color code table to select the border color .
CSS3 provides more powerful web page element border design functions, please refer to: CSS3 border design .
Post a Comment
0 Comments