Something about image centering

  • Thread starter Steve Greenaway
  • Start date
D

David Dorward

Steve said:
http://www.engsoc.carleton.ca/~macfisto/4thyear.html

<span class="equation"><img.... /></span> should centre an image inside
the containing paragraph/div/whatever with the .equation styled as
text-align= center shouldn't it?

No, it shouldn't. Unless you play around with float or display, span
elements are inline and the text-align property doesn't apply to them.
(Since the width property doesn't apply either, and the element shrink
wraps its content - there isn't any margin for centring anyway).
 
S

Steve Greenaway

Kermit the Frog stuck a mic in David's face, who said:
Steve Greenaway wrote:
No, it shouldn't. Unless you play around with float or display, span
elements are inline and the text-align property doesn't apply to them.
(Since the width property doesn't apply either, and the element shrink
wraps its content - there isn't any margin for centring anyway).

So I have to wrap each equation image in a block-level element like p
or div? Fair enough. Thanks.
 
D

David Dorward

So I have to wrap each equation image in a block-level element like p
or div?

Yes, anything else wouldn't make sense as you wouldn't have any space to
centre the image in.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top