1

I have a page where the UL is set to padding-left: 40px and I can't find where it is being set. In firebug it shows in 'computed' but isn't in the inherited styles list. I've tried removing the jquery in case it was set in js. I've removing the css - it's still there. I've set a breakpoint on attribute change - nothing.

Setting padding-left:0px doesn't fix IE7

Is there a plugin or some better way of inspecting applied css rules?

1
  • 1
    You should accept the answer you like the most if your question has been solved. Commented Aug 26, 2011 at 11:07

2 Answers 2

2

It's probably a browser default. If it's not in firebug's style tab, it's being applied by the browser itself.

To get Firebug to show user-agent defined CSS, click on the style tab drop-down and click "Show User Agent CSS" (thanks Gerben).

You can override styles that are set by the user-agent, simply by defining the style attribute for that element:

ul{
    padding-left:20px;
}

Note that IE7 uses margin instead of padding as the default style for lists.

You can 'reset' all user-agent defined rules using something like Yahoo's reset stylesheet.

You can also 'normalise' the style applied to a page. This means overriding user-agent defined styles so that all browsers use a standard style. I personally prefer this method over 'resetting' the CSS and having to explicitly define CSS rules for everything. It's easier and takes up less space. Try this library.

Sign up to request clarification or add additional context in comments.

1 Comment

to show the browsers css. Style Side Panel Options Mini Menu->Show User Agent CSS
0

That padding-left on ul is coming from the user agent stylesheet.

You can remove it with:

ul {
    padding-left: 0;
    margin-left: 0
}

Firebug is already the best Firefox plugin for this sort of task. You just need to enable this option:

2 Comments

sorry should have said I've tired this - it doesn't work in IE7
IE7 is weird and uses margin-left instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.