Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Dec 2009
    Posts
    5
    Member #
    20605
    Okay, I have been trying to center this web page, and the main navigation menu for a few days now, how ever, I CANNOT do it. Here is my website link :

    http://beta.diversitynow.org/


    Here is my CSS template :

    http://beta.diversitynow.org/layout.css


    I have tried everything I can find on the internet about centering web pages (and cannot find help about the text for the navigation bar).

    Any help is very much appreciated.

    If you need anymore information, let me know, I can post the original files.

    *edit*
    Here is my main file, it may help

    PHP Code:
    <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <link rel="stylesheet" href="text.css">
            <link rel="stylesheet" href="layout.css">
            <title>DiversityNow.org | Parents and Neighbors for Diversity in Burlington Schools</title>
        </head>
    <body>

    <?php
        $tab 
    $_GET["tab"];
        
    $page $_GET["page"];
     
    ?>

    <center>
     
     <div class="body">
     
        <div class="banner">
            &nbsp;
        </div>
        
        
        
        <div class="nav">
            <table class="nav" height="36px" border="0" cellspacing="0" cellpadding="0">
            
            <tr>
            
            <td class="nav_item" width="140">
            
                <?php    if($tab == "home") { ?>
                    <a class="nav_cur" href="main.php?tab=home&page=aboutus">
                            Home
                    </a>
                <?php }    else { ?>
                    <a class="nav" href="main.php?tab=home&page=aboutus">
                            Home
                    </a>
                <?php }    ?>
                
            </td>
            
            <td>

            &nbsp;&nbsp;|&nbsp;&nbsp;
            
            </td>
            
            <td class="nav_item" width="140">
            
                <?php    if($tab == "mission") { ?>
                    <a class="nav_cur" href="main.php?tab=mission&page=statement">
                            Mission
                    </a>
                <?php }    else { ?>
                    <a class="nav" href="main.php?tab=mission&page=statement">
                            Mission
                    </a>
                <?php }    ?>
                
            </td>
            
            <td>

            &nbsp;&nbsp;|&nbsp;&nbsp;
            
            </td>
            
            <td class="nav_item" width="140">
            
                <?php    if($tab == "news") { ?>
                    <a class="nav_cur" href="main.php?tab=news&page=news">
                            News and Events
                    </a>
                <?php }    else { ?>
                    <a class="nav" href="main.php?tab=news&page=news">
                            News and Events
                    </a>
                <?php }    ?>
            
            </td>
            
            <td>

            &nbsp;&nbsp;|&nbsp;&nbsp;
            
            </td>
            
            <td class="nav_item" width="140">
            
                <?php    if($tab == "resources") { ?>
                    <a class="nav_cur" href="main.php?tab=resources&page=press">
                            Resources
                    </a>
                <?php }    else { ?>
                    <a class="nav" href="main.php?tab=resources&page=press">
                            Resources
                    </a>
                <?php }    ?>
            
            </td>
            
            </tr>
            
            </table>
        </div>
        
        
        
        <div class="subnav">
        <?php
            
    if($tab == "home"){
                include(
    "content/home/subnav.php");
                }
            elseif(
    $tab == "mission"){
                include(
    "content/mission/subnav.php");
                }
        
    ?>
        </div>
        
        
        
        <div class="content">
        <?php
    // ########################################## Home
            
    if($tab == "home" $page == "aboutus"){
                include(
    "content/home/aboutus.html");
                }
            elseif(
    $tab == "home" $page == "data"){
                include(
    "content/home/data.html");
                }
            elseif(
    $tab == "home" $page == "faqs"){
                include(
    "content/home/faqs.html");
                }

    // ########################################## Our Mission

            
    elseif($tab == "mission" $page == "statement"){
                include(
    "content/mission/statement.html");
                }
            elseif(
    $tab == "mission" $page == "supportus"){
                include(
    "content/mission/supportus.html");
                }
            elseif(
    $tab == "mission" $page == "progress"){
                include(
    "content/mission/progress.html");
                }
                
    // ########################################## News and Events

            
    elseif($tab == "news" $page == "news"){
                include(
    "content/news/news.html");
                }
                
    // ########################################## Resources

            
    elseif($tab == "resources" $page == "press"){
                include(
    "content/resources/press.html");
                }
                
    // ########################################## Error
            
    else{
                include(
    "content/error.html");
                }
        
    ?>
        </div>
        
        
        
        
        <div class="left">
            <img src="images/body_left.jpg" width="25px" height="800px" border="0" />
        </div>

        <div class="right">
            <img src="images/body_right.jpg" width="25px" height="800px" border="0" />
        </div>
        
     </div>
     
     </center>
     
    </body>
    </html>

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    It's centered properly.

    Have you tried refreshing your cache? Maybe you have an old version of the CSS cached on your browser.

  4. #3
    Senior Member Dorky's Avatar
    Join Date
    Jun 2009
    Location
    Destin Florida
    Posts
    1,430
    Member #
    19103
    Liked
    4 times
    smosely you wer looking at an image blank sir.

    using php in such an on off on off way will never render the layout properly. you need to <?php at the top of the file and ?> at the end of the file and either escape the double quotes in the html and javascript if you use any or replace all double quotes with single quotes.

    also i dont recomend tables for nav. try a
    <ul>
    instead. you can do so many more things with lists then tables.

    either way you need to use
    text-align: center;
    on whatever element you choose to hold the links in the nav, dont use px for width in those elements, rather use
    %
    with
    min-width:
    for the overall nav so it is fluid but wont condense below a reasonable width.

    if you decide to try the <ul>
    use
    li {display: inline; float: left; }
    in your css to make it a horizontal alignment.

    in either nav style dont forget to use
    a { display: block; overflow: hidden; }
    in your css so users can just click any place in the link box rather then having to get right on top of the text.

    hope this helps.

    while($get_it !== true){ continue; }

  5. #4
    Junior Member
    Join Date
    Dec 2009
    Posts
    5
    Member #
    20605
    Awesome, worked perfectly! thank you so much.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:44 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com