Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reason for CSS block with no code in?

I'm currently optimising a website's code, the programmer who developed it isn't here.

There is a CSS file with around 1000 lines of code, in this file, there are many blocks with no code inside the curly braces.

For example:

.header{
}

Is there a reason to keep these? Or are they completely useless?

like image 926
Jessica Avatar asked Jul 16 '26 00:07

Jessica


1 Answers

.header{
}
.header .menu_div{
  background : black;
  color:white;
}
<div class="header">
  <div class="menu_div">Menu Div</div>
</div>

The person who has written CSS might have given the hierarchy for .header children. He/She might not have given CSS to parent.

If it doesn't reflect in design after removing it then you can remove it.

like image 169
Bhavin Shah Avatar answered Jul 19 '26 14:07

Bhavin Shah