Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable a CSS rule

Tags:

html

css

I am using a Wordpress carousel plugin which sets a CSS rule

body * {
  line-height:1.2em;
}

This is causing trouble in my layout. The line height in my CSS for body is

body{ line-height: 19px;}

So I override body * as {line-height:19px} but it still breaks some of the layout. When I remove that rule using Firebug, everything works fine.

Now the problem here is, I dont want to edit the plugin CSS file, as every time I update it, I will have to do it.

Is there a way I can nullify the effect of body *?

This declaration is taking precedence over all other line-height properties.

Here is the link. The CSS file loaded by a carousel plugin is breaking the navigation.

like image 917
Broncha Avatar asked Oct 06 '22 13:10

Broncha


2 Answers

Reset the line-height by overriding it like this:

body * { line-height: inherit; }
like image 52
huysentruitw Avatar answered Oct 10 '22 10:10

huysentruitw


Better declare an id for the body element, it has highest specificity and than apply the line-height

<style>
#super_container {
   line-height: 19px;
}
</style>

<body id="super_container">
    <!-- All stuff goes here -->
</body>

Or you can use an inline style which has the highest specificity, which will over-ride any defined style for <body> but that will be tedious if you want to change you need to change on each and every page...

like image 33
Mr. Alien Avatar answered Oct 10 '22 10:10

Mr. Alien