Advanced Search

Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Div ID Content Switching

  1. #1
    Join Date
    Oct 2006
    Posts
    94
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Cool Div ID Content Switching

    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.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,687
    Thanks
    43
    Thanked 3,129 Times in 3,095 Posts
    Blog Entries
    12

    Default

    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?verbos...uk%2Fpage4.htm
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Oct 2006
    Posts
    94
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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.

  4. #4
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Well, to add a DOCTYPE you have to add this line to the top of your page if you're serving 4.01 trans:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    The fact that you're using FrontPage is worse though Generally, it produces invalid markup for your pages.

    Change on the <table>
    Code:
    border="1"
    to
    Code:
    border="0"
    - Mike

  5. #5
    Join Date
    Oct 2006
    Posts
    94
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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.

  6. #6
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Add this in the JavaScript for the "visible" function:
    Code:
    document.getElementById(obj).border=1
    For FrontPage... do you use the "Code" view, or the "Design" view?
    - Mike

  7. #7
    Join Date
    Oct 2006
    Posts
    94
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Code:
    	<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!!!

    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.

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,687
    Thanks
    43
    Thanked 3,129 Times in 3,095 Posts
    Blog Entries
    12

    Default

    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):

    Code:
    <style="Text/CSS">
    or a page with no opening <html> tag.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #9
    Join Date
    Oct 2006
    Posts
    94
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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.......

    Code:
    <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.

  10. #10
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Erm... you need the basic markup, what you can delete is:
    Code:
    <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.
    Last edited by mburt; 02-17-2007 at 12:49 PM.
    - Mike

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •