Sunteți pe pagina 1din 66

Cascading

Style
Sheets
What Is CSS
Cascading : Refers to the procedure that determines which style will
apply to a certain section, if you have more than one style rule.
Style: how you want a certain part of your page to look. You can set
things like color, margins font, ect for thing like tables, paragraphs, and
headings.
Sheets: the “sheets ” are like templates, or a set of rules, for
determining how the webpage will look .

CSS is a style sheet language used to describe the presentation of a


document written in HTML or XML
CSS Brief History
Hakon Wium Lie first proposed CSS in 1994. He was working with
Tim Berners-Lee, the father of HTML at CERN.
CSS 1 was the first edition introduced in 1996

CSS 2 was published in 1998 and provides enhancement over CSS1

CSS 2.1 was last 2nd generation edition of CSS.

CSS 3 is the latest edition. Several new Functionalities have been


provided through CSS3. functions like round corners, background
decoration, box shadows, which are demonstrated in the
subsequent sections, are introduced in this version.
External styles are defined within the <link>
element, inside the <head> section of an HTML
page:
Internal styles are defined within the <style>
element, inside the <head> section of an HTML
page
Inline styles are defined within the "style"
attribute of the relevant element
Example of Grouping Selectors
Example of typical
webpage Browser
Background image
Background Repeat
Background Position
Background Attachment
Stylesheets cascade — at a very
simple level this means that the order
of CSS rules matter; when two rules
apply that have equal specificity the
one that comes last in the CSS is the
one that will be used.
In the example, we have two rules
that could apply to the h1. The h1 ends
up being colored blue — these rules
have an identical selector and
therefore carry the same specificity,
so the last one in the source order
wins.
For example, if you
set a color and font-
family on an element,
every element inside
it will also be styled
with that color and
font, unless you've
applied different color
and font values
directly to them.

S-ar putea să vă placă și