1. Define CSS?
CSS stands for Cascading Style Sheets. It is a styling language. It is the most simple styling language for HTML elements. Apart from being one of the most popular web designing languages in HTML, its application is also very common in XHTML.
2. What are the several forms of CSS?
The different forms of CSS are:
CSS 1
CSS 2
CSS 2.1
CSS 3
CSS 4
3. What are the advantages of using CSS?
The main advantages of CSS are given below:
Separation of content from presentation – CSS provides a way to present the same content in multiple presentation formats in mobile or desktop or laptop.
Easy to maintain – CSS, built effectively can be used to change the look and feel complete by making small changes. To make a global change, simply change the style, and all elements in all the web pages will be updated automatically.
Bandwidth – Used effectively, the style sheets will be stored in the browser cache and they can be used on multiple pages, without having to download again.
4. What is the origin of CSS?
SGML (Standard Generalized Markup Language) is the origin of CSS. It is a language that defines markup languages.
5. How can you integrate CSS on a web page?
There are three methods to integrate CSS on web pages.
Inline method – It is used to insert style sheets in HTML document
Embedded/Internal method – It is used to add a unique style to a single document
Linked/Imported/External method – It is used when you want to make changes on multiple pages.
6. What is VH/VW (viewport height/ viewport width) in CSS?
It’s a CSS unit used to measure the height and width in percentage with respect to the viewport. It is used mainly in responsive design techniques. The measure VH is equal to 1/100 of the height of the viewport. If the height of the browser is 1000px, 1vh is equal to 10px. Similarly, if the width is 1000px, then 1 vw is equal to 10px.
7. What is an Embedded Style Sheet?
An Embedded style sheet is a CSS style specification method used with HTML. You can embed the entire stylesheet in an HTML document by using the STYLE element.
<style>
body {
background-color: linen;
}
h1 {
color: red;
margin-left: 80px;
}
</style>
8. Who postulates the specifications of CSS?
CSS specifications are maintained by the World Wide Web Consortium.
9. Define CSS frameworks?
CSS frameworks are pre-planned libraries, which allow much easier and more standard-compliant designing and styling of a webpage by using CSS language.
10. How do you specify units in the CSS?. What are the different ways to do it?
There are different ways to specify units in CSS like px, em, pt, percentage (%). px(Pixel) gives fine-grained control and maintains alignment because 1 px or multiple of 1 px is guaranteed to look sharp. px is not cascade. em maintains relative size. you can have responsive fonts. Em, will cascade 1em is equal to the current font-size of the element or the browser default. If u sent font-size to 16px then 1em = 16px. The common practice is to set default body font-size to 62.5% (equal to 10px).
pt(point) are traditionally used in print. 1pt = 1/72 inch and it is a fixed-size unit.
%(percentage) sets font-size relative to the font size of the body. Hence, you have to set the font-size of the body to a reasonable size.
11. What is the use of CSS Opacity?
The CSS opacity property is used to specify the transparency of an element. In simple word, you can say that it specifies the clarity of the image. In technical terms, Opacity is defined as the degree to which light is allowed to travel through an object. For example:
<style>
img.trans {
opacity: 0.4;
filter: alpha(opacity=40); /* For IE8 and earlier */
}
</style>