Styles
This is HTML global attribute, it is managing style and making element more customized and attractive. Various css properties and their value are making compete for style attribute.
Syntax:
<tagname style="property:value;">data</tagname>
You need to note that here after property there is a : colon. You can also set multiple property to single attribute by joining it with ;
As style attributes accept all CSS properties that is a different subject so here we will discuss following basic CSS properties only.
- color
- background-color
- font-family
- text-align
- font-size
- height
- width
color
This css property defines text colours. By default, this property accepts RGB values, HEX values, HSL values, RGBA values, and HSLA values. You can also assign the name of the colour as a value. The name of the property is color not colour .
background-color
Similar to the color property of css you can also set the background color.
font-family
This property helps in setting the font for the text inside the element.
text-align
You can align text horizontally within the boundary of the element.
font-size:
This css property helps in increasing or decreasing the font size.
height:
This css property defines the height of the element.
width:
This css property defines the width of the element.