Site hosted by Angelfire.com: Build your free website today!
Home >> CSS >> Rollover buttons

These “rollover buttons” are really just paragraphs styled with CSS. No JavaScript was used.

Google

Alta Vista

Yahoo

Here’s how the “buttons” look without CSS:

Google

Alta Vista

Yahoo

    Here’s how the rollover effect was created.
  1. Each paragraph was given a class (named dynbutton in this case).
  2. The paragraphs were placed inside a div element with an ID (btnPanel).
  3. A stylesheet was created as follows.
#btnPanel {
  background-color: #7ea8cf;
  border: 1px #666 solid;
  width: auto;
  margin: 40px 37.5% 1em;
  padding: 8px;
  text-align: center;
}

.dynbutton {
  font-weight: bold;
  text-align: center;
  margin: 3px 1em;
}

.dynbutton a {
  padding: 4px;
  text-decoration: none;
  width: 98%;
  display: block;
  color: #224059;
  background-color: #b5c9e2;
  border-top: 2px #cce3ff solid;
  border-left: 2px #cce3ff solid;
  border-bottom: 2px #31557f solid;
  border-right: 2px #31557f solid;
}

.dynbutton a:hover {
  background-color: #99aabf;
  border-top: 2px #31557f solid;
  border-left: 2px #31557f solid;
  border-bottom: 2px #cce3ff solid;
  border-right: 2px #cce3ff solid;
}

Note that the colors used here are not browser-safe colors. No big deal, really.

Home || Send email