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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:28:00+00:00 2026-05-31T02:28:00+00:00

I am dealing with some HTML text that I basically have read access to.

  • 0

I am dealing with some HTML text that I basically have read access to. I can change things with CSS, but the actual layout of the HTML is static. I am using several hundred instances of the same type of HTML that is laid out like the following:

<div class = 'outer'>
     <span class = 'inner'>5</span> 
     Some other random text that is formatted according to the style of the outer class.    
</div>

For the purposes of the project I am working on, all of the text that I am displaying within the outer class (with the exception of the contents of the inner span) needs to justified. But the contents of the inner span need to be anchored to the start of the line. My current problem is that because all of the text is being justified, the inner span content is being pushed out to different places on the line because the text is all different.

So is there a way to have the inner span ignore the fact that the outer class is telling it to be justified? How might I go abut solving this issue?

enter image description here

I would be fine with the way 6 & 7 look as well as the way 8 & 9 look, just as long as it is consistent.

EDIT: CSS

.outer {
 padding-left:10px;
 padding-right:10px;
 font-family:palatino;
 font-size:17px;
 -webkit-column-count: 2;
 -webkit-column-gap: 20px;
 -webkit-column-rule: solid 1px #999;
 border-bottom: solid 1px #999;
 text-align:justify;
 }

And then I realized I often times don’t have a class set to the SPAN, so I tried to do what the answer below suggested to do like this:

.outer span{
 display:inline-block;
 width:10px;
}//But it still isn't fixing the issue of the left side alignment
  • 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-05-31T02:28:01+00:00Added an answer on May 31, 2026 at 2:28 am

    If I understand the situation correctly, you have short paragraphs starting with a number, and the paragraphs are to be rendered as justified on both sides, but the space between the number and the first word should not be stretched. Moreover, it seems that the paragraphs start with a no-break space; otherwise I cannot understand why they start with varying-width space in the screenshot.

    I don’t think there’s any CSS solution. The CSS properties for justification are rather simple, not letting you control which spaces get adjusted (even as per CSS 3 Text).

    There’s a character-level solution, though, but with some risks. Instead of no-break spaces (which are treated as non-stretchable by some browsers, but not by all, and the trend seems to treat them as normal spaces except for line-breaking), use fixed-width spaces. This may however fail on IE 6, depending on font; see my notes on Unicode spaces.

    You could specify that the number be surrounded by an unstretchable en space, thereby directing all stretching of spaces to other spaces on the line, by starting a paragraph as follows:

     <div class = 'outer'>
     &ensp;5&ensp;Text of the paragraph.
     </div>
    

    The en space, being 0.5em wide, might be too wide. The four-per-em space (0.25em wide) corresponds to a typical width of a normal space when unstretched (though this depends on the font). To use it, replace &ensp; by &#x2005; or by the actual U+2005 character, if using UTF-8 encoding.

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

Sidebar

Related Questions

I have some text content (read in from the HTML using jQuery) that looks
I am dealing with a webpage that has multiple forms..some basic HTML forms and
I have an existing application that has some parts of formatted text-blocks (standard formats
Can someone show me some html to layout the following not using tables? ______________________________________
I've written a little application that does some text manipulation and writes the output
Can anyone suggest some good browser add-on tools/extensions to help with development? I have
I need to read a HTML file and search for some tags in it.
I'm creating a simple game using HTML and CSS. I have a background image
I need to read some content from a html page. I've tested simple_html_dom ,
i have a problem and I can't understand what is happening. I'm dealing with

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.