Hi,
I am trying to get them in a “window” pattern as shown in the image below. So they are equally spaced, I had this before I used javascript to create the slideshow at the top:
If you want to space them out in the example I gave then just change this as follows.
#nav li { margin:10px 0 10px 10px }
#nav li.about, #nav li.contact {float:right;margin:10px 10px 10px 0}
There was also a typo in my code and this rule should be like this:
.container:after, #nav:after {/*clear floats*/
content:"";
clear:both;
display:block;
height:0;
visibility:hidden;
}
You can then put a border around the nav with this:
#nav {
margin:10px 0 20px;
padding:0;
list-style:none;
zoom:1.0;
border:1px solid #000;
}
Here is the whole code again with the fixes above.
<!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" />
<title>Untitled Document</title>
<!--<link href="style/style2.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="http://www.neverup-neverin.com/css/slider.css" />
-->
<style type="text/css">
html, body {
margin:0;
padding:0;
}
body {
font-family: Arial, Helvetica, sans-serif;
background:#fff;
color:#000;
}
.container {
width: 960px;
margin:auto;
}
.container:after, #nav:after {/*clear floats*/
content:"";
clear:both;
display:block;
height:0;
visibility:hidden;
}
.header {
background-image: url(http://www.neverup-neverin.com/images/header3.png);
height: 95px;
background-repeat: no-repeat;
margin-right: auto;
margin-left: auto;
}
.slideshow {
height: 250px;
width: 960px;
margin: 0 auto;
}
.footer {
background: #ccf;
min-height: 200px;
border: 1px solid #000;
clear:both;
}
#nav {
margin:10px 0 20px;
padding:0;
list-style:none;
zoom:1.0;
border:1px solid #000;
}
#nav li, #nav li a, #nav li span {
float:left;
width:461px;
height:131px;
position:relative;
overflow:hidden;
cursor:pointer;
text-decoration:none;
}
#nav li { margin:10px 0 10px 10px }
#nav li.about, #nav li.contact {float:right;margin:10px 10px 10px 0}
#nav li span {
position:absolute;
left:0;
top:0
}
#nav li.prices a:hover { visibility:visible }
#nav li.prices a span { background:url(http://www.neverup-neverin.com/images/pricewidget.png) no-repeat 0 0 }
#nav li.prices a:hover span { background:url(http://www.neverup-neverin.com/images/pricewidgetroll.png) no-repeat 0 0 }
#nav li.about a span { background:url(http://www.neverup-neverin.com/images/aboutwidget.png) no-repeat 0 0 }
#nav li.about a:hover span { background:url(http://www.neverup-neverin.com/images/aboutwidgetroll.png) no-repeat 0 0 }
#nav li.testimonials a span { background:url(http://www.neverup-neverin.com/images/testimwidget.png) no-repeat 0 0 }
#nav li.testimonials a:hover span { background:url(http://www.neverup-neverin.com/images/testimwidgetroll.png) no-repeat 0 0 }
#nav li.contact a span { background:url(http://www.neverup-neverin.com/images/contactwidget.png) no-repeat 0 0 }
#nav li.contact a:hover span { background:url(http://www.neverup-neverin.com/images/contactwidgetroll.png) no-repeat 0 0 }
/* preload roll over images*/
#nav li.prices { background:url(http://www.neverup-neverin.com/images/pricewidgetroll.png) no-repeat 0 0 }
#nav li.about { background:url(http://www.neverup-neverin.com/images/aboutwidgetroll.png) no-repeat 0 0 }
#nav li.testimonials { background:url(http://www.neverup-neverin.com/images/testimwidgetroll.png) no-repeat 0 0 }
#nav li.contact { background:url(http://www.neverup-neverin.com/images/contactwidgetroll.png) no-repeat 0 0 }
/* slider CSS */
#slider {
height: 250px;
overflow: hidden;
margin: 30px auto;
}
#slider > img {
width: 960px;
height: 250px;
float:left;
display: none;
}
#slider a {
padding: 5px 10px;
background-color:#f0f0f0;
margin-top: 30px;
text-decoration:none;
color: #666;
}
a.left { float: left; }
a.right { float:right; }
</style>
<script src="http://www.neverup-neverin.com/js/jquery.js"></script>
<script src="http://www.neverup-neverin.com/js/slider.js"></script>
</head>
<body>
<div class="container">
<div class="header"> </div>
<!--Closing header -->
<div class="slideshow">
<div id="slider"> <img id="1" src="http://www.neverup-neverin.com/images/markjames1.jpg" /> <img id="2" src="http://www.neverup-neverin.com/images/markjames2.jpg" /> <img id="3" src="http://www.neverup-neverin.com/images/markjames3.jpg" /> <a href="#" class="left" onclick="prev(); return false;">Previous</a> <a href="#" class="right" onclick="next(); return false;">Next</a> </div>
</div>
<!-- Closing slideshow div -->
<ul id="nav">
<li class="prices"><a href="#">Prices<span></span></a></li>
<li class="about"><a href="#">About<span></span></a></li>
<li class="testimonials"><a href="#">Testimonials<span></span></a></li>
<li class="contact"><a href="#">Contact<span></span></a></li>
</ul>
<div class="footer">Content for class "footer" Goes Here </div>
<!-- Closing footer-->
</div>
<!--Closing container-->
</body>
</html>
The rollover images were created by Dreamweaver, can rollover images be created another way then?
Yes you can do it with CSS and should never use JS for simple rollovers. You use a background image and then change the background image on hover - although this is usually better done with sprites…
The technique I used in your page was a gilder /levin image replacement so that you had real text in the htm.
Could you possibly talk me through using lists instead of containers?
There’s not much to say really but when you a have a ‘list’ of items or a series of images or links (as in a nav) then a list is the most semantic element to use.
It’s no different to using a div as far as the css is concerned once you have turned off the bullets, margin and padding but the semantics are more correct. Don’t use lists for everything though; just use them when you have a series of similar items that are best grouped together.
Also the images were created in fireworks, how would I reduce the size of these images?
In Fireworks go to File , Image preview - and then select the best option for the image. If its a normal image then you can choose jpg and lower the quality until the file size is reasonable without much loss of quality to the naked eye. It’s a matter of playing around with gif, png and jpg to see what looks best and what is the lowest filesize. (As a rule of thumb I wouldn’t use any image over 200k unless it was a for a full page background image or it was a special site to do with images.)
Those 4 small images of yours should be around 40k max.
Sorry if this all seems a bit trivial to you, but I am just starting out and would like to learn as much as possible
It’s not trivial and you are asking the right questions