Welcome to WebmasterWorld Guest from 54.234.38.8

Forum Moderators: not2easy

Message Too Old, No Replies

INLINE DIVs and Width Attribute - tearing my hair out

     
6:14 pm on Nov 25, 2008 (gmt 0)

New User

5+ Year Member

joined:Nov 25, 2008
posts:1
votes: 0


I can't believe this is true, but everything I try fails. I'm at my wits end and I can't believe that CSS would be designed this way.

Is it at all possible to have an inline DIV or SPAN that has a set width? I've been working on this for over a week and I want to kill myself. It seems like something everyone would want, and I need it about a dozen times on my site.

I have a DIV, width set 700.
Within that div I have 4 INLINE divs, one with a set width.

the set width doesn't apply when I have it set as an inline DIV. The second I set it to block, it widens up and adds line breaks. I need NO line breaks and a set width.

This also applies to inline-block too. Please help me I feel like crying or smashing my computer.

10:06 pm on Nov 25, 2008 (gmt 0)

Preferred Member

10+ Year Member

joined:Sept 4, 2002
posts:508
votes: 0


Can you float the element that needs the fixed width? My info may be dated, but I don't think inline-block - which is exactly what you want, in theory - is well supported in all browsers. Floating the object gets you close, though.
11:11 pm on Nov 25, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member swa66 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 7, 2003
posts:4783
votes: 0


Welcome to WebmasterWorld [webmasterworld.com]!

Before you damage your computer or your scalp, what browser are you using ?

Inline isn't -to my knowledge- supposed to support width, think of it as text.

In some browsers "inline-block" needs TLC before it functions. See SuzyUKs post on the subject:
[webmasterworld.com...]

HTH