css - moving an article tag to the centre of the page? -
i want article centered in order in want it. not want in in centre, want little inch left , same top.
what should following code?
article{ background:white; width:650px; height:325px; border-radius:7px solid; padding-left:10px; padding:right:10px; color:red; margin:auto; margin-bottom:40px; }
ok, giving shot here... think requesting. basically, using container div center content, , positioning inner div inside offset relative centered div.
codepen sketch here: http://cdpn.io/lthnf
html
<article class='container'> <div class='inner'>content</div> </article>
css
body { height: 100%; margin: 0; padding: 0; } .container { background: #ccc; bottom: 0; height: 325px; left: 0; margin: auto; position: absolute; right: 0; top: 0; width: 650px; } .inner { background: #efefef; position: relative; left: -20px; top: -20px; }
Comments
Post a Comment