CSS INTERVIEW PREPARATION
PART-1
Content Of This Post ?
In this article, we covered ten CSS questions with answers.
- What is CSS?
- How can we integrate CSS on a Webpage?
- Name some CSS frameworks.
- What was the purpose of developing Cascading Style Sheet?
- What is Embedded Style Sheet?
- What are the advantages of Embedded Style Sheets?
- Explain the difference between a class and an ID?
- Name some of the media types allowed by CSS.
- Explain the selectors in CSS?
- What is a universal selector?
1. What is CSS?
- CSS stands for Cascading Style Sheet.
- It is a famous styling language this is used with HTML to layout websites.
2. How can we integrate CSS on a Webpage?
The three ways to integrate CSS on the webpage are:
Inline method:
It is used to insert style sheets in an HTML document.
Embedded/Internal method:
It is used to add completely unique style to one document.
Linked/Imported/External method:
It is used when you want to make changes on multiple pages.
3. Name some CSS frameworks.
The CSS frameworks are libraries that make webpage styling easy. Some of them are Foundation, Bootstrap, etc.
4. What was the purpose of developing Cascading Style Sheet?
Cascading Style Sheet was developed to define the appearance of websites. It will allow developers to separate the structure and content of a website, which was not
possible before.
5. What is Embedded Style Sheet?
An Embedded style sheet is a CSS style specification approach used with HTML. We 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>
6. What are the advantages of the Embedded Style Sheets?
- We can create classes for use on multiple tag types in the document.
- We can use selector and grouping methods to apply styles in complex situations.
7. Explain the difference between a class and an ID?
Class-
- The class is a way of using HTML elements for styling.
- They're not unique and have multiple elements.
ID-
- The ID is unique, and it can be assigned to a single element.
- IDs are used when only one element on the page should have a particular style applied to it.
8. Name some of the media types allowed by CSS.
The various media varieties allowed by CSS are: -
1. speech2. audio3. visual4. tactile media5. continuous or paged media6. grip media or bitmap7. interactive media
9. Explain the selectors in CSS?
It is a string identifying the elements to which a particular declaration applies.
It is also referred to as a link between the HTML document and the style sheet. It is
equivalent to HTML elements.
The different types of selectors in CSS are: -
• CSS Element Selector• CSS Id Selector• CSS Class Selector• CSS Universal Selector• CSS Group Selector
10. What is a universal selector?
The universal selector matches the name of any of the element types instead of selecting elements of a specific type.
<style>* {color: green; font-size: 20px;}</style>
Important ! :-
- free Html & CSS Courses with certification : click here
- CSS Interview Preparation Part-2 : click here
- Html Interview Preparation : Click Here
- JavaScript Interview Preparation : click here
Thanks For Visiting
0 Comments