css - HTML body margin 0 messing up div positioning -
css - HTML body margin 0 messing up div positioning -
i bite confused on happening here. set body margin set 0 in css , div elements stretch across screen want, want apply one. previous question: html image going across entire screen
an reply said utilize position:absolute , alter position of div elements. used have position:relative on these div elements , when changed absolute, combined div elements in 1 position. tried moving them bottom:then whatever pixels, still did not move @ all. way move it? do? on w3 schools: http://www.w3schools.com/css/css_positioning.asp
it tells me lot positioning div elements, when tried utilize did not work on 1 div element tried, instead overlapped it.
how move these div elements?
code css
#middle-4{ position:absolute; left:0; right:8; bottom:0; top:-800px;}
code html
<div id="middle-4" style="background-image: url(images/home/rock.png); height: 540px; width: 1348px; border: 1px solid black;"></div>
this done can see 4 div elements.
if understand question correctly want element conform default body
margin except 1 element (or multiple elements using class).
i this...
givebody
specific margin ensure consistent across browsers. use negative horizontal margins pull element outside of constraints of body
class="snippet-code-css lang-css prettyprint-override">body { margin: 8px; background: lightgreen; } div { background: lightblue; padding: 30px; border-bottom: 1px solid blue; } .fullwidth { margin-left: -8px; margin-right: -8px; }
class="snippet-code-html lang-html prettyprint-override"><div>i'm constrained body</div> <div class="fullwidth">i'm total width</div> <div>i'm constrained body</div>
html css html5 css3
Comments
Post a Comment