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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:16:16+00:00 2026-06-17T22:16:16+00:00

Possible Duplicate: Add link icon that breaks with last word? When text is too

  • 0

Possible Duplicate:
Add link icon that breaks with last word?

When text is too long for a container I would like to break the last word onto a new line rather then just the background image that appears after it.

Here is an iamge of the issue:Text not breaking with the background-image.

I would like the word “too.” to break to the next line along with the background-image.

Here is the HTML:

<ul>
    <li><a href="#" class="myIcon">The name of some link goes here</a></li>
    <li><a href="#" class="myIcon">The name of some link goes here too.</a></li>
    <li><a href="#" class="myIcon">Here is yet another link that could be used</a></li>
    <li><a href="#" class="myIcon">This could be a really long link that one could try to use also</a></li>
    <li><a href="#">The name of some link goes here.</a></li>
    <li><a href="#">The name of some link goes here.</a></li>
    <li><a href="#">The name of some link goes here.</a></li>
</ul>

Here is the CSS:

.myIcon:after {
    height: 16px;
    width: 16px;
    display:inline-block;
    content:'';
    background-image: url("/wps/themes/html/3M.com/images/ui-icons_000000_256x240.png");
    vertical-align:middle;
}
  • 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-17T22:16:17+00:00Added an answer on June 17, 2026 at 10:16 pm

    Unfortunately I think to ensure that this works across browsers you will have to wrap the last word in a span and then apply the icon to the span.

    <li><a href="#">This could be a really long link that one could try to use <span class="myIcon">also</span></a></li>
    

    CSS:

    .myIcon {
        display:inline-block;
        background: url("/wps/themes/html/3M.com/images/ui-icons_000000_256x240.png") no-repeat center right;
        padding-right:16px;
        white-space:nowrap;
        text-decoration:underline;
    }
    

    Example is here

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

Sidebar

Related Questions

Possible Duplicate: How to add number of days to today’s date? I would like
Possible Duplicate: Confusing add command in x86 assembly I would like to understand these
Possible Duplicate: How to add to an NSDictionary When I do that : NSDictionary
Possible Duplicate: how do I add windows phone system colors to icon using expression
Possible Duplicate: VB.NET RemoveHandler & Anonymous Methods If I add an event handler like
Possible Duplicate: Should I Dispose() DataSet and DataTable? OP comment: I would like to
Possible Duplicate: how to add linebreak in iPhone notification alert message or plain text
Possible Duplicate: Cannot add an entity with a key that is already in use
Possible Duplicate: How to Add an icon to an ubuntu app I am trying
Possible Duplicate: How do I add a class to a given element? I'd like

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.