CSSNotes.html
CSSNotes.html
Introduction
The full form of CSS is Cascading Style
Sheets.
In that,
Cascading:-Simple meaning of cascading
is the flow.The CSS Cascade is the
algorithm by which the browser decides
which CSS styles to apply to an element
Style:- for design and customize html
element.
Sheet:- The meaning of sheet is an
document which is used for designing
purpose.
What is CSS:-
CSS is a markup language which is used
to create style and customize HTML
elements available in webpage.
CSS Use:-
By Using CSS,We can create more
affecting , attractive and customized web
pages in less time code.
CSS Syntax:-
Selector {
Properties: Values;
}
In above syntax ,
Selector:-Selectors are used to select the
content you want to style. CSS selectors select
HTML elements according to its id, class, type,
attribute etc.
Rules of selector :-
Name must be start with characters.
Space not allowed between two words.
Starting with name and space and
numbers is not allowed.
{ }:-It is a code binder which is used to bind a
codeFor example:- binding properties and
values of css.
h1 {
color: red;
margin-left: 20px;
}
External Style Sheet:-
With an external style sheet, you can
change the look of an entire website
by changing just one file.
The external style sheet is generally
used when you want to make changes
on multiple pages.
External Style Sheets are the separate .css
files that contain the CSS rules. These files
can be linked to any HTML documents using
<link> tag with rel attribute.
Syntax:
<head><linkrel=“stylesheet”type=”text/
css”href=“urlofcssfile”>
</head>
In order to create external css and link it to
HTML document, follow the following steps:
First of all create a CSS file and define all
CSS rules for several HTML elements.
Let’s name this file as external.css.
p{
Color: orange; text-align: left; font-
size:10pt;
}
h1{
Color: orange; font-weight: bold;
}
Now create HTML document and name
it as externaldemo.html.
<html>
<head>
<title> External Style Sheets Demo </title>
<linkrel="stylesheet"type="text/
css"href="external.css">
</head>
<body>
<h1> External Style Sheets</h1>
<p>External Style Sheets are the
separate .css files that contain the CSS
rules.</p>
</body>
</html>