How can I center an image located inside a containing box?
<div id="boxListen">
<h2>Listen to Wolf</h2>
<img src='/images/wolf.png' width='150' alt='Picture of Wolf' />
</div>
This isn’t working…
#boxListen h2{
text-align: center;
}
#boxListen h2{
padding: 1em 0 1em 0;
font-size: 1.5em;
}
I’m confused. Do you think that the image is nested inside of the h2?
Text-align:center needs to be on the parent of the image. The h2 is not a parent.
I left my brain at home on my desk today!! 
I was editing my style sheet quickly and forgot to take out the “h2”.
My bad!
system
Closed
5
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.