Menu
You know how when you use frames, its possible to set it up so there is a horizontal frame across the top of the screen that is visible at all times? Well my question is how i can do this using css! It would be used to keep a menu visible at the top of the page at all times.
And no, i dont want to use javascript.
THANKS! ? ? ?
-tc
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>ROADPAC - Planning for Oregon's Future!</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="content-script-type" content="text/javascript">
<meta http-equiv="content-style-type" content="text/css">
<meta http-equiv="content-language" content="en-us">
<meta http-equiv="imagetoolbar" content="no">
<meta name="mssmarttagspreventparsing" content="true">
<style type="text/css" media="screen">@import "stylesheet.css";</style>
</head>
<body>
<div id="content">
<h1>ROADPAC</h1>
<h2>Planning for Oregon's Future</h2>
<div id="coos">
<img src="images/coos.gif" alt="" height="100" width="300">
</div>
<h3>What is Roadpac?</h3>
<p>It is a Political Action Committee (PAC)
formed by the Oregon State Grange to promote
the merits of a limited access highway that
will cross the state from the Oregon International
Port of Coos Bay to Ontario on the east side
of the state, the I-84 Port of Entry into
Oregon. This will encourage economic development
and increase employment in areas that are
economically depressed. Ultimately a network
of these new 2 and 4 lane interstate quality
roads are proposed to provide safer, faster
travel throughout the State.</p>
<h3>Initiative Ballot</h3>
<p>Oregon allows its citizens to place an initiative
on the ballot. This grass roots effort will
require obtaining nearly 76,000 certified
signatures of registered voters to place
the argument before the voters of the state.</p>
<h3>Support the Project</h3>
<p>You can help in several ways: Cash <a href="contrib.html">contributions</a> are welcome and may be tax deductible. Gather
signatures for the initiative petition. Use
our video to give a presentation to your
organization. Write letters to your state
political representatives suggesting they
take action to support building this limited
access highway.</p>
<h3>Join the Forum</h3>
<p>Use the <a href="http://www.roadpac.org/forum/">Forum</a> to volunteer help, make comments, or request
more information. We will appreciate your
interest.</p>
</div>
<div id="topbar">
<div id="menu">
<span class="currentpage">Home</span> |
<a href="contrib.html" class="parent">Contribute</a> |
<a href="video.html" class="parent">Video</a> |
<a href="cont.html" class="parent">Contact</a> |
<a href="faq.html" class="parent">FAQ</a> |
<a href="info.html" class="parent">Info</a> |
<a href="forum/" class="parent">Forum</a> |
<a href="http://www.roadpac.org/forum/viewforum.php?f=5" class="parent">Polls</a>
</div>
<div id="copyright">
<p id="copyrighttext">Copyright &copy; 2001-2004 RoadPac.</p>
</div>
</div>
</body>
</html>
body {
margin: 0;
padding: 0;
background-color: #fffff0;
}
/*Top Bar*/
#topbar {
top: 0;
position: fixed;
background-color: #ffffff;
width: 100%;
height: 75px;
}
/*Menu*/
#menu {
text-align: center;
}
/*Copyright*/
#copyright {
bottom: 0;
right: 0;
position: absolute;
}
#copyrighttext {
color: #000000;
font-size: x-small;
}
/*Headers*/
h1,h2 {
visibility: hidden;
position: absolute;
}
h3 {
color: #000080;
font-family: Verdana;
font-size: small;
font-weight: bold;
margin: 0px;
}
/*Paragraphs*/
p {
color: #000080;
font-family: Verdana;
font-size: small;
margin-top: 0px;
}
/*Content*/
#content {
margin-top: 80px;
margin-left: 10px;
margin-right: 10px;
}
/*Coos Bay-Ontario image*/
#coos {
text-align: center;
}
/*general links*/
a:link {
color: blue;
text-decoration: underline;
}
a:visited {
color: purple;
text-decoration: underline;
}
a:hover {
color: blue;
text-decoration: underline;
}
/*menu parent links*/
a.parent:link {
text-decoration: none;
color: #000080;
font-weight: bold;
font-family: Verdana;
font-size: 12pt;
}
a.parent:visited {
text-decoration: none;
color: #000080;
font-weight: bold;
font-family: Verdana;
font-size: 12pt;
}
a.parent:hover {
text-decoration: none;
color: #ff0000;
font-weight: bold;
font-family: Verdana;
font-size: 12pt;
}
/*menu child links*/
a.child:link {
text-decoration: none;
color: #000080;
font-weight: normal;
font-family: Verdana;
font-size: 8pt;
}
a.child:visited {
text-decoration: none;
font-weight: normal;
color: #000080;
font-family: Verdana;
font-size: 8pt;
}
a.child:hover {
text-decoration: none;
color: #ff0000;
font-weight: normal;
font-family: Verdana;
font-size: 8pt;
}
/*menu current page link*/
span.currentpage {
text-decoration: none;
color: #999999;
font-weight: bold;
font-family: Verdana;
font-size: 12pt;
}
<i>
</i>body {
padding:0;
margin: 0;
height: 100%;
overflow: hidden;
}
/*Top Bar*/
#topbar {
position: absolute;
top: 0;
left: 0;
background-color: #ffffff;
width: 100%;
height: 75px;
overflow: auto;
}
/*Content*/
#content {
width: 100%;
height: 100%;
overflow: auto;
}
<i>
</i>@media screen {
body {
margin: 0;
padding: 75px 0 0 0;
background-color: #fffff0;
}
/*Top Bar*/
#topbar {
top: 0;
left: 0;
position: fixed;
background-color: #ffffff;
width: 100%;
height: 75px;
overflow: auto;
}
/*Content*/
#content {
padding: 0 10px;
}
}
[i]Originally posted by The Cheat [/i]
[B]yes i have php available to me, however, if you could post the code to do it serverside with php, but also post the code to using the ie conditional statement, that would be awesome. That way i can have both for future reference.
thanks [/B][/QUOTE]
[code=php]
<?php
if(!stristr($_SERVER["HTTP_USER_AGENT"], "Opera") && stristr($_SERVER["HTTP_USER_AGENT"], "MSIE")) { ?>
body {
padding: 0;
margin: 0;
height: 100%;
overflow: hidden;
}
/*Top Bar*/
#topbar {
position: absolute;
top: 0;
left: 0;
background-color: #FFF;
width: 100%;
height: 75px;
overflow: auto;
}
/*Content*/
#content {
width: 100%;
height: 100%;
overflow: auto;
}<?php } else { ?>
@media screen {
body {
margin: 0;
padding: 75px 0 0 0;
background-color: #FFFFF0;
}
/*Top Bar*/
#topbar {
top: 0;
left: 0;
position: fixed;
background-color: #FFF;
width: 100%;
height: 75px;
overflow: auto;
}
/*Content*/
#content {
padding: 0 10px;
}
}<?php } ?>
/*Menu*/
#menu {
text-align: center;
}
/*Copyright*/
#copyright {
bottom: 0;
right: 0;
position: absolute;
}
#copyrighttext {
color: #000000;
font-size: x-small;
}
/*Headers*/
h1,h2 {
visibility: hidden;
position: absolute;
}
h3 {
color: #000080;
font-family: Verdana;
font-size: small;
font-weight: bold;
margin: 0px;
}
/*Paragraphs*/
p {
color: #000080;
font-family: Verdana;
font-size: small;
margin-top: 0px;
}
/*Coos Bay-Ontario image*/
#coos {
text-align: center;
}
/*general links*/
a:link {
color: blue;
text-decoration: underline;
}
a:visited {
color: purple;
text-decoration: underline;
}
a:hover {
color: blue;
text-decoration: underline;
}
/*menu parent links*/
a.parent:link {
text-decoration: none;
color: #000080;
font-weight: bold;
font-family: Verdana;
font-size: 12pt;
}
a.parent:visited {
text-decoration: none;
color: #000080;
font-weight: bold;
font-family: Verdana;
font-size: 12pt;
}
a.parent:hover {
text-decoration: none;
color: #ff0000;
font-weight: bold;
font-family: Verdana;
font-size: 12pt;
}
/*menu child links*/
a.child:link {
text-decoration: none;
color: #000080;
font-weight: normal;
font-family: Verdana;
font-size: 8pt;
}
a.child:visited {
text-decoration: none;
font-weight: normal;
color: #000080;
font-family: Verdana;
font-size: 8pt;
}
a.child:hover {
text-decoration: none;
color: #ff0000;
font-weight: normal;
font-family: Verdana;
font-size: 8pt;
}
/*menu current page link*/
span.currentpage {
text-decoration: none;
color: #999999;
font-weight: bold;
font-family: Verdana;
font-size: 12pt;
}
[/code]
[/size][code=php]
header("content-type: text/css");
[/code]
<i>
</i><!--[if IE]>
*CSS HERE*
<![endif]-->
[i]Originally posted by The Cheat [/i]
[B]yeah. its really unfortunate that ie doesn't support FIXED!!!! It ticks me off. I dont like using hacks for browsers that arent dead... In fact, i HATE hacks. [/B][/QUOTE]
[i]Originally posted by The Cheat [/i]
[B]as much as i would love to do that. I believe we should code for our audience.. and since just about everyone uses IE. We're stuck.
grrr
:mad: [/B][/QUOTE]
0.1.9 — BETA 5.20