CSS Selectors
CSS Selectors
Aim: To create an html file by applying the different styles using inline, external & internal style sheets.
Problem Statement :-
1. Create a external style sheet named as “external_css.css” and provide some styles for h2, hr, p & a tags.
2. Create an html file named as “4Style_sheet.html”
1. Include the external style sheet with necessary tag.
2. Include the internal style sheet for body tags & also use class name, so that the style can be applied for all
tags.
3. Include a <p> tags with inline style sheet.
Theory:
Basic syntax:
selector {property:value; property:value; .....}
selector => identifier of the element
e.g.
body {background : yellow; color : yellow}
p {font-family: “Times New Roman”; font-size: 14px}
h1,h3 {color : red}
CSS Selectors
In CSS, selectors are patterns used to select the element(s) you want to style.