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

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -