Home >Web Front-end >HTML Tutorial >DIV CSS Border Tips_html/css_WEB-ITnose
DIV CSS Border Tips
If you set the upper, lower, left, and right borders of an object to the same style, you can abbreviate it without writing out the attributes and corresponding values for the top, bottom, left, and right respectively.
For example, set the top, bottom, left and right borders to 1px width, solid line, black border CSS code as follows:
border:1px solid #000;
Complete DIV CSS example:
Instance content setting CSS For the css selector named yangshi, set the attribute selector style to a rectangle with a solid black border of 1px width, a width of 200px, and a height of 50px.
CSS code:
div,body{ border:0; margin:5px; padding:0;}/* Initialize web page style*/
|
Corresponding DIV code in HTML:
divcss5 example-CSS border example
| tr>
The picture above is a screenshot of the main fragment code of the CSS border instance
There are borders on three sides but no setting skills on one side
For example, there are borders on the left and right bottom and the style is a black 1PX width solid border, but there is no border on the top.
CSS code: border:1px solid #000; border-top:none;
To summarize CSS borders, common attribute codes for setting CSS styles on objects are: border:1px solid #000;