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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:38:09+00:00 2026-06-05T16:38:09+00:00

Today I have had a problem with hiding text with text-indent: -9999px rule. I

  • 0

Today I have had a problem with hiding text with text-indent: -9999px rule. I realized that it was caused by some parent element which has had text-align: right. Example on jsfiddle. Setting text-indent to positive value of 9999px did not work as well.

I have managed to hide text by setting it’s text-align to the left, but I do not understand why such problem occurred.

Could someone explain why text-indenting does not work while text-align is set to the right?

Fiddle with ids:
http://jsfiddle.net/sNbfv/2/

  • 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-05T16:38:10+00:00Added an answer on June 5, 2026 at 4:38 pm

    It seems that maintaining the alignment is more important to the browser, so the right edge of the text is kept to the right side, no matter what.

    The document is set to the ltr direction, so the indent is applied to the left of the line, but since you’ve said you want it to align to the right, the browser disregards the indent entirely. I have no explanation as to why this happens, other than early browsers setting a precedence of justification importance. There is nothing in the CSS spec as far as text-align explicitly ignoring text-indent.

    The box is indented with respect to the left (or right, for
    right-to-left layout) edge of the line box. User agents must render
    this indentation as blank space.

    http://www.w3.org/TR/CSS2/text.html#propdef-text-indent

    If we update the fiddle to have an rtl direction, the indent indeed affects the right side of the text. I’ve added a border to show that the overflow is happening.

    http://jsfiddle.net/sNbfv/3/

    .rtl{direction:rtl;}
    .parent { text-align: right; border:1px solid blue}
    .indented { text-indent: -9999px; }
    
    <div class="rtl">
        <div class="parent">
            <div class="indented">
                Lorem ipsum ipsum!
            </div>
        </div>
    
        <div class="indented">
            Cupcake ipsum!
        </div>
    </div>
    

    The simple solution seems to be aligning that nested indent to text-align:left.

    http://jsfiddle.net/sNbfv/4/

    .parent { text-align: right; border:1px solid blue}
    .indented { text-indent: -9999px; }
    .parent .indented{ text-align:left; }
    
    <div class="parent">
        <div class="indented">
            Lorem ipsum ipsum!
        </div>
    </div>
    
    <div class="indented">
        Cupcake ipsum!
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I realized today that I have blindly just followed this requirement for years without
Hi everyone my problem today is I have a couple of buttons that slide
Today I have a bit of a problem. I have an ajax script that
I had some help today with a need and this is what I have
I have never had a problem starting a new app, but today I got
Today I had a problem with some routing in my ASP.NET MVC 3 application
I just discovered this problem today, and I had no idea what caused this
I have a big problem. I had a configuration which worked properly till today.
Today we have a windows application that, using an OCX, creates a web page
Today I have noticed that the order in which the $lt and $gt operators

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.