Inline block with width and height?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jens

    Inline block with width and height?

    An image like this one
    <html>
    test1<img src="" style="width:10 0;height:100"/>test2
    </html>
    is in line with the text and has a width and height.

    How can I get the same with a span or div instead of an image?

    This does NOT work:
    <html>
    test1
    <span style="display: inline-block;backgroun d:red;width:100 ;height:100">bl ock
    </span>
    test2
    </html>

    JMS
  • David Dorward

    #2
    Re: Inline block with width and height?

    Jens wrote:
    [color=blue]
    > An image like this one
    > <html>
    > test1<img src="" style="width:10 0;height:100"/>test2[/color]

    100 what? Units are required (as is the <title> element).
    [color=blue]
    > </html>
    > is in line with the text and has a width and height.
    >
    > How can I get the same with a span or div instead of an image?[/color]

    Images are replaced inline elements, they have have a height and width.
    [color=blue]
    > This does NOT work:
    > style="display: inline-block;backgroun d:red;width:100 ;height:100">bl ock[/color]

    What browser are you testing with? As far as I know, only Opera supports
    inline-block (so far).

    In most browsers you have to fiddle with float to achive things of this
    nature.

    --
    David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is

    Comment

    Working...