Solved

Button CSS formatting

Posted on 2010-08-18
18
290 Views
Last Modified: 2012-05-10
please go to http://pickyourquote.com/

halfway down the page there is a "Create Account" button which is created using the following:
<div class="clearfix button-link"><a href="http://pickyourquote.com/signup" class="big-button"><span>Create Account</span></a></div>

now this looks fine on all browsers.

When you go to http://pickyourquote.com/jobs/new however, there is a button link down the bottom which does not look right in Firefox or Safari, the font looks a bit weird compared to the "Create Account" button and also there is a weird white spacing.
Code for the button is: <div class="clearfix button-link"><button class="big-button" type="submit"><span>Continue</span></button>

CSS code is attached

How do I get the <button> to look exactly the same as the <a>?
a.big-button, button.big-button {
background-position: right -30px;
color:#FFF;
float:left;
font-size:14px;
height:34px;
font-weight:700;
margin-right:6px;
padding:0 13px 0 0;
text-decoration:none;
}

a.big-button span, button.big-button span {
float:left;
background-position: left -30px;
line-height:14px;
padding:10px 0 10px 13px;
}

button.big-button, button.big-button span  {
border: 0;
cursor: pointer;
float: right;
}

a.big-button:hover, button.big-button:hover{
background-position: right -64px;
}

a.big-button:hover span, button.big-button:hover span {
background-position: left -64px;
}

Open in new window

0
Comment
Question by:hubfub
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 4
  • 3
  • +1
18 Comments
 
LVL 1

Expert Comment

by:coldfusionwebdev
ID: 33471051
Change the html to this:
<button type="submit" class="big-button" style="padding:0 8px 0 0;"><span style="margin-top:-3px;">Continue</span></button>
0
 
LVL 1

Author Comment

by:hubfub
ID: 33471072
that worked, but not it's not aligned properly anymore in Chrome or IE

Also, this hasnt addressed the fact that the font still looks really weird compared to the <a> tag

Is there some sort of default formatting that the <button> tag has that I have to get rid of with css?
0
 
LVL 1

Expert Comment

by:coldfusionwebdev
ID: 33471673
How about change the html to this:
<a href="#" class="big-button" type="submit"><span id="continueButton">Continue</span></a>

And, add this javascript at the top of the html file to use jQuery to submit the form when this "button/link" is clicked like this:

<script type="text/javascript">

 $(document).ready(function() {
    $('#continueButton').click(function() {
       $('#new_job').submit();
    });
});        
</script>

0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 1

Author Comment

by:hubfub
ID: 33471832
I would prefer to just use a button tag if possible - is there to no way to change the formatting of the <button> itself?
0
 
LVL 7

Expert Comment

by:jhp333
ID: 33472377
Try adding "font-family:Arial;"

a.big-button, button.big-button {
font-family:Arial;
...
...
}
0
 
LVL 1

Author Comment

by:hubfub
ID: 33472419
ok that has 50% fixed it

now the font looks right but the spacing is still weird only on firefox and safari.. works fine in chrome and IE... what the?
0
 
LVL 4

Expert Comment

by:Morrisproject
ID: 33472973
Looks fine in FF to me now
0
 
LVL 1

Author Comment

by:hubfub
ID: 33474035
What? no on  http://pickyourquote.com/jobs/new

there is still a gap in the <button> tag
0
 
LVL 4

Expert Comment

by:Morrisproject
ID: 33476053
right.

under this section:
a.big-button, button.big-button
change the background-position to: right -28px
change height to: 36px
change padding to: 0 10px 0 0;

done, viola
0
 
LVL 4

Expert Comment

by:Morrisproject
ID: 33476065
or copy this ::

a.big-button, button.big-button {
background-position:right -28px;
color:#FFFFFF;
float:left;
font-family:Arial,Helvetica,sans-serif;
font-size:14px;
font-weight:700;
height:36px;
line-height:14px;
margin-right:6px;
padding:0 10px 0 0;
text-decoration:none;
}
0
 
LVL 1

Author Comment

by:hubfub
ID: 33480872
Thanks, I have made the changes and it looks fine in FF

BUT not it does not work correctly in Chrome or IE

Do I need to to have a seperate CSS file for Chrome and IE to change the spacings?

why are the browsers treating this so differently?
0
 
LVL 7

Accepted Solution

by:
jhp333 earned 250 total points
ID: 33481834
When you push a button on a web browser, you see some effect that represents the button is being pushed. Each browser's effect is slightly different from each other. That's why they handle the background image (of the span) differently.
The method you used in your web page to show graphical button is not standard. It show left part of the button image with <span> and right part with <button> or <a>, so that the same image can be used for various width of buttons.
0
 
LVL 1

Author Comment

by:hubfub
ID: 33482162
is there a way to fix this with css?
0
 
LVL 7

Expert Comment

by:jhp333
ID: 33482179
"Do I need to to have a separate CSS file for Chrome and IE to change the spacings?"
Yes. I think so.
0
 
LVL 1

Author Comment

by:hubfub
ID: 33482197
How do i create a statement for a special CSS file for chrome? I know how to do it for IE
0
 
LVL 1

Assisted Solution

by:coldfusionwebdev
coldfusionwebdev earned 250 total points
ID: 33482261
0
 
LVL 1

Author Closing Comment

by:hubfub
ID: 33491168
not solved completely
0
 
LVL 4

Expert Comment

by:Morrisproject
ID: 33497167
Did I not solve this?
0

Featured Post

Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Set css in function 11 56
Javascript image manipulationcrop-image 7 41
Displaying Text in Columns in HTML 3 32
Checkbox changes display when resizing window 8 26
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This video teaches users how to migrate an existing Wordpress website to a new domain.

739 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