Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Creating a Website with Multiple Pages

    Hi, so i'm new to web design and was wondering could anyone help me out on this question I have.

    Ok, so I have a sidebar, content and wrapper parts of my design. In my sidebar i want to create 3 tabs. One which says 'Home' (giving basic info on the site), the other 'Contact Us' and the other 'Product info'.

    What i need to do is when i click on of these 3 options, the content section needs to change to whatever i selected. IE if i press 'contact us' the Content section would change to telephone/email address etc...

    At the moment i when i select one of my 3 options, it opens a new tab in my tablist and leaves the website altogether...

    If anyone has any suggestions on how to make this work it would be appreciated.

    Thanks

  • #2
    Regular Coder
    Join Date
    Sep 2011
    Posts
    341
    Thanks
    3
    Thanked 36 Times in 36 Posts
    So, you want help, hûh? OK, so, what you gotta do is post your code (in between code tags, the # button). So that we can see what you did wrong. Or much better: post a link to the online creation.
    Last edited by Frankie; 02-12-2012 at 02:16 PM.
    Frank

    How to: Target IE in, Position in, Center in, Create a Fixed ('Sticky') Footer with, and Create a Drop-Down/Fly-Out Menu with CSS: Website Laten Maken Amsterdam.

  • #3
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <html>

    <head>

    <title>Div Example (Fixed position)</title>

    <link rel="stylesheet" type="text/css" href="style1.css" />

    </head>
    <body>

    <div id="header">
    <br/>
    <center>
    <h1>Sample Website</h1>
    </center>
    </div>

    <div id="sidebar">
    <br/>

    <div id="home">
    </br>

    <a href="home.html" target="_blank">Home</a> </br>

    </div>

    <a href="contact.html" target="_blank">Contact</a> </br>
    <a href="product.html" target="_blank">Product</a> </br>
    </div>

    <div id="content">

    </div>


    </body>
    </html>

  • #4
    New Coder
    Join Date
    Feb 2012
    Posts
    25
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Hi Mate,

    Just looking over your code now - there are some changes that I have made.

    - You have linked to the pages correctly but your using a _blank target means when someone clicks on the link it will open up a new window / tab... If you just want it to show the page you requested with in the current window you don't need to add a target attribute.

    Below are the changes that I have made to the code that you submited:

    Code:
    <html>
    
    <head>
    
    <title>Div Example (Fixed position)</title>
    
    <link rel="stylesheet" type="text/css" media="screen" href="style1.css" />
    
    </head>
    <body>
    
    <div id="header">
    <br/>
    <center>
    <h1>Sample Website</h1>
    </center>
    </div>
    
    <div id="sidebar">
    <br/>
    
    <div id="home">
    </br>
    
    <a href="home.html" >Home</a> </br>
    
    </div>
    
    <a href="contact.html">Contact</a> </br>
    <a href="product.html">Product</a> </br>
    </div>
    
    <div id="content">
    
    </div>
    
    
    </body>
    </html>
    Hope it helps you, if you need any-more information just post the question.

    Thanks,

    Scott

  • #5
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Scott,

    Thanks for the reply and that stopped it opening a new window but it still really doesn't solve my problem.

    Say when I run my project from notepad ++ it displays all the info. regarding the 'Home' section of my website in the Content section. What I really want to do is, when I click the 'Contact Us' option in the sidebar, it removes all the 'Home' information from the Content section and displays all the Contact information in the Content section, meanwhile keeping the layout/design of the site intact.

    IE When i click the 'Contact' button all i want to change on the site is the text/info. in the Content Section only.

    If you have any idea on how to do this I would be very grateful.

    Thanks again.

  • #6
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,338
    Thanks
    5
    Thanked 363 Times in 360 Posts
    If I understand you correctly, you want the user to click on "Contact" and then ONLY the main content changes to display the "Contact" information.

    You cant do this with the code you have. You could do this with frames, but why?

    Why not have complete pages for each "section" of your site? can you elaborate on why you'd want to use frames?
    Teed

  • #7
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello Sham767,
    I agree with Teed, a seperate page for each one would work much better. Just let the browser cache handle the duplicated #sidebar, which it will now that you stopped using target="blank".

    You can make it very simple by using a server side include for your sidebar.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

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