Hi
Here is a few pointers that may help you along.
1. Make sure you properly define the code, like here:
height: 100%
should be: height: 100%;
See the little ; after the 100%? You forgot that, and that is why you were unsuccesfull to adjust the hight.
To define hight in heading 2, you should insert it there, like you have with heading 1. Include the ; and you can even define it in px, like 150px; in stead of 100%;.
To remove the space between the heading 1 and heading 2 colours, take out this at heading 2: padding: .2em and the 2 colours will touch, with no space inbetween.
I am not sure where you want the table at the bottom to appear, but to get colour into it, you have to define it.
Kraai
Senior Poster
3,981 posts since Feb 2008
Reputation Points: 76
Solved Threads: 87
See the code below, I made it up quickly to show you how to get the two colors in the header area together with no space.
<html>
<head>
<title>Stylesheets</title>
<style type="text/css">
<!--
BODY { background-color: #9370DB }
h1 { height: 100px; color: black; font-size: 37px; font-family: impact; background: blue; text-align: center;
margin-top:20px; margin-bottom:0px; margin-left:0px; margin-right:0px; border-top-width:2px; }
h2 { height: 70px; color: black; font-size: 26px; font-family: Arial, Helvetica, sans-serif; background: yellow; text-align:
center; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px }
-->
</style>
</head>
<body>
<h1>Simple stylesheet coding</h1>
<h2>Example text<h2>
</body>
</html>
Kraai
Senior Poster
3,981 posts since Feb 2008
Reputation Points: 76
Solved Threads: 87
Any function in css you can plot exactly where you want to place it, and how it must be placed, and how it must react.
You do the where it must go, by the "position:" tag.
In your case, you build a table with html code. Now you want to position it and decorate it within your webpage, probably by using some more html to get it to the right place, making the code all messy at the end.
You dont have to do all that, and thats the good news, using only css to do your horizontal table menu, you can place it where you want it, and making it look funky as well, by defining some hoover functions as well.
See on my example below, how I made up your table with only css style, and placed it within the h2 part of the site.
You should read up all you can on the various functions and things that can be done with css stylesheets. All of us are learning new things each day with it.
Good luck with the rest of your assignment
<html>
<head>
<title>Stylesheets</title>
<style type="text/css">
<!--
BODY { background-color: #9370DB }
h1 { height: 100px; color: black; font-size: 37px; font-family: impact; background: blue; text-align: center; margin-top:0px;
margin-bottom:0px; margin-left:0px; margin-right:0px; border-top-width:2px; }
h2 { height: 70px; color: black; font-size: 26px; font-family: Arial, Helvetica, sans-serif; background: yellow; text-align:
center; margin-top:0px; margin-left:0px; margin-right:0px }
-->
</style>
<style type="text/css">
ul{
list-style-type:none;
}
li{
display:inline;
}
a{
float:center;
width:180px;
text-decoration:none;
color:white;
font-weight:bold;
background:#999900;
border-right:1px solid #FFFFFF;
}
a:hover{
background:#CCCC00;
}
</style>
</head>
<body>
<h1>Simple stylesheet coding</h1>
<h2>Example text<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Images</a></li>
<li><a href="#">Contact</a></li>
</ul></h2>
</body>
</html>
Kraai
Senior Poster
3,981 posts since Feb 2008
Reputation Points: 76
Solved Threads: 87
Cool, glad I could help!
Good luck.
Kraai
Senior Poster
3,981 posts since Feb 2008
Reputation Points: 76
Solved Threads: 87