Web Tools Table Maker3schools TranslateImage CompressorFavicon Icon GeneratorCrop & Resize Image
Apu
Apu November 08, 2022 › #css #Element

How to apply CSS to particular div

To apply CSS to a particular div on a large web page, distinguish the specific div element with a unique ID or class.

<html>
 <body>
   <div>Top Container.</div>
   <p>This is a paragraph.</p>
   <div class='html'>Stylish Div element.</div> 
 </body>
</html>

In the example above, you can see that I have separated a div element with the class name html.

Now, we can easily style the div element.

.html{
  background-color:blue;
  color:white;
  padding:5px 10px;
  border-bottom:2px solid gold;
}
save
listen
AI Answer
Write Your Answer
loading
back
View All