Here is the code I use to keep an image always centered inside its containing div, regardless of browser width or resizing:

<img src="yourimage.jpg" style="width:100%;margin:0 auto;">

enjoy!

Tags: css, div, html, images, tip, trick

Views: 200

Reply to This

Replies to This Discussion

RSS

Latest Activity

DAvid Cordina joined kid k's group
Thumbnail

Ning French Networks

A group for french network creators!See More
21 minutes ago
Violeta replied to Violeta's discussion 'Problemas.. y más problemas.....' in the group Ning Networks en español
"Hola Rosa Maria, ¿ Cómo estás? tanto tiempo! No entiendo si cerraste tus…"
50 minutes ago
Bon replied to Bon's discussion 'Cannot Install a new Background in Classic 2.0'
"As of 6:20am today- the page installed----the code, of course had been left in advanced--this…"
51 minutes ago
Violeta replied to Violeta's discussion 'Problemas.. y más problemas.....' in the group Ning Networks en español
"¿ Cuál ticket Mayra ? ¡No me llegó nada! Hoy mandé otro…"
52 minutes ago

NC for Hire
Elson Tan replied to Phil McCluskey's discussion 'Site Manager Updates for Ning 3.0 Networks'
"Great news, finally we can add some code to the head!"
1 hour ago
sho allan replied to Phil McCluskey's discussion 'Site Manager Updates for Ning 3.0 Networks'
"so NICE!!!"
1 hour ago
James Hawkins replied to John Bizley's discussion 'I have a Question about the Social Channels ( youtube, vimeo )' in the group The Sandbox
"OK, now it's working. I had tried in both FF and  IE10 at the time. Some temporary glitch…"
1 hour ago

NC for Hire
SweetPotato replied to John Bizley's discussion 'Show Your Ning 3.0 Sites'
"Sorry, that was for Kos, not you Diane, although she might have been talking to you and not me, in…"
2 hours ago

© 2013   Created by Ning.

Badges  |  Report an Issue  |  Terms of Service