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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:18:03+00:00 2026-06-08T06:18:03+00:00

I have an A tag button with Span inside to hold icons. It works

  • 0

I have an A tag button with Span inside to hold icons. It works well in all browsers. WHen I apply float:right to shift Span to the right side it also works fine in all browsers (Firefox, IE8+, etc.) except IE7 (I know… but I need to fix it).

 <a href="#"><span>&nbsp;</span>Link</a> 

So, IE7 works fine when SPAN is floated left. However, once it is floated right it stretches the A tag container 100%.

I do not wish to change the structure of HTML, i.e. insert another span to handle IE7 only or move SPAN right of text, but I do want to fix it with CSS though what I tried did not work well for me yet.

Test case: http://jsfiddle.net/QeQSQ/1/ (IE7 works OK when SPAN is on left side)

Test case: http://jsfiddle.net/QeQSQ/2/ (IE7 does NOT work because SPAN is on right side and container is stretching)

  • 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-08T06:18:04+00:00Added an answer on June 8, 2026 at 6:18 am

    Position it absolutely instead (example):

    a{
        display:inline-block;
        border:1px solid red;
        height:auto;
        width:auto;
        padding:5px;
        position:relative;
        padding-right:1em;
    }
    a span{
        position:absolute;
        right:0;
        display:block;
        height:14px;
        width:15px;
    
    }
    

    Or, another [better] solution would be to add the character via :before and :after pseudo-elements (example):

    <a href="#" class="site">Link</a>
    <a href="#" class="account">Link</a>
    
    a{
        display:inline-block;
        border:1px solid red;
        height:auto;
        width:auto;
        padding:5px;
    }
    a.site:before {
        content:"» ";
    }
    a.account:after {
        content:" »";
    }
    

    Note: This doesn’t work in IE7 at all (no additional text appears), but it also doesn’t introduce any bugs.

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

Sidebar

Related Questions

I have a button tag with two spans inside; <button><span><span id=buttonText>Save</span></span></button> I'm trying to
I have a javascript code that have span tag and inside the span tag
I have an Asp.Net button and a span tag which I have image for
I have an anchor tag <a> inside a <span> tag. I have applied CSS
I have an anchor tag <a class=next>next</a> made into a button. Sometimes, this tag
I have a standardised rounded-corners button following the format like <a href=#><span>button name</span></a> (Example:Anchor
I have this HTML tag: <span id=pricea runat=server>13323223</span> and I am changing this value
I have two elements (a button and an anchor tag) both with a dynamical
I have a HTML radio button inside a repeater. I'm facing two problems: When
I have a Span tag containing a IMG tag and another Span tag. I

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.