0
Q:

css class

//remove a css class from an element
document.getElementById("myElementID").classList.remove("class_name"); 
23
.myclass {
  border:1px solid black;
  background-color: #d2d2d2;
  height:20px;
  width:60px;
}
/*If you give this class to a div in html, it will get the styles you gave
to that class. You can add multiple classes to a div, and multiple divs
can get that class. */
/* I hope I helped! */
10
<p class="haut">
<a href="#haut">Haut de page</a>
</p>
1
<p class="ClassExample">ClassExample!!</p>
3
<p class="ThisIsAClassName">HI</p>
5
<ul class="legend">
    <li><span class="greendot"></span>Text</li><br></br>
    <li><span class="yellowdot"></span>Text</li><br></br>
    <li><span class="reddot"></span>Text</li><br></br>
    <li><span class="blackdot"></span>Text</li><br></br>
</ul>
2
In the CSS, a class selector is a name preceded by a full stop (“.”) and an ID selector is a name preceded by a hash character (“#”). The difference between an ID and a class is that an ID can be used to identify one element, whereas a class can be used to identify more than one
8
.class{
    color:red;
}
2
.ThisIsAClassName{
  font-family: sans-serif;
}
2

New to Communities?

Join the community