html5 - Positioning an image in the centre? -


i struggling position image using background auto. have article tag not centre.

how fix issue following code?

body {     background:url('index1.jpg')no-repeat;     width:auto; } 

try this:

body {     background: url('index1.jpg') no-repeat center center;     background-size: cover; } 

this should center background image , resize accordingly. hope helps.

edit (pertaining comment):

first off, in order obtain border on element use border, not border-radius. border-radius round edges of element rather add border itself.

in order center objects need use margin: auto;. place content in center of parent container.

here fiddle of working code: js fiddle

in future please attempt little research , figure things out on own. of these solutions found on existing questions on so.


Comments

Popular posts from this blog

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -