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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:25:27+00:00 2026-05-16T22:25:27+00:00

Given the following HTML: <p> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed

  • 0

Given the following HTML:

<p>
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore
</p>

And the following CSS:

p {
  border: 1px solid red;
  width: 200px;
  text-align: right;
  white-space: nowrap; 
}

What would the expected rendering be? I was expecting the text to butt up against the right hand side of the para and overflow off to the left. Observed results in Fx/Safari/Opera butt the text to the left and overflow to the right though. The same problem is observed with text-align:center; I’d expect the text to overflow equally to both sides.

CSS2.1 and CSS3 Text don’t seem to specify the rendering.

Test link: http://www.webdevout.net/test?0e&raw

  • 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-16T22:25:27+00:00Added an answer on May 16, 2026 at 10:25 pm

    The “Inline Formatting Context” section of the CSS 2.1 spec says:

    When the total width of the inline
    boxes on a line is less than the width
    of the line box containing them, their
    horizontal distribution within the
    line box is determined by the
    ‘text-align’ property. If that
    property has the value ‘justify’, the
    user agent may stretch spaces and
    words in inline boxes (except for
    inline-table and inline-block boxes)
    as well.

    When an inline box exceeds the width
    of a line box, it is split into
    several boxes and these boxes are
    distributed across several line boxes.
    If an inline box cannot be split
    (e.g., if the inline box contains a
    single character, or language specific
    word breaking rules disallow a break
    within the inline box, or if the
    inline box is affected by a
    white-space value of nowrap or pre),
    then the inline box overflows the line
    box.

    So, the text-align property is only used in cases where the line box length is less than the block width. If the line box is wider than its containing element then the text-align property isn’t considered.

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

Sidebar

Related Questions

Given the following HTML: <select name=my_dropdown id=my_dropdown> <option value=1>displayed text 1</option> </select> How do
Given the following HTML <b>demo</b> I want to save it to an SQL 2005
Given the following html: <tr> <td>Content</td> <td>Content</td> <td>Content</td> <td><img id=imgProductPurchased runat=server visible=true alt=Product Purchased
Given the following html table and script shown below I am having a problem
Given the following HTML <div style=width: 500px; height: 500px; border: 1px solid red;> <div
Given the following HTML form: <form id=myform> Company: <input type=text name=Company value=ACME, INC./> First
Given the following HTML <div classmyclass>10</div> <div classmyclass>25</div> <div classmyclass>50</div> <div classmyclass>20</div> I want
Given the following HTML example... <div id='div1'>div one</div> <div id='div2'>div two</div> ...I found that
Given the following javascript: function foo(selectControl) { ... } and the following html: <select
Why is there a reported difference in element heights given the following html? <span

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.