Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 290377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:59:31+00:00 2026-05-12T05:59:31+00:00

I found this article and I decided that I liked the way they styled

  • 0

I found this article and I decided that I liked the way they styled links and buttons.
So I took the CSS from the article…

.buttons a, .buttons button{
    display:block;
    float:left;
    margin:0 7px 0 0;
    background-color:#f5f5f5;
    border:1px solid #dedede;
    border-top:1px solid #eee;
    border-left:1px solid #eee;

    font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
    font-size:100%;
    line-height:130%;
    text-decoration:none;
    font-weight:bold;
    color:#565656;
    cursor:pointer;
    padding:5px 10px 6px 7px; /* Links */
}
.buttons button{
    width:auto;
    overflow:visible;
    padding:4px 10px 3px 7px; /* IE6 */
}
.buttons button[type]{
    padding:5px 10px 5px 7px; /* Firefox */
    line-height:17px; /* Safari */
}
*:first-child+html button[type]{
    padding:4px 10px 3px 7px; /* IE7 */
}
.buttons button img, .buttons a img{
    margin:0 3px -3px 0 !important;
    padding:0;
    border:none;
    width:16px;
    height:16px;
}

Then I have several buttons in a row I want to use like this…

<div class="buttons">
    <a href="/password/reset/"><img src="pict1.png" class="positive" alt=""/>Button 1</a>
    <a href="/password/reset/"><img src="pict2.png" alt=""/>Button 2</a>
    <a href="/password/reset/"><img src="pict3.png" class="negative" alt=""/>Button 3</a>
</div>

See this example: http://reljac.com/csstest.php

But that row of buttons may need to be aligned center, not all to the right or left. If I change the CSS to…

.buttons a, .buttons button{
    /*display:block;
    float:left;*/
    margin:0 7px 0 0;

The buttons no longer appear correctly when there is an image, specifically in IE 6,7 & 8.

See this example: http://reljac.com/csstest_wo.php

I can change the float to right to get the buttons to align right but I can’t figure out what to do to get them centered (like in a <td></td>).

So the short of it is I want to use the style as it is but I also need to be able to center justify the buttons if necessary.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:59:32+00:00Added an answer on May 12, 2026 at 5:59 am

    Try adding this to the CSS:

    .buttons
    {
        text-align:center;
        margin: 0px auto 0px auto;
    }
    

    The auto makes the margins equal on each side. The text-align is a bodge for older browsers.

    EDIT:

    Add an extra div around the buttons called buttonwrapper. then apply this CSS

    .buttonwrapper
    {
        position:relative;
        float:left;
        left:50%;
    }
    
    .buttons
    {
        position:relative;
        float:left;
        left:-50%;
    }
    

    Method taken (but not tested) from http://www.pmob.co.uk/temp/centred-float4.htm

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've found this MSDN article that explains how to monitor processes and services with
I found this in an article on Multithreaded Apartments, but can’t find a definition
I read This article and i found it interesting. To sum it up for
I've found an article on this subject by a Microsoft employee, but has anyone
I found this open-source library that I want to use in my Java application.
Reading this question I found this as (note the quotation marks) code to solve
I found this link http://artis.imag.fr/~Xavier.Decoret/resources/glsl-mode/ , but there isn't a lot of description around
Just found this out, so i am answering my own question :) Use a
I found this guide for using the flash parameters, thought it might be useful
I found this PECL package called threads , but there is not a release

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.