Forum Moderators: not2easy
What I want is about 6 'buttons' horizontally across the page. I want them to almost be obvious 'buttons'. I want to be able to hover over the 'button' and have the hover activate and create either a depressed look or some form of over.
I had heard that CSS was easy to learn, but it has caused me nothing but problems to date.
I should correct something, no javscript. I want to use CSS only. Thanks.
That shouldn't be a problem. For form buttons, you could use something like this, with CSS hover to change it when you move your mouse over it:
<html>
<head>
<style type="text/css">
input:hover
{
color: #ffffff;
background-color: #ff0000;
}
</style>
</head>
<body>
<form method="get" action="http://www.google.com/">
<input type="submit" value="click me" />
</form>
</body>
</html>
I had heard that CSS was easy to learn, but it has caused me nothing but problems to date.
CSS is easier to approach if you treat it as something very difficult to learn, which it is.
I assume you are looking for navigation type links, either vertical or horizontal, like this?:
Link 1 : Link 2 : Link 3... etc
To get the affects you are after you probably want to use:
a.nav {
display:block;
background-color:blue;
text-decoration:none;
color:white;
padding:2px 5px;
width:4em;
float:left;
}
a.nav:hover {
background-color:white;
color:blue;
}
then you make your nav bar, say horizontal:
<a class="nav" href="/page1.htm">Link 1</a>
<a class="nav" href="/page2.htm">Link 2</a>
<a class="nav" href="/page3.htm">Link 3</a>
and so on. Doing horizontal links is not super easy with css, vertical navs are very easy, since you don't need any floats, and you can use default div behaviors for the nav container.
CSS is easier to approach if you treat it as something very difficult to learn, which it is.
Try this to start:
<style>
#nav {
margin: 4em 0 0 2em;
}
#nav ul {
margin: 0; padding: 0;
}
#nav li {
display: inline; margin-right: 2em; text-align: center;
}
#nav li a {
background-color: red; color: #000; padding: 1em;
}
#nav li a:hover {
background-color: #000; color: red;
}
</style>
<div id="nav">
<ul>
<li>
<a href="">
Link
</a>
</li>
<li>
<a href="">
Link
</a>
</li>
<li>
<a href="">
Link
</a>
</li>
</ul>
</div>