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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:23:33+00:00 2026-06-17T13:23:33+00:00

The problem we’re trying to solve is that text is overflowing past the end

  • 0

The problem we’re trying to solve is that text is overflowing past the end of a <p>. It seems to be the result of its contents, which include a relatively-positions <a> element, with an absolute-positioned <span> element within it, which has padding. Firefox wraps the text as I would normally expect.

Here’s an abstraction of my HTML:

<p>
    In this second example, 
    <a href="#">
        <span class="icon"><img src="play.gif"></span>
        mo
    </a> 
    muh...
</p>

And an abstraction of the CSS, as simplified as I think still makes sense:

a {
    padding: 5px;
}
a span.icon {
    position: absolute;
    display: block;
    width: 15px;
    height: 15px;
}

Here’s a screenshot of the problem (the highlighting is Chrome’s element inspector with the <p> element highlighted). You can see the word immediately overflowing at the end of the <p>:

Any pointers in the right direction appreciated.

  • 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-17T13:23:35+00:00Added an answer on June 17, 2026 at 1:23 pm

    Instead of using absolute positioning, try using display:inline or display:inline-block (if you need to set height/width – Note: not supported in IE 7 and lower).

    You could drop the display all together, because images and spans are inline to start with. I have an example here removing the span and just styling the image and surrounding link.

    You could also use the image as a background for the button, and set the padding to account for the space. Example:

    .button{
      background: url(img/buttonIcon.png) no-repeat; /* 15x15 icon */
      padding: 0 0 0 15px;
    }
    

    example

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

Sidebar

Related Questions

Problem: Get a date inside of a JSONP response that looks like 2012-11-11T04:27:25Z (which
Problem: I have a large Visual C++ project that I'm trying to migrate to
Problem I have an Excel worksheet with a column of text which is data,
Problem: Trying to create a Mix that is applied to the AVPlayerItem, but it
Problem I am trying to deploy a worker role which will autoscale a few
Problem: I have a table that prints out vertical but I would like it
Problem: I am trying to build a recursive tree using a function and data
Problem occured when i tried to display xml data that has been taken by
Problem I'm trying to build a minimal example where I create a many-to-many relationship
Problem I used an empty statement and am aware of that. So how can

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.