Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Left padding is being applied out of nowhere (paranormal CSS declaration)?

Tags:

jquery

css

If you use Firebug inspector, and hover #jimgMenu ul you will see that it has left padding but no css rule related to it:

http://www.alohatechsupport.net/examples/image-menu-1.html

Where is the left padding coming from? Why I can't see the origin?

EDIT:

If you click in Layout/Metrics it says that #jimgMenu ul has left padding = 40px;

But again I can't find where it that padding coming from.

like image 299
alexchenco Avatar asked Jan 20 '23 12:01

alexchenco


2 Answers

User agent stylesheet is being applied with the following padding (in chrome)

-webkit-padding-start: 40px;

thats why its always useful to use a css reset to remove all paddings and margins specific to each browser

http://meyerweb.com/eric/tools/css/reset/

like image 164
daniel Avatar answered Mar 02 '23 00:03

daniel


an <ul>-Element has also an indent to be proof that its elements aren't displayed outside of the list

Unordered List (<ul>) default indent

You can set own padding for ul to overwrite this indent. <-- I tried this in firebug and it worked.

like image 30
lszrh Avatar answered Mar 01 '23 23:03

lszrh