Jump to content

how to put in a text into a button


tra

Recommended Posts

Thanks for your reply. Here is an example

<div class="button" style="background:url and then the image </div>

 

I would like to know how do I put text inside this image which is a grey button to say home for example..........

 

and also make it a rollover button so that when someone clicks on it..........it takes them to the page or section that it is supposed to

 

 

For a mouseover it's best to apply all styling directly on the link as Internet explorer does not support the CSS :hover pseudo class on anything but a link.

 

So basically it's something like:

.menu a { 
  background:  #cecece url( images/normalstate.png ); 
  line-height: 22pt; 
  font-size: 10pt; 
}
.menu a:hover {
  background: #333 url( images/mouseover.png );
  color: white;
}

<ul class='menu'>
  <li><a href='/'>Home</a></li>
</ul>

 

You can play around a bit with it on the w3schools example page

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.