Forum Moderators: not2easy

Message Too Old, No Replies

Text flows outside of table

css problem?

         

Josiah

12:47 am on Oct 26, 2004 (gmt 0)

10+ Year Member



....
The above file has the memberbar.php and index.php as well as a screenshot of the error in firefox. The memberbar.php is included in the index.php via phpinclude.

As you can see, while logged into the site, the text flows outside the memberbar. I've tampered with this pos forever, and can't seem to find the problem.

I appreciate your help.

Take care,
Josiah

[Mod note see post #3]

[edited by: SuzyUK at 2:55 pm (utc) on Oct. 26, 2004]
[edit reason] sorry no URLs : see TOS #13 [webmasterworld.com] [/edit]

createErrorMsg

2:01 am on Oct 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Josiah,
Check out the TOS [webmasterworld.com], specifically #21.
Afterwards, you might want to read this thread [webmasterworld.com], and this thread [webmasterworld.com]. Both detail some ways to create a post that is likely to generate helpful responses.

the text flows outside the memberbar.

Specifically, we'll need to see both the html and the CSS code relevant to the above issue.

Once we have those details, I'm sure we can help you out.

cEM

[edited by: createErrorMsg at 2:10 am (utc) on Oct. 26, 2004]

Josiah

2:05 am on Oct 26, 2004 (gmt 0)

10+ Year Member



<table width="100%">
<tr>
<td height="23">
<font face="Verdana, Arial, Helvetica, sans-serif">
<div style="width: 100%; text-align: left; color:#CCC; padding: 5px; font-family: Verdana; font-size: 10px;"> Logged in as <b>Josiah</b> ( <a href="#">Log Out</a><b> • <a href="#">Admin CP</a> • <a href="#">Mod CP</a></b> )
</div>
</td>

<td>
<div style="width: 100%; text-align: right; color:#CCC; padding: 5px; font-family: Verdana; font-size: 10px;"><b><a href="#">Control Panel</a></b> • <a href="#">0 New Messages</a> • <a href="#">Show New Posts</a>
</div>
</font>
</td>
</tr>
</table>

I hope this helps, if not I will be back soon enough, I am in a rush but will help you understand better if needed, sorry for the inconvenience on your part, but any possible solutions would help greatly.

[edited by: SuzyUK at 3:01 pm (utc) on Oct. 26, 2004]
[edit reason] examplified code [/edit]

createErrorMsg

6:58 pm on Oct 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Josiah,

The problem you are experiencing has to do with the way browsers build boxes (called the box model).

The width of the <div> inside of your <td> is set to 100%. Compliant browsers then ADD the 5px padding onto the left and right sides, making the total width of that <div> 100% + 10px. You can see, then, that it is too wide for the width of the cell, and so some of it disappears over the edge.

If you were to load your code, as is, into IE 5.x, you would find that it displays fine (because earlier IE browsers have a broken box model). IE6, on the other hand, will display with the text disappearing IF you have a valid doctype.

There are several things you could do to fix this. One is to lose the padding, but this shrinks the cell right up agaisnt the text: not good. Another would be to define the width of the <div> differently.

The best is to remove the width setting altogether. Since <div>s are block level, it will automatically fill the cell and the padding won't affect the box model. I tested this and it looks just as you seem to want it, with the benefit that all the text remains inside the table cell.

Good luck,
cEM

Josiah

10:02 pm on Oct 30, 2004 (gmt 0)

10+ Year Member



the width setting in the <div style="width=100%..." right and leave the padding=5px? I am going to download that god awful program just to test this ;) I've used it before several times I just enjoy and know where everything in IE is. Thanks for the help bud.

Josiah

11:04 pm on Oct 30, 2004 (gmt 0)

10+ Year Member



I appreciate the help, that fixed it. Take care boys, your doing the right thing, some people would be nowhere without you.