HTML Style
The HTML style attribute is use to add styles to an element such as color ,font,size,and more.
Example
I am red
I am blue
I am big
The HTML Style Attributes
Setting the style on an HTML element cane be done wjth the style attribute.
The Html style attribute has the fllowing the syntax.
Example
The property is a CSS and the value is a CSS value.
You will learn more about next in this CSS tutorials.
Background Color
The CSS background-color property defines the background color for HTML element.
Example
Example
Set background color for two different elements.
This is a paragraph background color red
This is another paragraph background color green
Text Color
The CSS color property defines the text color for an HTML element.
Example
Set background color for two different elements.
This is a paragraph color red
This is another paragraph color green
Fonts
The CSS font-family property defines the font to be used for an HTML element.
Example
This is a heading font family verdana
This is another paragraph font family courier
Font Size
The CSS font-size property defines the text size for an HTML element.
Example
This is a heading font size 300%
This is another paragraph font size 150%
Text Alignment
The CSS text-align property define the horizontal text alignment for an HTML element.
Example
This is a heading center
This is another paragraph center
Chapter Summary
- Use the style attribute styling HTML elements.
- Use background-color for background color.
- Use color for text colors.
- Use the font-family for text fonts
- Use the font-size for text size.
- Use the text-align for text alignment.