#selector{
/*The format is border:width style color;*/
border:2px solid grey;
}
p {
border-style: solid;
border-color: red;
border-width: 5px;
}
/* You can also write above code in one line */
p {
border: 5px solid red;
}
border: 1px solid #000;
a quick note on border-style shorthand:
border-style: none none dotted; --> this means:
One value: it applies the same style to all four sides.
Two values: applies to top and bottom, the second to the left and right.
Three values: applies to the top, the second to the left and right, the third to the bottom.
Four values: applies to all four sides following clockwise.
p {
border: 5px solid red;
}
border: border-width border-style border-color;
Code Example |
---|
Css :: center things with css |
Css :: how to create multicolor text in css |
Css :: transition css |
Css :: inline block text align top |
Css :: css combinators |
Css :: add dots instead of line break in css |
Css :: scroll css |
Css :: css italic |
Css :: line cap css |
Css :: install tailwind css |
Css :: how hide in html |
Css :: stop css transition from firing on page load |
Css :: css disable input |
Css :: z index |
Css :: css blur image without blur borders |
Css :: css circle shadow |
Css :: internal style |
Css :: css fadeout animation |
Css :: how to stop overflow in css |
Css :: css animation shorthand |
Css :: css animate svg circle radius |
Css :: get ssl certificate command line |
Css :: wordpress https to localhost http |
Css :: change image color in bootstrap card on hover css |
Css :: css affect all child elements |
Css :: css varianbes |
Css :: css clamp |
Css :: png image border css |
Css :: value error w2 should be positive but is |
Css :: htaccess file extension |