Main content
This is the main content. This is the main content. This is the main content.
Style attribute allows configuring look and feel right on the element. Although it's very convenient it is considered bad practice and you should avoid using the style attribute
A slightly better way to configure look and feel is to declare CSS rules in the STYLE tag in the header and then refer to the tag by their name, ID, or class This paragraph's style is set by a rule referring to the P tags
The best way to apply CSS rules is to declare them in a separate CSS file and load it with the LINK tag. Always use this method.
Instead of changing the look and feel of all the elements of the same name, e.g., P, we can refer to a specific element by its ID
Here's another paragraph using a different ID and a different look and feel
Instead of using IDs to refer to elements, you can use an element's CLASS attribute
This paragraph's red background is referenced as
.selector-2 .selector3
meaning the descendant of some ancestor.
Whereas this span is a
direct child of its parent
You can combine these relationships to create
specific styles depending on the document structure
The text in this paragraph is red but this text is green
This background of this paragraph is red but the background of this text is green and the foreground white
Solid fat red border
Dashed thin blue border
Rounded corners on the top
Rounded corners at the bottom
Rounded corners all around
Rounded corners inline
This is the main content. This is the main content. This is the main content.