PDA

View Full Version : Div ID Content Switching



smithster
02-16-2007, 11:18 PM
Hi guys
Hopefully someone can help me to correct this problem that I have.....

Take a look at this webpage.....

http://www.arenasmithster.co.uk/page4.htm

You may notice straight away the white lines on the page.

Click on the link that says to move to page 2. It uses javascript to switch the content. You will notice a table appear. The white lines on the first div are not supposed to be there. For some reason the borders of the table are showing through even though the div is supposed to be hidden! Take a look at the source code. Perhaps you might see where I have gone wrong?? I hope so!!

Let me know if you find the mistake.

Thanks.:cool:

jscheuer1
02-17-2007, 08:50 AM
Your page has no DOCTYPE or opening <html> tag. The <style="Text/CSS"> tag is invalid as well. You should start with valid HTML. Once you have that, if problems persist, they will be much easier to recognize:

http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.arenasmithster.co.uk%2Fpage4.htm

smithster
02-17-2007, 11:52 AM
Oh! Well thanks for your help. I have no clue about all that though!! I only used frontpage to build the page. The CSS I used is pretty much all I know of CSS.

mburt
02-17-2007, 12:18 PM
Well, to add a DOCTYPE you have to add this line to the top of your page if you're serving 4.01 trans:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
The fact that you're using FrontPage is worse though :p Generally, it produces invalid markup for your pages.

Change on the <table>

border="1"
to

border="0"

smithster
02-17-2007, 12:22 PM
Thanks for your reply. I have already done that one. And yes it works. But I really wanted to keep the borders there as I need the table to be displayed like a proper table.

So if Frontpage is that bad, then what am I better off using? I have always used Frontpage and always found that it was a good web program to use.

mburt
02-17-2007, 12:25 PM
Add this in the JavaScript for the "visible" function:

document.getElementById(obj).border=1
For FrontPage... do you use the "Code" view, or the "Design" view?

smithster
02-17-2007, 12:29 PM
<script language="JavaScript" type="text/javascript">

function hide(obj){
document.getElementById(obj).style.visibility="hidden";
document.getElementById(obj).border=1
}
function show(obj){
document.getElementById(obj).style.visibility="visible";
}
</script>

Is that where it is supposed to go??? Maybe not as it did not make any difference. I'm sorry for being a pain but I am only a beginner at this. Just a shame I am also very fussy person!!! Has to be perfect!!!:cool:

With Frontpage I mostly use the design view, I go into the code view sometimes to change something manually, usually only sizes though or a hyperlink.

jscheuer1
02-17-2007, 12:30 PM
If you have to use a commercial WYSIWYG editor, Dreamweaver is better. NVU is a good freeware alternative. As bad as FP is though, I doubt that it would have made this tag (from your source):


<style="Text/CSS">

or a page with no opening <html> tag.

smithster
02-17-2007, 12:33 PM
hmmm, well admitting my flaws now, I actually did all that myself. Frontpage always starts off a new page looking like this in the code design.......


<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

</body>

</html>


I just deleted all the above as I didn't see any relevance in it.

And the <style=text/css> part was me! I had put that in wrong, but it didn't get used in any way as I just deleted it and there was no difference.

mburt
02-17-2007, 01:40 PM
Erm... you need the basic markup, what you can delete is:

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

</body>

</html>
Put all your page content between <body></body>
But you do need the <title> tag, without, the page is invalid.

smithster
02-17-2007, 02:23 PM
None of that made any difference anyway so I have decided to start again. But I will try to do the full table in css this time to see if that makes any difference.

jscheuer1
02-17-2007, 03:58 PM
As long as you are starting over, use a DOCTYPE and make sure your work validates as you go along. That way we can be of more help in addressing any problems that may arise.