Technical Discussion
  >> Web Design / HTML / Web hosting Forum


Register (or login) on our website and you will not see this ad.


These posts have been archived and can no longer be replied to or modified.
  Print Thread
Standard User deleted
(deleted) Fri 07-Jul-06 16:15:51
Print Post

Crazy disappearing text!


[link to this post]
 
Anyone tell me what's wrong with this:

<div style="background-color:#efefef; padding:10px; border-color:blue; border-width:2px">
<p>
Where has this text gone?
<p>
<hr width="50%">
<p>
This text shows ok.
</div>

You can view it in a webpage here

It looks fine in Firefox but, in IE, the "where has this text gone" disappears. But, if you scroll the page slowly, the text makes a brief appearance. And, even odder, you can highlight where it should be and it appears!

John.
Standard User Taras
(knowledge is power) Fri 07-Jul-06 18:42:11
Print Post

Re: Crazy disappearing text!


[re: deleted] [link to this post]
 
now works in ie and ff (edited to make the blue border work too)

<div style="background-color:#efefef; padding:10px; border:blue 2px solid">
<p>
Where has this text gone?
</p>
<hr width="50%">
<p>
This text shows ok.</p>
</div>


You forgot to close the paragraph tag and im not sure as to why you wanted paragraph a hr tag either.

-----------------------------------------------------------------------
for cheaper hosting go to 50gigs.com

Edited by Taras (Fri 07-Jul-06 18:48:04)

Standard User deleted
(deleted) Fri 07-Jul-06 19:08:26
Print Post

Re: Crazy disappearing text!


[re: Taras] [link to this post]
 
Thanks

Must admit, I've never closed a paragraph tag and ww3 doesn't complain.

Doesn't the <p> under the hr tag force the text down a line? That was the intention.

What I found interesting was the fact that you could highlight the "missing" text and it was there!

Glad I don't do it for a living

John.


Register (or login) on our website and you will not see this ad.

Standard User Taras
(knowledge is power) Fri 07-Jul-06 19:39:21
Print Post

Re: Crazy disappearing text!


[re: deleted] [link to this post]
 
hr = horzontial rule (sorry about the spelling)

so your doing

paragraph
horzontal rule

paragraph.....

If your intention is to add space around the hr tag using padding-top and padding-bottom to the tag.

As for closing tags it good practice and solves issues like that. Leaving </ > tags off can lead to broken code.

-----------------------------------------------------------------------
for cheaper hosting go to 50gigs.com
Standard User camieabz
(legend) Sat 08-Jul-06 14:16:56
Print Post

Re: Crazy disappearing text!


[re: deleted] [link to this post]
 
In reply to:

ww3 doesn't complain.




May depend on what level of W3C complkiance you're playing with. Aim for XHTML 1.0 Transitional is possible.

In defeat he fled. In revolution he abdicated. In exile he remarried.

Camie

SAR 715...plusnet...1944 / 248

~ The AG'ers Mugshots ~

~ Camie's Forums ~
Standard User deleted
(deleted) Sat 08-Jul-06 16:10:19
Print Post

Re: Crazy disappearing text!


[re: camieabz] [link to this post]
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

I'm not sure of the connection between the WDG and W3C (if any) but the WDG's off-line .chm help file for HTML4.0 says of the <P> tag:

"The P element defines a paragraph. The closing tag for P is optional but its use prevents common browser bugs with style sheets."

So it is the browser's fault after all !

John.
Standard User deleted
(deleted) Mon 10-Jul-06 11:19:12
Print Post

Re: Crazy disappearing text!


[re: deleted] [link to this post]
 
Perhaps, but I would strongly recommend always closing tags anyway - it looks neater and is really just good practise.

Also, supposing you wanted to 'improve' your site to xhtml compliance, you would then have to go through every page, adding the </p> closing tags which would just be a PITA.

Likewise some other tags don't strictly need closing, such as list items <li> - the idea being that they're implicitly closed by either the next <li> or the end of the list </ul>. However, when editing your code it is much clearer to use the </li> close tags to find the end of a particular list item (especially if it's full of content).
Standard User deleted
(deleted) Mon 10-Jul-06 20:53:29
Print Post

Re: Crazy disappearing text!


[re: deleted] [link to this post]
 
Yeah. I'm going to have to smarten myself up

I think the trouble is I started in the 56k dial-up days (and earlier) when the saving in file-size was significant - fast-loading pages were especially appreciated those days as they saved people real money. Webpages these days are nearly as bloated as the operating system most of them display on!

Those were the days, when people objected if your "sig file" was more than two lines long.

John.
Standard User deleted
(deleted) Tue 11-Jul-06 09:57:57
Print Post

Re: Crazy disappearing text!


[re: deleted] [link to this post]
 
Not all modern webpages are bloated though. The really high volume sites are smart enough to take advantage of CSS-based designs where the layout and presentation is controlled by one (or a few) stylesheet files that are cached by the user's browser, which speeds things up considerably compared to the days of nested tables to achieve the required look. Most of the "bloat" these days is caused by overloading pages with large images and/or flash animations.

If you get a decent html editor, such as Visual Web Developer 2005 Express Edition (free), writing xhtml is easy - it even comes with a built-in validator that will tell you when you've done things wrong (such as used uppercase in tag definitions, not closed a tag correctly, used outdated attributes etc). The program is primarily aimed at writing asp.net web applications, but it works just the same as a standalone html editor. I know it's unusual to plug a Microsoft product, but it is totally free and I think it's brilliant!
Standard User Taras
(knowledge is power) Tue 11-Jul-06 10:12:32
Print Post

Re: Crazy disappearing text!


[re: deleted] [link to this post]
 
CSS has done alot to remove bloat along with xhtml. Again table are fine but cause a browers to take longer to render then css....



-----------------------------------------------------------------------
for cheaper hosting go to 50gigs.com
  Print Thread

Jump to