HTML STYLES
Summary:
style
• Use the s_,_le attribute for styling HTML elements
background-color
• Use b_ck_r_,_nd-c_l_r for background color
• Use c_l_r for text colors color
• Use f_,_t-f_m_ly for text fonts font-family
• Use f_nt-s_z_ for text sizes font-size
• Use t_xt-al_,_n for text alignment text-align
1. Text Color
The CSS color property defines the text color
for an HTML element:
<h1 style="color:blue;">This is a heading</h1>
<p style="color:red;">This is a paragraph.</p>
2. Fonts
The CSS font-family property defines the font to be used
for an HTML element:
<h1 style="font-family:verdana;">This is a heading</h1>
<p style="font-family:courier;">This is a paragraph.</p>
3. Text Size
The CSS font-size property defines the text size for
an HTML element:
<h1 style="font-size:300%;">This is a heading</h1>
<p style="font-size:160%;">This is a paragraph.</p>
4. Text Alignment
The CSS font-size property defines the text size for an
HTML element:
<h1 style="text-align:center;">Centered Heading</h1>
<p style="text-align:center;">Centered paragraph.</p>
5. Background Color
The CSS background-color property defines the background color
for an HTML element:
<body style="background-color:powderblue;">
Or
<h1 style="background-color:powderblue;">This is a heading</h1>
<p style="background-color:tomato;">This is a paragraph.</p>
</body>
Create a syntax:
1.Start with heading 6
2.Followed by the property style
3.Then attribute of background color with,
4. a value of blue
5.Whilst, the content will be THIS IS SYNTAX 1, ends with
close tag h6.
ANSWER:
<h6 style="background-color:blue;">THIS IS SYNTAX 1</h6>