Jump to content

Mystery line break appearing on page


Snayke

Recommended Posts

Here is the page I'm working on. I used the same formatting for both the first and second lines of text (one aligned left, one right) yet the right-aligned one has got a line break/vertical space below it and I don't know why. The code is this (and I know it may be painfully obvious I just fumble through these things):
<html><head><title>SSDg® Web Design Home</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta http-equiv="imagetoolbar" content="no"><!-- HTML Codes Copyright ©2006 SnaykeSkyns Digi-graphix® All rights reserved. --><style type="text/css">	<!--body {	margin: 0px;	padding: 0px;	scrollbar-base-color:#c8bfcc;	scrollbar-face-color:#c8bfcc;	scrollbar-track-color:#c8bfcc;	scrollbar-arrow-color:#503c59;	background-color: #c8bfcc;	}a:link {color: #503c59;	text-decoration: underline;}a:active {color: #f4f3f5;	text-decoration: none;}a:visited {color: #000000;	text-decoration: none;}a:hover {color: #f4f3f5;	text-decoration: underline;	cursor:crosshair;}p.one{font-family: tahoma,arial,helvetica;font-weight: bold;font-variant: small-caps;font-size: 18px;color: #503c59;}p.two{font-family: tahoma,arial,helvetica;font-style: regular;font-size: 12px;color: #503c59;}--></style><script type="text/javascript"><!--var msg="Go right-click yourself!";function click(e) {if (document.all) {if (event.button == 2) {alert(msg);return false;}}if (document.layers) {if (e.which == 3) {alert(msg);return false;}}}if (document.layers) {document.captureEvents(Event.MOUSEDOWN);}document.onmousedown=click;--></script></head><body><br><table cellspacing="0" cellpadding="0" width="90%" align="center" margin="0" border="0"><tr height="8" bgcolor="#503c59"><td></td></tr><tr height="2" bgcolor="#c8bfcc"><td></td></tr><tr height="3" bgcolor="#503c59"><td></td></tr><tr height="4" bgcolor="#c8bfcc"><td></td></tr><tr height="58" bgcolor="#a295ac"><td></td></tr></table><table cellspacing="0" cellpadding="4" width="92%" bgcolor="#c8bfcc" margin="0" border="0"><tr><td align="left"><p class="one">    SnaykeSkyns Digi-graphix®</p></td></tr></table><table cellspacing="0" cellpadding="0" width="90%" height="400" bgcolor="#82718c" align="center"><tr><td></td></tr></table><table cellspacing="0" cellpadding="4" width="98%" bgcolor="#c8bfcc" margin="0" border="0"><tr><td align="right"><p class="one">For unique and original web design</p></td></tr></table><table cellspacing="0" cellpadding="0" width="90%" align="center" margin="0" border="0"><tr height="20" bgcolor="#c8bfcc"><td></td></tr><tr height="58" bgcolor="#a295ac"><td></td></tr><tr height="3" bgcolor="#503c59"><td></td></tr><tr height="4" bgcolor="#c8bfcc"><td></td></tr><tr height="8" bgcolor="#503c59"><td></td></tr><tr height="22" bgcolor="#a295ac"><td></td></tr></table><br><table cellspacing="0" cellpadding="0" width="90%" align="center" margin="0" border="0"><tr><td align="left"><p class="two">Copyright ©2006 SnaykeSkyns Digi-graphix®    All rights reserved.</p></td><td align="right"><p class="two"><a href="mailto:snayke@gmail.com" target="_top">Contact</a></p></td></tr></table><br></body></html>

I have tried prepending each /td with a linebreak, made no difference. I am lost!

Link to comment
Share on other sites

That was a real head scratcher :) it took me ages to find the part that was causing the problem: <tr height="20" bgcolor="#a295ac"><td></td></tr>I don't know why it wouldn't work but i managed to fix it. I have commented the problem area in the code :)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>SSDg® Web Design Home</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta http-equiv="imagetoolbar" content="no"><!-- HTML Codes Copyright ©2006 SnaykeSkyns Digi-graphix® All rights reserved. --><style type="text/css">	<!--body {	margin: 0px;	padding: 0px;	scrollbar-base-color:#c8bfcc;	scrollbar-face-color:#c8bfcc;	scrollbar-track-color:#c8bfcc;	scrollbar-arrow-color:#503c59;	background-color: #c8bfcc;	}a:link {color: #503c59;	text-decoration: underline;}a:active {color: #f4f3f5;	text-decoration: none;}a:visited {color: #000000;	text-decoration: none;}a:hover {color: #f4f3f5;	text-decoration: underline;	cursor:crosshair;}p.one{font-family: tahoma,arial,helvetica;font-weight: bold;font-variant: small-caps;font-size: 18px;color: #503c59;}p.two{font-family: tahoma,arial,helvetica;font-style: regular;font-size: 12px;color: #503c59;}--></style><script type="text/javascript"><!--var msg="Go right-click yourself!";function click(e) {if (document.all) {if (event.button == 2) {alert(msg);return false;}}if (document.layers) {if (e.which == 3) {alert(msg);return false;}}}if (document.layers) {document.captureEvents(Event.MOUSEDOWN);}document.onmousedown=click;--></script></head><body><br><table cellspacing="0" cellpadding="0" width="90%" align="center" margin="0" border="0"><tr height="8" bgcolor="#503c59"><td></td></tr><tr height="2" bgcolor="#c8bfcc"><td></td></tr><tr height="3" bgcolor="#503c59"><td></td></tr><tr height="4" bgcolor="#c8bfcc"><td></td></tr><tr height="58" bgcolor="#a295ac"><td></td></tr></table><table cellspacing="0" cellpadding="4" width="92%" bgcolor="#c8bfcc" margin="0" border="0"><tr><td align="left"><p class="one">    SnaykeSkyns Digi-graphix®</p></td></tr></table><table cellspacing="0" cellpadding="0" width="90%" height="400" bgcolor="#82718c" align="center"><tr><td></td></tr></table><table cellspacing="0" cellpadding="4" width="98%" bgcolor="#c8bfcc" margin="0" border="0"><tr><td align="right"><p class="one">For unique and original web design</p></td></tr></table><table cellspacing="0" cellpadding="0" width="90%" align="center" margin="0" border="0"><tr height="20" bgcolor="#a295ac"><td></td></tr><!-- the problem was with this line - don't know why --><tr height="58" bgcolor="#a295ac"><td></td></tr><tr height="3" bgcolor="#503c59"><td></td></tr><tr height="4" bgcolor="#c8bfcc"><td></td></tr><tr height="8" bgcolor="#503c59"><td></td></tr><tr height="22" bgcolor="#a295ac"><td></td></tr></table><br><table cellspacing="0" cellpadding="0" width="90%" align="center" margin="0" border="0"><tr><td align="left"><p class="two">Copyright ©2006 SnaykeSkyns Digi-graphix®    All rights reserved.</p></td><td align="right"><p class="two"><a href="mailto:snayke@gmail.com" target="_top">Contact</a></p></td></tr></table><br></body></html>

Link to comment
Share on other sites

Well bless your heart Scott!! :) Only one thing troubles me...if I don't know what the problem was to begin with, how can I prevent it from recurring?? Oy! I really don't want to have to post my codes here - or anywhere - each time I encounter this problem in future, if I do (yes indeed it was hard for me to do it to begin with, since I've had my stuff stolen in the past too many times to ever be comfortable posting my codes anywhere unprotected). Sure am grateful for your eagle-eyes though, that space was driving me wonky :)

Link to comment
Share on other sites

Your question is a good one and i don't have an answer because i don't know why it happened either, everything looked fine.If you use the same technique as i did though then it's a start. I used the process of elimination, i went through each tag deleting it and refreshing the page to see what happened. I wittled it down to that line of code and from what i could see it was ok, very strange. All i done to fix it was copy the line below it and paste it over it then change the height from 58 to 20 and it was sorted.Long and boring process? yes, but it got the job done and that's the main thing :)

Link to comment
Share on other sites

Sounds to me you've the patience of a saint. :) And you're right, of course, the main thing being that your method solved my problem and I didn't have to get any more grey hairs, and I know what tactic to use if it should happen again...just another html anomaly I guess, somewhat comforting though that it wasn't anything obvious that I did (or didn't do) that caused it. Thanks again, Scott, much appreciated!

Link to comment
Share on other sites

Welcome to the w3schools Forums, Snayke!It looks as though your problem might have been the height. You specified a height larger than needed, therefore, it adds what looks like a line break to your result. Glad you have found a resoloution! :)alzable

Link to comment
Share on other sites

There was no problem with the height, in both the problem and the solution the height is the same, 58. The whole line caused the problem, it must have contained some invisible bug!! :)

Link to comment
Share on other sites

  • 2 weeks later...

Thank you for the welcome, alzable! An invisible bug, eh, Scott? Would that be akin to formication...on a web page? ROFL Better get my notepad some hormone replacement I guess :) (ps. love the Shrek sig Scott)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...