What is CSS and for what purpose it is used?
CSS stands for cascading style sheet and it is used to design webpage, to give a beautiful appearance to the webpage. It also defines proper orientation of entities in a webpage or it allows sort the content.
CSS is used for advanced webpage designing which is impossible by using HTML formatting elements and various attributes. CSS allows to separate content from a style which improves readability.
We can insert CSS with help of HTML code, to use CSS you need to have basic knowledge about HTML like container tags and their attributes, linking one page to another, inserting images, and colors.
We can insert CSS in HTML by 3 different types:
1. Inline CSS
2. Internal CSS
3. External CSS
(We will see them in later posts.)
There are some attributes in lower versions of HTML which are not used or they are deprecated. HTML5 recommends styling webpages with CSS. CSS3 is current major version of CSS and it is supported by new browsers.
Syntax of CSS:
A style sheet is set of rules. CSS rule set contains
• A selector : Defines HTML element to be styled.
• A Declaration block : It contains declaration[ Property (style element like color, background color) and its value] Declaration block can contain more than one declarations separated by semicolon(;). Property and value is separated by colon(:)
Selector{property: value; property: value;}
Values in which are common CSS properties:
initial( represents initial value of property)
inherit( represent property should inherit or takes from parent),
unset(represent property is inherited or not).
Comments
Post a Comment