homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

INLINE DIVs and Width Attribute - tearing my hair out

5+ Year Member

Msg#: 3794035 posted 6:14 pm on Nov 25, 2008 (gmt 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+ Year Member

Msg#: 3794035 posted 10:06 pm on Nov 25, 2008 (gmt 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.


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

Msg#: 3794035 posted 11:11 pm on Nov 25, 2008 (gmt 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:


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved