What is CSS?
Cascading style sheets is a markup language to define styles. This is mostly used in html but we can also use the same for any XML based markup languages. It allows to adopt for different types of devises like Desktop, large screen, small screen, iPad, mobile, printers etc.
Why we need CSS?
CSS mainly used for the following benefits.
- It improves the readability of the base html/XML markup language
- It is independent to the base markup language, hence it can be used again and again for the same page or more than one pages (it is reusable).
- It is simple, no programming languages or complex algorithm is required.
- Different devices can be defined in a single CSS. So the same CSS can be used for different devices.
- It reduces the usages of JavaScript for some simple use cases. We cannot define style or attributes to html markup for event like mouse up, mouse over events.
How we apply CSS?
CSS can be apply to the a html/xml by using classes or styles. A select rule is used to apply the defined style to the markup language. The selector may be any one of the following with or with hierarchy and event selector
- Tag selector - used by tag name (body, div, etc.,)
- Id selector - used by id prefix with hash (#textbox1, #firstdiv, etc.,)
- Class selector - used by class name prefix with dot (.nav, .color, etc.,)
- Tag selector with attribute filter (input[name='firstname'])
- hierarchy selector (body div .first-element ul li)
SIR CONTACT https://www.youtube.com/user/roseknr1
ReplyDelete