Forum Moderators: not2easy

Message Too Old, No Replies

PHP & CSS

Problems regarding PHP and CSS

         

dfox

12:16 pm on Aug 28, 2008 (gmt 0)

10+ Year Member



I am busy designing a website for a local newspaper completely with CSS. I use PHP because I want to incorporate MySQL into the website.

The problem I have is that I have a DIV ID=WRAPPER to be my page and when I include the left navigation (DIV ID-LEFTNAV) the left navigation doesn't fit inside the WRAPPER ID, but flows over the bottom line of the WRAPPER ID.

In IE it displays 100% but in FIREFOX it comes out all quirky.

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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="style/layout.css" rel="stylesheet" type="text/css" media="screen" />
</head>

<body>
<div id="wrapper">
<div id="leftnav"><?php include('left_nav.php'); ?>
</div>
</div>
</body>
</html>

CSS:
#wrapper {
background-color: #FFFFFF;
padding: 5px;
width: 990px;
position: relative;
text-align: left;
margin-right: auto;
margin-left: auto;
margin-top: 10px;
}
#leftnav {
background-color: #000000;
padding: 0px;
float: left;
width: 150px;
margin-top: 10px;
margin-bottom: 10px;
}
body {
background-color: #000000;
text-align: center;
padding: 0px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
margin: 0px;
}

CAN SOMEONE PLEASE TELL ME WHERE THE PROBLEM LIES. I ASKED PEOPLE I KNOW, BUT NOBODY CAN HELP.

PS. I use Dreamweaver 8 to design the website ¦ The included files' doctypes and CSS styles have been removed before I included them

vincevincevince

12:20 pm on Aug 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As the last thing in the wrapper, write this:
<br style="clear:both" />

dfox

12:25 pm on Aug 28, 2008 (gmt 0)

10+ Year Member



Thanks alot. It worked and you guys are very quick. The LIST <li> in my left navigation now shows bullets. I guess the problem lies in the CSS codes of list items?

vincevincevince

12:26 pm on Aug 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, CSS code of list items is the cause of bullets on an li. Try list-style:none

dfox

1:18 pm on Aug 28, 2008 (gmt 0)

10+ Year Member



Thanks alot.

I've made the adjustments and everything looks great in both IE and FIREFOX

swa66

3:02 pm on Aug 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just for the record: IE's way of displaying is the wrong one (even if it is the one you want). Typical case of their broken box model.

Try to develop your code without using IE, it'll help you along much more faster and with much less frustration. Afterward you can compensate for the bugs (or "features") in IE using conditional comments.