CSS Presentation
CSS Presentation
WHY IS CSS SO
IMPORTANT?
We’ll notice quite a few differences
between the two when it comes to
overall presentation. With CSS, we
And here is that same section without CSS:
see a change in font, font size, and
font color. We also see a change in
the format of the buttons and get
an added blue background
behind them. Each of these
elements are possible because of
cascading style sheets. As a user,
which looks more enticing? It’s
pretty easy to see why CSS is so
crucial.
1) Faster Page Speed
CSS
THE
APPLICATION 5) Compatibility Across Devices
Confusion due to many
CSS levels
CSS
Cross-Browser Issues
Security Issues
OF THE
APPLICATION
CSS SYNTAX CSS comprises style rules that are interpreted by
the browser and then applied to the corresponding
elements in your document.
In the following example all p elements will be
center-aligned, with a blue text color:
A style rule set consists of a selector and
declaration block.
3.DESCENDANT SELECTORS:
Suppose you want to apply a style
rule to a particular element only
when it lies inside a particular
element. As given in the following
example, the style rule will apply to
the em element only when it lies
inside the ul tag.
CSS SELECTORS
Output: 4.ID SELECTORS:
5.CLASS SELECTORS:
The class selector selects
elements with a specific class
attribute.
To select elements with a specific
class, write a period (.) character,
followed by the name of the class.
In the example below, all HTML
elements with class=”center” will
be green and center-aligned:
CSS SELECTORS