Yes it is possible in two ways.
In case you want to put elements inside a parent div, for example, there's a div that will have .classex
and everything inside it can be customized with your css
.classex ul {
list-style-type: none;
margin: 0;
padding: 0;
width: 200px;
background-color: #f1f1f1;
}
.classex li a {
display: block;
color: #000;
padding: 8px 16px;
text-decoration: none;
}
.classex li a:hover {
background-color: #555;
color: white;
}
.classex li {
display: inline;
}
<div class="classex">
<ul>
<li><a href="#">classe x</a></li>
</ul>
</div>
The other way is to put .classex
in the element itself, thus
ul.classex {
list-style-type: none;
margin: 0;
padding: 0;
width: 200px;
background-color: #f1f1f1;
}
li.classex a {
display: block;
color: #000;
padding: 8px 16px;
text-decoration: none;
}
li.classex a:hover {
background-color: #555;
color: white;
}
li.classex {
display: inline;
}
<ul class="classex">
<li class="classex"><a href="#">classe x</a></li>
</ul>