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

  • SEARCH
  • Home
  • 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 8589217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:59:58+00:00 2026-06-11T22:59:58+00:00

I have several buttons that have variable width and I would like them to

  • 0

I have several buttons that have variable width and I would like them to all be a certain width. When I attempted to add width: 150px; it doesn’t work. How do I create these buttons that will all have a set width?

Here is a Fiddle and here is the code:

HTML

<p><a class="dark_button 150px-width" href="#">Lorem</a></p>
<p><a class="dark_button 150px-width" href="#">Lorum Ipsum</a></p>
<p><a class="dark_button 150px-width" href="#">Lorum Ipsum dolor</a></p>
<p><a class="dark_button 150px-width" href="#">Lorum Ipsum dolor sit amet</a></p>

CSS

.dark_button{
  border-top: 1px solid #969696;
  background: #000000;
  background: -webkit-gradient(linear, left top, left bottom, from(#545454), to(#000000));
  background: -webkit-linear-gradient(top, #545454, #000000);
  background: -moz-linear-gradient(top, #545454, #000000);
  background: -ms-linear-gradient(top, #545454, #000000);
  background: -o-linear-gradient(top, #545454, #000000);
  padding: 5px 10px;
  -webkit-border-radius: 8px;
  -moz-border-radius: 8px;
  border-radius: 8px;
  -webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
  -moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
  box-shadow: rgba(0,0,0,1) 0 1px 0;
  text-shadow: rgba(0,0,0,.4) 0 1px 0;
  color: #e3e3e3 !important;
  font-size: 14px;
  text-decoration: none;
  vertical-align: middle;
}
.dark_button:hover {
  border-top-color: #4f4f4f;
  background: #4f4f4f;
  color: #ccc;
  text-decoration:none;
}
.dark_button:active {
  border-top-color: #4a4a4a;
  background: #4a4a4a;
}

.150px-width{
 width: 150px;
}
  • 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-06-11T23:00:00+00:00Added an answer on June 11, 2026 at 11:00 pm

    Couple issues:

    1. The a element is an inline element, meaning you cannot give it an explicit width.
    2. Classes cannot begin with a number.

    You’ll neeed to set your display property to something like block or inline-block to have it respect your wishes with regards to width. Additionally, use a classname like width-150px instead, which solves problem number 2 above.

    Fiddle: http://jsfiddle.net/yQu8H/5/

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

Sidebar

Related Questions

I have several radio buttons that are dynamically populated on a form and I
I have several HTML elements (buttons) that fire the same JQuery AJAX request. When
I have several buttons on my app that are being created dynamically. They are
In my application I have several activities, the main screen has 4 buttons that
I have a HTML form where I use several buttons. The problem is that
i have a page that contains several submit buttons however i only want one
I have designed a menu that consists of a few buttons in several different
What I want to do is have several radio buttons all on a different
I have several UIView subclasses (buttons, labels, etc.) that follow the following setup pattern.
I have a sliding div and several buttons that will trigger the animation at

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.