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.
Example of Class atribut in HTML
<html>
<head>
	<titel>Class</titel>
</head>
<body>
	<div class="main-p">
		<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
	</div>
</body>
</html>
Example of Class selector in CSS
.main-p {
    border:solid 2px red;
    background-color:#2ea920;
    float:left;
    clear:left;
}

Comments

No Comments Yet.
Be the first to tell us what you think.
CSS for beginners
CSS for beginners

Are you learning CSS ? Try our test we designed to help you progress faster.

Test yourself

Chat

Oh, the operator is not available. Leave us your comments. We will answer all your questions as soon as possible.

Comments

Anonymous
Καλησπέρα.
Anonymous
the infinteis -3/15 so 1triition / infinet
Anonymous
e
Anonymous
<a href="https://inspirum.pl "
Anonymous
[url]https://inspirum.pl[/url]
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e