One-liners are often used for small, simple changes or quick fixes to a website's appearance. They can be written using shorthand properties, which allow multiple properties to be combined into a single line of code.
<!DOCTYPE html>
<html>
<head><title>Title</title></head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
<body>
<p>Lorem ipsum dolor sit amet,
consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam.</p>
</body>
</html>
Our simple paragraph to play around.
p {
border-style: solid dashed dotted double;
border-width: 5px 10px 25px 50px;
border-color: red yellow blue green;
}
This CSS code applies a solid, dashed, dotted and double border style to the paragraphs.
The border widths for the top, right, bottom and left sides of the border are set to 5px, 10px, 25px and 50px respectively.
The border color for the top, right, bottom and left sides of the border are set to red, yellow, blue and green respectively.
No comments:
Post a Comment