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 8059071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:33:16+00:00 2026-06-05T09:33:16+00:00

I have created an image to illustrate my problem: As you can see. I

  • 0

I have created an image to illustrate my problem:

enter image description here

As you can see. I have a large rounded button. it consists of 3 images. One image is on the right side, another on the left size and another one in the middle.

The left and right images are quite wide because there is a gradient going on in the button so I cannot make them just 5px wide. The problem now is, that the text inside is limited to the middle area. I would like it to stretch across the entire button.

Here are my styles:

#index-navigation ul li a {
    height: 96px;
    line-height: 96px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1em;
    color: #333;
    background: url('/images/btn_grey@2x-right.png') right center no-repeat;
    padding-right: 100px;
}
#index-navigation ul li a span.left {
    background: url('/images/btn_grey@2x-left.png') left center no-repeat;
    padding-left: 100px;
}
#index-navigation ul li a span.middle {
    background: url('/images/btn_grey@2x-middle.png') left center repeat-x;
}

How to edit the style to be able to have the anchor take the entire width of the button? Like this:

enter image description here

  • 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-05T09:33:18+00:00Added an answer on June 5, 2026 at 9:33 am

    You have to move your text to a separate span to be able to stretch it across the whole a. Just give your .left and .right the appropriate backgrounds, let the a hold the main bg – http://jsfiddle.net/JutRB/3/

    a {
        height: 96px;
        width: 350px;
        text-decoration: none;
        font-weight: bold;
        font-size: 1em;
        color: #333;
        background: beige;
        border: 2px solid #000;
        display: inline-block;
        position: relative;
    }
    
    a span.left, a span.right {
        float: left;
        background: yellow;
        height: 96px;
        width: 100px;
        display: inline-block;
    }
    
    a span.right {
        float: right;
        background: pink;
    }
    
    a span.text {
        position: absolute;
        display: block;
        text-align: center;
        top: 30px;
        width: 100%;
    }
    ​
    

    UPDATE

    Or if you want a CSS3 solution and don’t care about the older IE-s then you can use the :before and :after pseudo-elements with much cleaner markup – http://jsfiddle.net/JutRB/4/

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

Sidebar

Related Questions

i have created one image but problem is that when i save image from
I have problem with dynamically created image (JavaScript). I want to change the innerHTML
I have created a page with a static image positioned to the ride side
I have created a image crop facility that I can click on an image
I have created an image by copying a number of images into a new
I have created a simple JSF image browsing app, and I'm having a problem
I have created one sample application.For capture image using camera.It is working fine.After capture
I have created an image map with flash, I have separate button functions that
I have created jquery image slider and it is working good. However i have
I have created a XML image gallery, which displays text in between each slide.

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.