Fundamentals of Web Technologies: Agenda
Fundamentals of Web Technologies: Agenda
Dr. Lupiana, D
FCIM, Institute of Finance Management
Semester 2
Agenda:
• Intro to Cascading Style Sheet (CSS)
• CSS Inheritance Vs Cascading
CSS Intro
• HTML was created to describe the content of
a web page
– It was NEVER intended to contain tags for
formatting a web page
1
5/26/2019
CSS Intro
• With basic HTML, changing attributes of HTML
elements (for example <p align=“left”> This is left aligned </p>
) is done at element level
– If you have more than one paragraph (all aligned left) and
you want to align them right, for instance, you need to
make changes to all the paragraphs
CSS Intro
• CSS (Cascading Style Sheets) allows us to apply
formatting and styling to the HTML that builds
our web pages
• CSS controls many attributes of web pages
such as colors, fonts, borders, backgrounds,
spacing, margins, and many more
CSS Intro
• CSS is NOT a substitute of HTML but rather
works together with HTML
– CSS is an extension to basic HTML that allows you
to style your web pages
– CSS can control attributes of multiple HTML
elements or layout of multiple pages at once and
therefore saves a lot of work on developing or
updating a Website
2
5/26/2019
CSS Intro
• You can think of a style sheet as a template
with a set of styles that affect HTML elements
• There are three style sheets that affect HTML
elements
– Browser style sheet
– User style sheet
– Developer style sheet
CSS Intro
• Each HTML element has a default style
– An anchor <a> element, for instance, by default
has a blue color and is underlined
CSS Intro
• When a developer specify a style for any
HTML element, an developer style sheet is
created
• This style sheet overrides browser style sheet
and affects every instance/copy of a web page
– Two users accessing the same page will have the
same format
3
5/26/2019
CSS Intro
• Whether a web page is formatted by a
browser or a developer style sheet, modern
browsers allow users to reformat the pages
– In a chrome browser, for instance, a user can
access a developer tool by pressing Ctrl + Shift + I
and reformat a page
10
10
CSS Intro
• When a user reformats a page, a user style
sheet is created
• A user style sheet overrides both browser and
developer style sheets
• Unlike other style sheets, user style sheet
affects only the web page changed by the user
and disappear when the page is refreshed
11
11
CSS Intro
• Cascading means styles can fall (cascade) from
one style sheet to another
• This enables one HTML document to use
multiple style sheets
12
12
4
5/26/2019
CSS Syntax
• Parts of a style rule
13
13
14
15
5
5/26/2019
16
16
17
18
18