Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text appears on a page only when window is resized

Status
Not open for further replies.

Toman

Technical User
Mar 30, 2004
190
CZ
The word Lady is not visible when I run following code
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HEAD>
  <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=Windows-1250">
  <TITLE>Sarka Radova</TITLE>
  <style type="text/css">
  BODY {
	FONT-SIZE: 80%;
	COLOR: #0F0; 
	FONT-FAMILY: ARIAL CE, HELVETICA CE, ARIAL, HELVETICA, sans-serif;
	background-color:#D1D1D1;
  }
  .footer {
	FONT-SIZE: xx-small; 
	text-decoration:none;
	text-align:center;
  }

  #content {
	margin:10px 150px 50px 190px;
	padding:10px;
	text-align:center;
	background-color:#FFFFFF;
	color:#0000FF
  }
  </style>
</HEAD>
<BODY>
<div id=content>
  <div><H1>Lady</H1><BR>1995 - 2003, v = 70 cm porcelain<br><br><br><br><br><br><br><br></div>
  <SCRIPT TYPE="text/Javascript">
    document.write ("<A NAME='Here'></A><HR>");
    document.write ("<div class=footer>");
    document.write ("&copy; 2003, 2004 Sarka Radova, Jaselska, Czech Republic, tel. 123 456 789, atelier: Borivojova 108, 130 00 Praha 3, tel. 222 716 825<BR> home page <A HREF='[URL unfurl="true"]http://www.radova.cz'>[/URL] [URL unfurl="true"]www.radova.cz</A>");[/URL]
    document.write (" , e-mail: <A HREF='Mailto:sarkaATradova.cz?subject=Mess from web'>sarkaATradova.cz</A>, last modified: ");
    document.write  (document.lastModified);
    document.write ("<BR><BR></div>");
  </SCRIPT>
</div>

</BODY>
</HTML>
In IE6 the text appears only when window is resized, eventually when font size is changed in browser. (Mozilla is OK.)
The behavior becomes normal if:
tag <hr> in script is removed
or
Division surrounding Lady.. is removed
or
background-color:#FFFFFF in #content style is removed.

Could someone explain it to me.

Thanks, Tom.
 
Yes, I've added document.close() after last document.write but it doesn't help. Can you see the erratic behavior in your browser too?
Tom.
 

Given that 99% of the content you are writing out is static, why not just have it hard-coded on the page and forego all the document.write commands, with the one exception of last.modified?

Dan

 

Incidentally, the email address you have in your mailto link is not valid, AFAIK: "Mailto:sarkaATradova.cz".

Dan
 
Hi BillyRayPreachersSon,

I know e-mail link above is not valid, it is some "Lorem ipsum..".

Generating footer dynamically seems to be good practice to me. I need not to correct tenth of pages if something has changed. In fact the script is external, also style sheet is external. I've put it in HTML to make it more "readable" for people willing to help.

I'm adding a link to "problematic" page to make things even simpler. Please, can you (or anybody else) see the blue word Lady if you open a page (with MSIE6).
Toman
 

The problem seems to go away when I fix the invalid CSS values.

Font names with spaces in them should always be surrounded by quotes:

Code:
font-family: "Arial CE", "Helvetica CE", Arial, Helvetica, sans-serif;

Hope this helps,
Dan

 

Incidentally, in this case, I would NOT have the document.close() call, as you have not finished writing the document at that stage.

Dan
 
I see all as it should be in IE5.5, if that's any help.
But I would agree with BillyRay's earlier remark about hard coding the footer into your pages, as anyone with JavaScript disabled, like me and many others, won't see anything.

A bit of copy/paste never hurt anyone! ;-)

Regards, Andy.
**************************************
My pathetic attempts at learning HTML can be laughed at here:
 
Andy,
you are probably right with recommendation not to use script to show some important information. I can throw away the script and problem with this page disappears but still remains in my head. So it not good solution for me.
Toman
 

Did putting quotes around the font names and removing the document.close method call fix the issue for you, Toman?

Dan

 
Dan,
it did not at both cases. It looks not to be relevant to a given problem. Fixing a issue is still possible by removing background-color:#FFFFFF in #content style as I mentioned earlier. Strange.
Thank you for helping me.
Tom.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top