...

View Full Version : menu position jumps when put in include file



tangled_slinky
01-08-2008, 04:53 PM
Hello-

I'm really new at this website-writing thing (stifle the groans, please :). Anyway, I'm trying to include a standard header, footer, and menu in all the pages. The header and footer display well as .txt includes, but the menu, which displays fine when not included, jumps halfway down the page as a .txt file. It's supposed to be tight up against the header. I have no idea what's going wrong, so any help given would be extremely appreciated.

Thanks-
Kate

kosstr12
01-09-2008, 12:18 PM
Try
float:left;
inside the css for the menu

Excavator
01-09-2008, 05:00 PM
Good morning tangled_slinky,
That's a lot of hacks in that CSS! Have you really invoked any IE bugs with what little is in your code? I would leave the hacks out until you really find you need one.

Maybe a better way would be this:

<body>

<div id="Header">
<!--#include virtual="/includes/header.txt" -->
</div>


<div id="Menu">
<ul>
<li><a href="#" class="hmenu">Home</a></li>
<li><a href="#" class="hmenu">About</a>
<ul>
<li><a href="#" class="sub">Hobbs</a></li>
<li><a href="#" class="sub">Current Officers</a></li>
<li><a href="#" class="sub">Bio Pages</a></li>
</ul>
<li><a href="#" class="hmenu">Pholeos</a>
<ul>
<li><a href="#" class="sub">Current Issue Highlights</a></li>
<li><a href="#" class="sub">Submission Guidelines</a></li>
</ul>
<li><a href="#" class="hmenu">Calendar</a></li>
<li><a href="#" class="hmenu">Activities</a>
<ul>
<li><a href="#" class="sub">Trip Reports</a></li>
<li><a href="#" class="sub">Open Surveys</a></li>
<li><a href="#" class="sub">Current Research</a></li>
</ul>
</li>
<li><a href="#" class="hmenu">Photos</a></li>
<li><a href="#" class="hmenu">Caves and Caving</a>
<ul>
<li><a href="#" class="sub">How Caves Form</a></li>
<li><a href="#" class="sub">Conservation/Laws</a></li>
<li><a href="#" class="sub">What to Bring Caving</a></li>
</ul>
</li>
<li><a href="#" class="hmenu">Links</a></li>
<li><a href="#" class="hmenu">Contact Us</a></li>
</ul>
<!--end menu--></div>
<div id="Content">
<h1>Hello!</h1>
<p style="text-indent:30px">
text text text content text
</p>
<!--end content--></div>

<div id=footer>
<!--#echo var="Last_Modified" -->
<!--#include virtual="/includes/footer.txt" -->
</div>
</body>

and the CSS:
body {
font:11px/20px verdana, arial, helvetica, sans-serif;
color:#336600;
background-color:#FFFFCC;
}
* {
margin:0px;
padding:0px;
}
h1 {
margin:0px 0px 15px 0px;
font-size:28px;
line-height:28px;
font-weight:900;
color:#999966;
}
h2 {
font-size:26px;
line-height:0px;
font-weight:700;
color:#999966;
margin:0px 0px 15px 15px;
}
p {
margin:0px 0px 16px0px;
}
#Content>p {margin:0px;}
#Content>p+p {text-indent:30px;}
a {
font-size:15px;
text-decoration:none;
font-weight:600;
}
a:link {color:#CC3333;}
a:visited {color:purple;}
a:hover {background-color:white;}
a:active {border:solid 1px #CC3333;}
ul {
list-style-type: circle;
}
#Header {
margin:50px 0px 0px 0px;
padding:17px 0px 6px 20px;
/* For IE5/Win's benefit height = [correct height] + [top padding] + [top and bottom border widths] */
height:30px;
font-size:30px;
font-weight:heavy;
border-style:solid;
border-color:black;
border-width:1px 0px; /* top and bottom borders: 1px; left and right borders: 0px */
line-height:11px;
background-color:#CC9933;
}
#Content {
margin:0px 230px 50px 10px;
padding:10px;
background: #66CCFF;
}
#Menu {
float:right;
padding:10px;
background-color:#eee;
border:3px dotted #336600;
width:150px;
}
.hmenu {
font-size:15px;
font-weight:heavy;
}
.sub {font-size:13px;}
#Footer {
margin:50px 0px 10px 0px;
padding:17px 0px 6px 20px;
/* For IE5/Win's benefit height = [correct height] + [top padding] + [top and bottom border widths] */
height:33px;
border-style:solid;
border-color:black;
border-width:1px 0px; /* top and bottom borders: 1px; left and right borders: 0px */
line-height:11px;
background-color:#CC9933;
}

tangled_slinky
01-09-2008, 06:09 PM
excavator-

ha, i know there's a lot of extra stuff in there. it was one of bluerobot's free templates that i tweaked slowly, slowly so it didn't break. thanks for the cleaned up code, i'll try it out. :)

tangled_slinky
01-09-2008, 06:11 PM
kosstr12-
thanks! i'll give it a try, and let you know how it goes later this evening.

-kate



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum