Solved

Please view my page

Posted on 1998-07-25
2
167 Views
Last Modified: 2010-04-09
Hi,

I have asked some questions about borders in the past and this is my latest one. I wanted to add some text to the stripe of my pages and everything moved to the right. Although I have solved the problem, I like to know why this happens (and why my solution works).

Please view my site and see what I mean.
The URL: http://members.xoom/wimkerk/border.html

Thanks
0
Comment
Question by:wimkerk
2 Comments
 
LVL 8

Accepted Solution

by:
jbirk earned 190 total points
ID: 1844887
Well, I looked at your pages, and here are the problems:
1. The first page where you have no text in the left td, the width of that cell is being displayed as less than 140 because there isn't enough text to force it to the correct width.  You just got lucky that it ended up displayed the way you wanted it to.
2. The second page is actually displaying 140 width td cell, that is why it doesn't fit into a 131 pixel green bar.
3. The 10 pixels of the cellspacing and the 1 pixel of the table border have not been accounted for.
4. The margin width of the window also has not been accounted for.
5.  The actual width of the green bar is 129 with a 2 pixel darker green after it.  This 2 pixel darker green doesn't look as good when it's INSIDE the td, but rather when it's part of the border, so 129 should be the number to go by.
6. You forgot to say cellspacing=0 in the table, which is defaulted to 1

SO, if we take the 129, subtract 10 for cellspacing, 2 for border (border on both sides), 7 for window margin (that's what it seems to be in Netscape 4.05, but is different from browser to browser), we get: 109, which is the correct size of the td cell for the left.

That's why it is doing what's it's doing.
Hope this helps,
Josh
0
 

Author Comment

by:wimkerk
ID: 1844888
Thanks jbirk. It is really clear where I went wrong. A well deserved "A".

Thanks again!
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question