[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

css - button style

Posted on 2011-04-29
2
Medium Priority
?
376 Views
Last Modified: 2012-06-21
On my page the button hover & active state don't line up with the original button.
Look at the Start Shopping button on this page:
http://66.147.244.225/~minimosa/?showCart=1&sw=

What css do I need to change in the current code listed below?

 
/*link buttons*/
.shopform_btn a, .cartActionBtn {display:block;background:url(images/buy_now.png) no-repeat top left;text-indent:-9999em;}
.add_to_enquire_alt a {width:129px;background:url(images/add_inquiry_alt.png) no-repeat top left;}
.add_to_cart_alt a {width:129px;background:url(images/add_to_cart_alt.png) no-repeat top left;}
.buy_now_alt a {width:129px;background:url(images/buy_now_alt.png) no-repeat top left;}
.get_now {display:block;width:32px;height:32px;background:url(images/get_now.png) no-repeat top left;text-indent:-9999em;}
.add_to_wishlist_inactive a {background:url(images/add_to_wishlist_inactive.png) no-repeat top left;}
.start_shop {width:100px;background:url(images/start_shopping.png) no-repeat top left;}
.cont_shop {float:left;margin-right:10px;width:130px;background:url(images/continue_shopping.png) no-repeat top left;}
.cont_shop {float:left;margin-right:10px;width:130px;background:url(images/continue_shopping.png) no-repeat top left;}
.shopform_btn a:hover, .shopform_btn a:focus, .start_shop:hover, .start_shop:focus, .cont_shop:focus, .cont_shop:hover, .update_cart:focus, .update_cart:hover, .next_step:hover, .next_step:focus {background-position: 0 -20px;}
.shopform_btn a:active, .start_shop:active, .cont_shop:active, .update_cart:active, .next_step:active {background-position: 0 -60px;}

/*input buttons*/
.shopform_btn input{margin:0;padding:0;float:right;}
.shopform_btn:hover input, .shopform_btn:focus input {margin-top:0px;}
.shopform_btn:active input {margin-top:-60px;}

Open in new window

0
Comment
Question by:carolsanjose
2 Comments
 
LVL 13

Accepted Solution

by:
jonahzona earned 2000 total points
ID: 35494494
Right now you have

.shopform_btn a:hover, .shopform_btn a:focus, .start_shop:hover, .start_shop:focus, .cont_shop:focus, .cont_shop:hover, .update_cart:focus, .update_cart:hover, .next_step:hover, .next_step:focus {
    background-position: 0 -20px;
}

Open in new window


Make it

.shopform_btn a:hover, .shopform_btn a:focus, .start_shop:hover, .start_shop:focus, .cont_shop:focus, .cont_shop:hover, .update_cart:focus, .update_cart:hover, .next_step:hover, .next_step:focus {
    background-position: 0 -60px;
}

Open in new window


And you are good. The background position realignment was off for the hover event.
0
 

Author Closing Comment

by:carolsanjose
ID: 35494533
I love it when answers are quick & work right away!!!

THank you.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses
Course of the Month18 days, 16 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question