problem with css....php...notsure if one is screwing up the

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

problem with css....php...notsure if one is screwing up the

Post by dull1554 »

ok, I just started expiramenting with horizontal lists, i'm trying to make a horizontal menu using a <ul>. i have made the menu correctly, but the pickle i have run into is that no matter what i do i can get the stinkin menu centered on the page, heres my code

index.php

Code: Select all

<?php
echo <<< EOT
<html>
<head>
<LINK REL=StyleSheet HREF="style.css" TYPE="text/css">
</head>
<body background=bg.gif>


<table width=100%><tr><td>
<center><img src=header.png></center>
</td></tr></table>

<div id="navbar" align=center>
<table width=100%><tr><td>
    <ul>
        <li><a href="index.php">Home</a></li>
        <li><a href="index.php?l=news.php">News</a></li>
        <li><a href="index.php?l=law/laws.html">legal</a></li>
        
    </ul>
 </td></tr></table>
</div>


<center>
<table width=90% border=1 bordercolor=#000000 cellspacing=0>
<tr><td border=0>
EOT;
if(isset($_GET['l']))
{
include $_GET['l'];
}
else
{
include "main.html";
}
echo <<< EOT
</td></tr></table></center>


EOT;
?>
style.css

Code: Select all

#navbar ul &#123;
     padding:0;
&#125;

#navbar li &#123;
     width: 130px;
     text-align: center;
     display: inline;
     list-style: none;
     border-color: #DEFFDE;
     border-top: 1px solid black;
     border-bottom: 1px solid black;
     border-left: 1px solid black;
     border-right: 1px solid black;
&#125;

#navbar a &#123;
	color           : black;
	display         : block;
	text-decoration : none;
	width           : 100%;
&#125;
#navbar a:hover &#123;
	background      : #DEFFDE;
	color           : #000000;
&#125;
#navbar a:visited &#123;
	color           : #000000;
&#125;
#header &#123;
	position        : absolute;
    top             : 0;

&#125;

a &#123;
	color           : #000000;
&#125;
a:active &#123;
	color           : #000000;
&#125;
a:visited &#123;
	color           : #000000;
&#125;
penguinboy
Forum Contributor
Posts: 171
Joined: Thu Nov 07, 2002 11:25 am

Post by penguinboy »

Code: Select all

<div id="navbar" align=center>
BTW this has nothing to do with php.
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

Post by dull1554 »

nevermind, i continued to try and i figured it out, i just applied the css to the elements themselves and not to #navbar, so i got rid of the <div> and the table and it works fine now
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: problem with css....php...notsure if one is screwing up

Post by pickle »

dull1554 wrote: ....the pickle i have run into....
I have nothing further to contribute, I just had to comment though.
Post Reply