W3C home > Mailing lists > Public > www-style@w3.org > December 2003

Is it possible to wrap an inline element in a div block?

From: Robert Nicholson <robert@elastica.com>
Date: Mon, 29 Dec 2003 23:20:40 -0600
Message-Id: <E8D8F32F-3A87-11D8-A5D6-000393B28C08@elastica.com>
To: www-style@w3.org

Specifically if you want to manipulate an image as a block instead of 
inline is it possible to wrap it in a div and manipulate that div if 
you want to reposition the image?

If this is in fact possible just exactly how is it possible to set the 
width of the div from the width of the image?

If you wanted to center an image for instance. Could you wrap it in a 
div block and then set the margins on that div block to auto providing 
you could some how set the width of the block to match the image?

Currently have

.pictureframe { text-align: center; border: 0px solid #000; clear: both 
.picturecell {
   border: 0px solid #000;

$tableRow = <<EOM;
          <img class="picturecell" 
          <div class="caption">$nameToCaption{$imageName}</div>

and in the above it's the text-align: center that actually centers the 
image and the width
of the enclosing div block (pictureframe) is in fact the browsers width.

So, lets say you had a browser that didn't support text-align correctly 
is it possible to manipulate a blocks children by wrapping them in a 

Is something that's inline always inline and so therefore never can be 
manipulated by a parent block container?
Received on Tuesday, 30 December 2003 00:22:16 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:10 UTC