Cascading Style Sheet
CSS stands for Cascading Style sheet. It is used to define styles and layouts in HTML and XHTML web pages. We can set the font size width, weight, border and many other properties using CSS.
We can also define CSS in different file and save it with .css extension and can use it in multiple web pages by including css file this helps in re usability of code.
Evolution Of CSS
CSS version 1 include following feature
CSS stands for Cascading Style sheet. It is used to define styles and layouts in HTML and XHTML web pages. We can set the font size width, weight, border and many other properties using CSS.
We can also define CSS in different file and save it with .css extension and can use it in multiple web pages by including css file this helps in re usability of code.
Evolution Of CSS
CSS version 1 include following feature
- provides background to elements
- provides color to text.
- provides alignment of text, images etc.
- provided margin, border, padding, and positioning of elements.
- provides font properties such as emphasis.
- provides different text attribute, such as spacing between words,letters, and lines of text.
CSS version 2 include following feature
- supports bidirectional text, which represents a text that can be displayed in both right-to-left and left-to-right directions.
- provides font properties such as shadows.
- supports aural style sheets that are used by visually impaired persons to access the web.
- provides styles for different media types, such as screen, tv, print.
- provides absolute, relative, fixed positioning of elements and the z-index.
CSS 3 include the following features
- provides attributes selectors.
- provides custom fonts.
- supports rgba colors.
- provides css selectors.
- supports the border image through border-image and border-corner image properties.
- supports more colors and a wider range of color definition.
- provides rounded corner for any box using border-radius and background position.
- provides the box shadow property to add shadow effect to the elements.
- allows multiple backgrounds in a web page.
- allows multi column text without using a table.
- display shadow with the text.
- provides opacity to set the transparency of box, images, or text.
Syntax of CSS
CSS syntax has two parts
- selector- it defines an html element to which css style is to be applied.
- declaration- it contains css properties and value.
selector
{
first property: value;
second property: value;
.
.
.
nth property: value;
}
example
<!DOCTYPE html>
<html>
<head>
<title>Css begins</title>
<style>
li {
font-weight:bold;
font-style:italic;
}
</style>
</head>
<body>
<ul style="border:double; color:black; font-weight:bold; width:100px">
<li><a href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
</body>
</html>
0 comments:
Post a Comment