Trouble with styling php elements

Discussion in 'Web Design and Development' started by macjakob, Oct 15, 2008.

  1. macjakob macrumors newbie

    Feb 16, 2006

    I'm having trouble styling some elements on my site that I've begun making:

    at the top you see the navigation bar, which should be a horizontal list.
    The index.php just pulls content from the other pages (linked to in the nav bar) and displays them in the content area.

    My css looks like this:

    body {
    background-color: #e9e6d6;
    margin: 0; padding: 0; border: 0;}

    .content {
    margin: 0 auto;
    background-color: white;
    width: 800px;
    height: 500px;
    padding: 30px;
    text-align: left;

    /*---- navigation ----*/
    #navigation {
    border: 0;
    list-style-type: none;
    z-index: 1;
    text-decoration: none;
    font: 12px Helvetica, Arial, Geneva, sans-serif;
    text-align: center;
    color: #333;
    display: inline;
    padding-right: 50px;
    text-align: center;

    #navigation a {
    text-decoration: none;
    color: #75736b;

    #navigation a:hover {
    text-decoration: none;
    color: #464540;

    and the horizontal navigation list part in my index.php:


    $selected[$p] = ' class="active"';
    <div id="navigation">
    <li<?=$selected['forside']?>><a href="?p=main">Forside</a></li>
    <li<?=$selected['sortiment']?>><a href="?p=sortiment">Sortiment</a></li>
    <li<?=$selected['bestil']?>><a href="?p=bestil">Bestil</a></li>
    <li<?=$selected['omos']?>><a href="?p=omos">Om os</a></li>
    <li<?=$selected['kontakt']?>><a href="?p=kontakt">Kontakt</a></li>
    <div class="content">
    <? include("pages/".$p.".php"); ?>

    I really don't see where I'm making a mistake, anyone care to explain? Your help is greatly appreciated.
    I have a hunch that I'm doing something wrong with the classes/styles in the css file itself?

    Thank you in advance,

  2. ChicoWeb macrumors 65816


    Aug 16, 2004
    You syntax is pretty jacked. Also, not sure what you're trying to do with the div and ul id's called the same. You either need to do.

    #navigation ul



    AND, your UL html needs to be something like

    <ul id="navigation">
  3. macjakob thread starter macrumors newbie

    Feb 16, 2006

Share This Page