Q-1 (a) What is
Cascading Style Sheet (CSS)? Explain different types of CSS with example.
What Is CSS?
When a browser reads a style sheet, it will format the HTML
document according to the information in the style sheet.Most web pages are made from HTML,
or hypertext markup language. This is the standard way to decorate plain web
text with fonts, colors, graphic doodads, and hyperlinks (clickable text that
magically transports the user somewhere else). But websites can get really big.
When that happens, HTML is a very hard way to do a very easy thing. CSS (cascading
style sheets) can make decorating web sites easy again!
Three Types of
CSS
CSS comes in
three types:
- In a separate file (external)
- At the top of a web page document (internal)
- Right next to the text it decorates (inline)
External style sheets are separate files
full of CSS instructions (with the file extension .css). When any web page
includes an external stylesheet, its look and feel will be controlled by this
CSS file (unless you decide to override a style using one of these next two
types). This is how you change a whole website at once. And that's perfect if
you want to keep up with the latest fashion in web pages without rewriting
every page!