Datasheet
2. Save the preceding file in a new folder of its own as index.html.
3. Create a new, blank document in your text editor, and enter the following CSS:
body {
margin: 0;
padding: 0;
background: #000 url(‘images/backgrounds/star.png’) no-repeat fixed;
font: 12px sans-serif;
}
a {
text-decoration: none;
color: lightblue;
}
a:hover {
color: yellow;
}
div#solar-system {
position: relative;
height: 575px;
margin: 50px 0 0 0;
border-top: 1px solid #000;
border-bottom: 1px solid #000;
background: #000 url(‘images/backgrounds/star_darker.png’) no-repeat fixed;
overflow: auto;
white-space: nowrap;
}
div.planet {
position: absolute;
top: 0;
left: 0;
bottom: 25px;
}
div.jupiter img.planet {
margin: 75px 0 0 40px;
}
div.saturn {
left: 900px;
}
div.uranus {
left: 1900px;
}
div.uranus img.planet {
margin: 175px 0 0 100px;
}
div.neptune {
left: 2750px;
}
div.neptune img.planet {
margin: 175px 0 0 200px;
}
div.planet img {
float: left;
margin-top: 20px;
19
Chapter 1: Introducing Cascading Style Sheets
05_096970 ch01.qxp 4/20/07 11:27 PM Page 19