css - Div is slightly off center -


i tried center div horizontal , vertical on screen, somehow off center. why that? think because of content, don't know :d

i used

height:90%; 

and

margin-top:5% 

to center it.

here's full code: http://jsfiddle.net/7mnue/1/

http://jsfiddle.net/j8tbw/

cleaned markup bit, , applied display: flex in parent div.container (see links below, specially), , used center flex css properties.

.container {     display: flex;     justify-content: center;     align-items: center; }  .inlineflex {     display: inline-flex; } 

you may face problems in ie10 , below, other browsers (see caniuse link)

references:

http://css-tricks.com/snippets/css/a-guide-to-flexbox/

http://caniuse.com/flexbox


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -