What is CSS class?
Experience Level:
Junior
Tags:
CSS
Answer
- Css calss is a type of selector represent with dot before.
- Selects all elements with a matching class attribute.
<html>
<head>
<titel>Class</titel>
</head>
<body>
<div class="main-p">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
</body>
</html>
.main-p {
border:solid 2px red;
background-color:#2ea920;
float:left;
clear:left;
}
Related CSS job interview questions
-
How do you style the element to have rounded corners?
CSS Junior -
How can you verify whether the element is block or in-line and how can you change this?
CSS Junior -
How do you set fixed height of specific div element?
CSS Junior -
During styling you often need to find some element on the screen and see what space it occupies. What do you usually do?
CSS Junior -
You are styling some element and it is not rendering as you want it to. What do you usually do in such case?
CSS Junior