jquery - How to get inner and outer width to a single element? -
is there way in css or jquery inner , outer width single element?
have div has width
of 100%
, height
of 30px
, , inside div have navigation menu list (two unordered lists). want inner width
of 960px
div menu centered , background of div have width:100% because div has width of 100%.
example:
i don't want add other div inside or outside div. want this single div. how can accomplish this?
any appreciated! thank much!
what this?
div{ width:100%; height:30px; border:1px solid red;/* fiddle visualization*/} ul{ margin:0; height:30px; width:430px; position: relative; } div ul:first-of-type{ background-color:#00f;/* fiddle visualization*/ left: 50%; margin-left: -430px; float: left; } div ul:nth-of-type(2){ background-color:#0f0;/* fiddle visualization*/ right: 50%; margin-right: -430px; float: right; }
here fiddle: http://jsfiddle.net/fkzx5/
Comments
Post a Comment