CSS -Notes Lyst1313
CSS -Notes Lyst1313
CSS - Day 1
Agenda
▪ CSS Introduction
▪ Inline CSS
▪ Internal CSS
CSS INTRODUCTION:
Cascading Style Sheets, fondly referred to as CSS,
is the World Wide Web Consortium standard for
the visual presentation of web pages. With CSS,
you’re going to completely control the presentation
of your pages, often without even changing your
HTML. CSS is used to define styles for your web
pages, including the design,
layout and variations in display for different devices and screen sizes.
CSS is a set of rules that we are telling to the html that this is how the
styling should be.
There are three ways to apply CSS to the HTML page they are:
o INLINE CSS
o INTERNAL CSS
o EXTERNAL CSS
External CSS: An external style sheet is used to define the style for
many HTML pages. To use an external style sheet, add a link to it in
the <head> section of each HTML page.
Syntax of CSS:
Property: value
Syntax of CSS is the property name and a value, separated by a colon.
Property can be many things like Colours, Font-family, Background
and each property have their own values. We can include multiple
property: value pair, separated by semi-colon.
Let us now understand with an example how property: value can be
used
Output:
Output:
Example-1:
As we can see in the above example using this CSS style is an effective
method of styling a single page. Let us understand this with one more
example.
As we can see from Example1 and Example2 styling for both the
example is same but using internal css style, styling for multiple pages
is time-consuming as you need to put CSS rules to every page of your
website. This can be overcome using External CSS.