Jump to content

CSS header question


Far Cry

Recommended Posts

My website header is comprised of two divs, my nav bar div and my header div where the image goes, however, as you can see in the screenshot, there is a white outline around them, I want to have it so it fills that whole area, here is my CSS, yes I've messed with widths with no luck what so ever.

 #navbar ul { 
        margin:0;
        padding: 5px; 
        list-style-type: none; 
        text-align: left; 
        background-color: #000; 
        } 

#navbar ul li {  
        display: inline; 
        } 

#navbar ul li a { 
        text-decoration: none; 
        padding: .2em 1em; 
        color: #fff; 
        background-color: #000; 
        } 

#navbar ul li a:hover { 
        color: #000; 
        background-color: #fff; 
        } 

#header {
     background-color:#000;

    }

#header img {
    padding-left:5px;
    }
  
#user_items {
        margin:0px;
        padding: 5px; 
        text-align: center; 

  }
  
#user_items table tr td{
       color:fff;
       padding:2em 1em;
  }
  

 

Here is the HTML code:

<?php 
session_set_cookie_params(3600 * 24 * 7); 
session_start();
$username = $_SESSION['username'];
$userid = $_SESSION['userid'];
$userlevel = $_SESSION['userlevel'];
$valid = $_SESSION['valid'];
?>
<?php require("scripts/functions.php"); ?>
<?php require("scripts/connect.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Crime Town</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href='css/style.css' rel='stylesheet' type='text/css' />

</head>
<body>
<?php
if(isLoggedin($valid)){
?>
<div id="header">
<img src="images/originallogo.png">
</div>

<div id="navbar"> 
  <ul> 
        <li><a href="index.php">Home</a></li> 
	<?php 
	if($userlevel == "Admin"){
	 echo"<li><a href=\"admin.php?page=home\">Admin Panel</a></li>";
	}
	?>
        <li><a href="items.php">Items</a></li> 
        <li><a href="shops.php">Shops</a></li> 
        <li><a href="logout.php">Log Out</a></li> 
  </ul> 
</div> 
<br />






<?php
} else{
?>
<div id="header">
<img src="images/originallogo.png">
</div>

<div id="navbar"> 
  <ul> 
        <li><a href="index.php">Home</a></li>
        <li><a href="register.php">Register</a></li>
        <li><a href="login.php">Login</a></li>
  </ul> 
</div> 
<br />

<?php
}
?>

 

Thanks in advance.

 

 

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/246232-css-header-question/
Share on other sites

try changing this:

<div id="header">
<img src="images/originallogo.png">
</div>

to this:

<div id="header">
<img src="images/originallogo.png" height="100%" width="100%">
</div>

 

and add this to the top of your CSS file:

* {
margin: 0;
padding: 0;
}

Link to comment
https://forums.phpfreaks.com/topic/246232-css-header-question/#findComment-1264620
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.