Forum Moderators: not2easy

Message Too Old, No Replies

css rendering problem (span, width:)

         

Arthemis

3:24 pm on Mar 29, 2005 (gmt 0)



I'm currently working on a PHP page, and I'm trying to make a kind of table without the TABLE tags.
So I thought of using SPAN.
And I just can't specify a width.

Here's the lines of the CSS:

DIV#tableau{background:#EDEDED;margin-left:8px; font-family: Arial, Helvetica, sans-serif; width:430px;margin-top: 10px;}
DIV#tableau SPAN#entete{font-size:10pt; font-weight: bold;}
DIV#tableau SPAN.petit{width:60px;}
DIV#tableau SPAN.grand{width:370px;}

And the lines of the page:

<DIV id="tableau">
<SPAN class="petit" id="entete">Articles</SPAN>
<SPAN class="grand" id="entete">Libellés</SPAN>
</DIV>

It just don't notice the width....If I specify a background-color, the SPAN accept it, but the width, doesn't seem to reconize it!

Is there something wrong with my code?

createErrorMsg

3:36 pm on Mar 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Arthemis, welcome to WebmasterWorld!

So I thought of using SPAN.
And I just can't specify a width.

Span is a generic, inline-level element. As an inline element, it cannot take a width setting. If you need to set an element's width, it needs to be a block level element. Try <div> (which is the generic block level element) instead.

For more on the difference between block and inline elements, go right to the horse's mouth [w3.org].

cEM