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

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.