We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 9
Lear NEOnlne
Cascading Style Sheets (Css)
An Introduction to Cascading Style Sheets
Learn LIVE Online
CSS
CSS LogoVedaniti,
Lear NEOnlne
CSS, often known as cascading style sheets, is an easy-to-use design language created to
make it quicker and easier to present wed pages. CSS controls the look and feel of a web
page. CSS may be used to manage a variety of effects, including text colour, font style,
paragraph spacing, column size and arrangement, background images or colours, layout
designs, and variances in how the content appears on various devices and screen sizes
Although CSS is simple to grasp and master, it offers strong control over how an HTML
document is presented. CSS is most frequently used in conjunction with HTML or XHTML as
markup languages
*CSS explains how HTML components should appear on a screen, in print, or in other
media
*A lot of work is saved via CSS. It may oversee the concurrent design of many web
pages.
* In CSS files, external stylesheets are stored.
CSS Syntax
Vedaniu,
Learn LIVE Oniine
Selector Declaration Declaration
{color : blue; font- size: 12px;}
Property Value Property Value
CSS Syntax StructureVedaniti,
Lear UNE Online
The HTML element you wish to style is indicated by the selector.
One or even more declarations are contained in the declaration block, and they are divided by
semicolons. A comma separates the name of the CSS property from its value in each
declaration. Semicolons are used to separate multiple CSS declarations while curly braces are
used to enclose declaration blocks.
Example
In this example, all elements will be centre-aligned, with a BLUE text colour:
vt
colour: blue;
text-align: centre;
}
CSS Background
A page's background colour can be changed using CSS. It activates the background-colour
property, which designates an element's background colour. There are 5 CSS background
attributes that have an impact on HTML elements:
41. Background-Colour in CSS
Apage's background colour is set as follows
Example:
body {
background-colour:crange;
}2. Background-Image in CSS
‘An Image’s background is set as follows:
Example:
Vedaniti,
Lear UNE Online
3. Background-Repeat in CSS
Apage's background repeat is set as follows:
Hello vedantu.coms/n1>
4. Background-Attachment in CSS
Apage's background attachment is set as follows
Example
background: blue url(‘bbb git)
background-repeat: no-repeat:
background-attachment: fixed
§. Background-Position in CSS
Apage's background position is set as follows:
The following positions can be changedVedaniti,
Lear UNE Online
1 Left
2. Right
3. Centre
4 Top
5. Bottom
Example
background: blue url(good-afternoon jpg’)
background-repeat: no-repeat:
background-attachment fixed
background-position: top;
Solved Questions
4. What are CSS Comments?
Ans: Code explanations are provided through comments, which may be useful if you decide to
alter the source code in the future. Browsers don't read comments
The