Menu
Hi, I am currently using CSS to make my page, but it seems that the layout is perfect when viewed via IE, but when I view it using Firefox, the top part of the layout seems messed up: Here is the flawless layout viewed in IE: [url]http://img108.imageshack.us/img108/9956/goodle5.jpg
and this is what happens when viewed with Firefox.
[url]http://img108.imageshack.us/img108/7479/errorqj3.jpg
Can anyone please tell me what’s wrong?
Thanks.
[CODE]* {
margin: 0;
padding: 0;
}[/CODE]
...broken URL. check addy againhttp://www.netzeye.com/index2.php ..[/QUOTE]
[code=html]<!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>netZeye - Digital Remote Management System</TITLE>
<meta name="description" content="netZeye - Digital Remote Management System"><meta name="keywords" content="netzeye, tsm, cctv camera, security camera, dvr security system">
<link href="../CSS/style.css" rel="stylesheet" type="text/css" />
</head>
<body class="layout">
<div id="container">
<div id="header">
<MARQUEE scrollDelay=200><<< Welcome to
netZeye.com.... We Provide Remote Watching Solutions and Better Digital
Remote Management System in the Market.
<<<</MARQUEE>
</div>
<div id="logo"></div>
<div id="topmenu">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />[/code]
why have you 2 head elements, 2 doc types etc? typo?
[code=html]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
[/QUOTE]
<html xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE>netZeye - Digital Remote Management System</TITLE>
<meta name="description" content="netZeye - Digital Remote Management System"><meta name="keywords" content="netzeye, tsm, cctv camera, security camera, dvr security system">
<link href="../CSS/style.css" rel="stylesheet" type="text/css" />
</head>
<body class="layout">
<div id="container">
<div id="header">
<MARQUEE scrollDelay=200><<< Welcome to
netZeye.com.... We Provide Remote Watching Solutions and Better Digital
Remote Management System in the Market.
<<<</MARQUEE>
</div>
<div id="logo"></div>
<div id="topmenu">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />[/code]
you can't have 2 <head></head>'s in a document, nor two doctypes. all elements that need to be in the head, have to go in THE head (as in singular - the one atthe top, just below the doctype). I'd suggest doing some tidy up and re-arranging. If you're still having problems after you've done this, post your new code / link.[/QUOTE]
Is there a way to separate the CSS*Javascript*HTML in my topmenu file[/QUOTE]
When I tried to validate, it said "This page is not Valid XHTML 1.0 Transitional!", but there were errors. Do I still proceed to fix these errors?[/QUOTE]
The CSS and and Javascript can be put in the ACTUAL head, and the menu ( <ul id="navigation"> down to </ul> ) can be left where it is, it will still reference the CSS inthe head.
Fix the double head an doc type problem first, this will remove any cascading errors - Once that problem is fixed, re-validate you page and proceed with any errors that remain. As I said before common mistakes you have in the file are using attribute name like "HEAD" when you should be using "head" (all lower case) and you're not closing self closing tags. Almost all tags in xhtml must be in the format <tag></tag> (open / close), however there are some that allow you to both open and close in the one line, an example being the meta tags, these can be <meta name="" content="" /> - using <meta name="" content=""> (no closing /) isn't correct - another common one is the line break tag - <br> isn't valid, <br /> is.
EDIT: I shuld probaby mention that the one exception to the above rule is the DOCTYPE tag which does NOT need to be closed.[/QUOTE]
Is there a way to separate the CSS*Javascript*HTML in my topmenu file[/QUOTE]
I want to avoid that because any changes in my topmenu's css would require me to change it on every single page on my website.[/QUOTE]
Sorry. Yes, you can just place the actual CSS content into your CSS file.
Is the CSS file just for that site, or are you using a CSS file that's for multiple sites/designs?[/QUOTE]
<div id="topmenu">
<?php include ("/var/www/html/topmenu.php"); ?>
</div>
[/quote]
Sorry, hadn't seen your last post before my last.
yes. use two includes:
one with the css and javascript content ad place it in the head.
<?php
include('stuffForHead.php');
?>
and another one with the actual list which you place in the body - where the list is to appear
<?php
include('menu.php');
?>[/QUOTE]
[code=html]<!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=utf-8" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>[/code]
[code=html] * {
padding:0;
margin:0;
}
body {
font-family:verdana, sans-serif;
font-size:12px;
}
#navigation, #navigation li ul {
list-style-type:none;
}
#navigation {
margin:0px;
}
#navigation li {
float:left;
text-align:center;
position:relative;
}
#navigation li a:link, #navigation li a:visited {
display:block;
text-decoration:none;
color:#ffffff;
width:120px;
height:25px;
line-height:25px;
border:1px solid #fff;
border-width:1px 1px 0 0;
background:#000000;
padding-left:10px;
}
#navigation li a:hover {
color:#fff;
background:#3d4d5d;
}
#navigation li ul li a:hover {
color:#fff;
background:#6b839c;
}
#navigation li ul {
display:none;
position:absolute;
top:25px;
left:0;
margin-top:1px;
width:120px;
}
#navigation li ul li ul {
display:none;
position:absolute;
top:0px;
left:130px;
margin-top:0;
margin-left:1px;
width:120px;
}[/code]
[code=html]<script type="text/javascript">
function displaySubMenu(li) {
var subMenu = li.getElementsByTagName("ul")[0];
subMenu.style.display = "block";
}
function hideSubMenu(li) {
var subMenu = li.getElementsByTagName("ul")[0];
subMenu.style.display = "none";
}
</script>[/code]
[code=html] <div id="topmenu">
<ul id="navigation">
<li onmouseover="displaySubMenu(this)" onmouseout="hideSubMenu(this)">
<a href="http://www.netzeye.com">Home</a>
</li>
<li onmouseover="displaySubMenu(this)" onmouseout="hideSubMenu(this)">
<a href="http://www.netzeye.com/Products/index.php">Products</a>
<ul>
<li><a href="http://netzeye.com/System/Features/index.php">netZeye System</a></li>
<li><a href="http://netzeye.com/cc/index.php">Capture Card</a></li>
<li><a href="http://netzeye.com/Peripheral/index.php">netZeye Peripheral</a></li>
<li><a href="http://netzeye.com/Stdalone/index.php">Standalone</a></li>
<li><a href="http://netzeye.com/Camera/index.php">CCTV Camera</a></li>
<li><a href="http://netzeye.com/NVR/index.php">NVR</a></li>
<li><a href="http://netzeye.com/IP/index.php">IP Solution</a></li>
<li><a href="http://netzeye.com/CMS/index.php">CMS</a></li>
<li><a href="http://netzeye.com/Monitors/index.php">Monitors</a></li>
<li><a href="http://netzeye.com/Cables/index.php">Cables</a></li>
<li><a href="http://www.netzeye.com/lens/index.php">Lens</a></li>
<li><a href="http://www.netzeye.com/Accessories/index.php">Accessories</a></li>
</ul>
</li>
<li onmouseover="displaySubMenu(this)" onmouseout="hideSubMenu(this)">
<a href="http://netzeye.com/KB/index3.htm">Knowledge Base</a>
</li>
<li onmouseover="displaySubMenu(this)" onmouseout="hideSubMenu(this)">
<a href="http://netzeye.com/Download/index.htm">Downloads</a>
</li>
<li onmouseover="displaySubMenu(this)" onmouseout="hideSubMenu(this)">
<a href="http://netzeye.com/LiveView/index.php">Live View</a>
</li>
<li onmouseover="displaySubMenu(this)" onmouseout="hideSubMenu(this)">
<a href>Support</a>
<ul>
<li><a href="http://netzeye.com/support/contact_us.php">Contact Us</a></li>
<li><a href="http://netzeye.com/support/faqs.php">FAQ's</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>[/code]
Sorry it's late, and I think we're playing post-tennis here. I think the best way to exlain this is, probably, as follows:
When you've tided the double head problem, the basic structure of your page should look like:
[code=html]<!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=utf-8" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>[/code]
you need to either add the following to your css file:
[code=html] * {
padding:0;
margin:0;
}
body {
font-family:verdana, sans-serif;
font-size:12px;
}
#navigation, #navigation li ul {
list-style-type:none;
}
#navigation {
margin:0px;
}
#navigation li {
float:left;
text-align:center;
position:relative;
}
#navigation li a:link, #navigation li a:visited {
display:block;
text-decoration:none;
color:#ffffff;
width:120px;
height:25px;
line-height:25px;
border:1px solid #fff;
border-width:1px 1px 0 0;
background:#000000;
padding-left:10px;
}
#navigation li a:hover {
color:#fff;
background:#3d4d5d;
}
#navigation li ul li a:hover {
color:#fff;
background:#6b839c;
}
#navigation li ul {
display:none;
position:absolute;
top:25px;
left:0;
margin-top:1px;
width:120px;
}
#navigation li ul li ul {
display:none;
position:absolute;
top:0px;
left:130px;
margin-top:0;
margin-left:1px;
width:120px;
}[/code]
or, place [B]<style type ="text/css">put the above code here</style>[/B] between the <head> and </head> tags. If you wish to go this route (just placing it into the CSS file would be much simpler), then you can put [B]<style type ="text/css">put the above code here</style>[/B] in it's own php file and use <?php include ('thatPage.php'); ?>
the following should be between your <head> and </head> tags:
[code=html]<script type="text/javascript">
function displaySubMenu(li) {
var subMenu = li.getElementsByTagName("ul")[0];
subMenu.style.display = "block";
}
function hideSubMenu(li) {
var subMenu = li.getElementsByTagName("ul")[0];
subMenu.style.display = "none";
}
</script>[/code]
and the following should be between your <body> and </body> tags:
[code=html] <div id="topmenu">
<ul id="navigation">
<li onmouseover="displaySubMenu(this)" onmouseout="hideSubMenu(this)">
<a href="http://www.netzeye.com">Home</a>
</li>
<li onmouseover="displaySubMenu(this)" onmouseout="hideSubMenu(this)">
<a href="http://www.netzeye.com/Products/index.php">Products</a>
<ul>
<li><a href="http://netzeye.com/System/Features/index.php">netZeye System</a></li>
<li><a href="http://netzeye.com/cc/index.php">Capture Card</a></li>
<li><a href="http://netzeye.com/Peripheral/index.php">netZeye Peripheral</a></li>
<li><a href="http://netzeye.com/Stdalone/index.php">Standalone</a></li>
<li><a href="http://netzeye.com/Camera/index.php">CCTV Camera</a></li>
<li><a href="http://netzeye.com/NVR/index.php">NVR</a></li>
<li><a href="http://netzeye.com/IP/index.php">IP Solution</a></li>
<li><a href="http://netzeye.com/CMS/index.php">CMS</a></li>
<li><a href="http://netzeye.com/Monitors/index.php">Monitors</a></li>
<li><a href="http://netzeye.com/Cables/index.php">Cables</a></li>
<li><a href="http://www.netzeye.com/lens/index.php">Lens</a></li>
<li><a href="http://www.netzeye.com/Accessories/index.php">Accessories</a></li>
</ul>
</li>
<li onmouseover="displaySubMenu(this)" onmouseout="hideSubMenu(this)">
<a href="http://netzeye.com/KB/index3.htm">Knowledge Base</a>
</li>
<li onmouseover="displaySubMenu(this)" onmouseout="hideSubMenu(this)">
<a href="http://netzeye.com/Download/index.htm">Downloads</a>
</li>
<li onmouseover="displaySubMenu(this)" onmouseout="hideSubMenu(this)">
<a href="http://netzeye.com/LiveView/index.php">Live View</a>
</li>
<li onmouseover="displaySubMenu(this)" onmouseout="hideSubMenu(this)">
<a href>Support</a>
<ul>
<li><a href="http://netzeye.com/support/contact_us.php">Contact Us</a></li>
<li><a href="http://netzeye.com/support/faqs.php">FAQ's</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>[/code]
head, body and the doctype should only occur ONCE per page. you can't use something like <div><body></body></div> (as you have) ALL of your CONTENT goes into the one and only <body></body> on the page.
To be honest, you've a LOT of other problems, but sort you basic page structure first, and then we can look more closely at any problems you're still having.[/QUOTE]
[code=html]and I've already made about 50+ pages already using that layout[/code]
Here's the problem:
This is a coding error, not a FF glitch. It may look okay in IE, but if Microsoft decides to follow the real html standards (set by the W3C) in future browsers, then your site will look messed up all over again, in every browser. You're probably going to want to fix these errors.
Do you have Dreamweaver or [insert name of any other wysiwyg editor]? Most have a "Find and Replace" feature. With this, you could replace certain lines of code throughout ever page on your site...[/QUOTE]
don't know the exact code that's causing my main contents to be messed up. Could it be my CSS codes (the margin and padding in mainContent)http://www.netzeye.com/CSS/style.css that's causing it?[/QUOTE]
0.1.9 — BETA 6.16