The HTML style attribute is used to add styles to html an element such as color, font, size, background color, text align, padding, margin, border, width, height, float etc.
The HTML Style Attribute
There are many property for HTML style as below.
- font-family
- padding
- margin
- text-align
- color
- background
- text-align
- border
- width
- height and more......
Text Color
color property is used to set color of text.
Syntax:
color:#000000;
Background Color
The CSS background-color property is used to set the background color for an HTML element.
Syntax:
background-color:#0066FF;
Text Alignment
The CSS text-align property is used to set the horizontal text alignment for an HTML element.
Syntax:
text-align:center;
Text Font
The CSS font-family property is used to set the font to be used for an HTML element
Syntax:
font-family: Arial, Helvetica, sans-serif;
Comments