The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Web Design
    4. Text-align: -900% in an absolute element?

    Text-align: -900% in an absolute element?

    Web Design
    14 3 1.6k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Getz.pro
      Getz.pro @ldestrooper last edited by

      why are you using absolute position on the image? if you want to move it around the div, use padding.

      1 Reply Last reply Reply Quote 0
      • ldestrooper
        ldestrooper @ldestrooper last edited by

        I'm not trying to. Using text-indent on the text and then using an image-background on the div is a common way of image replacement.

        1 Reply Last reply Reply Quote 0
        • Getz.pro
          Getz.pro @ldestrooper last edited by

          Yes, I understand that 🙂

          But why then are you using absolute positioning?

          Oh, and you are doing a text-indent at -9999px correct?

          .swap-image {

          text-indent: -9999px;

          background:url(path-to-image) top left no-repeat;

          min-height: 40px;

          }

          1 Reply Last reply Reply Quote 0
          • ldestrooper
            ldestrooper @ldestrooper last edited by

            That looks pretty much like i did it. It always works, just not for the absolute element. It is because it is a share box for facebook, twitter, etc. I've seen many options to make it go with the browser but obviously positioning it absolute is the best way.

            It seems so hard to find a solution for this 😞

            1 Reply Last reply Reply Quote 0
            • Getz.pro
              Getz.pro @ldestrooper last edited by

              Let's start over. Why do you want an absolute position on this element? It should be positioned at the point where the text starts.

              1 Reply Last reply Reply Quote 0
              • ldestrooper
                ldestrooper @ldestrooper last edited by

                I'll give you the example, this is my test website:

                http://www.computerworkstationdeskguide.com

                I run my theme there to make sure i get everything right before publishing to my main one. If you go to a single post, you'll notice the sidebar on the left. That's where the problem lies. It shows nice verywhere, but in IE (and maybe not just in IE, i don't know) it still shows the text.

                1 Reply Last reply Reply Quote 0
                • Getz.pro
                  Getz.pro @ldestrooper last edited by

                  *** Again, sorry about the late response. I am moving, so please don't expect anything back until Thursday night ***

                  Please provide the CSS snippet for this. I see you are running a WP and have a few CSS files. I do not have time to search all of them to find the corresponding code.

                  I will look at this and get back to you.

                  1 Reply Last reply Reply Quote 0
                  • ldestrooper
                    ldestrooper @ldestrooper last edited by

                    No problem at all, thanks for the help! This is the exact same as i use:

                    • Text 1

                    • Text 2

                    #box {

                    width: 70px;

                    position: fixed;

                    }

                    #socialshare {

                    position: absolute;

                    }

                    #socialshare a {

                    display: block;

                    width: 50px;

                    height: 65px;

                    text-indent: -900%;

                    background: url('image.png') no-repeat;

                    }

                    1 Reply Last reply Reply Quote 0
                    • Getz.pro
                      Getz.pro @ldestrooper last edited by

                      You are not going to like this, but your code work in Safari and Firefox.

                      try using -900px instead of -900**%**

                      I also removed the position: fixed and position: absolute. What are you doing with these? I do not see where they are needed.

                      1 Reply Last reply Reply Quote 0
                      • ldestrooper
                        ldestrooper @ldestrooper last edited by

                        I use fixed and absolute so the box won't move when i scroll my browser.

                        I also tested in Safari and Firefox and works just fine, it's IE which is bugging me. 😞

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        • How important is anchor text in your sitemap?
                          WebMarkets
                          WebMarkets
                          0
                          3
                          100

                        • Organization name as text vs. as a picture with alt text + Schema.org markup
                          BlueprintMarketing
                          BlueprintMarketing
                          1
                          6
                          587

                        • Relative or Absolute???
                          LynnPatchett
                          LynnPatchett
                          0
                          2
                          350

                        • Hi, I have a doubt. If we want to hide unwanted text in a web page its possible with "" tag. And my question "does a search engine crawl those text? help me.
                          TotalMarketExposure
                          TotalMarketExposure
                          0
                          9
                          334

                        • Can you use a base element and mod_rewrite to alleviate the need for absolute URLs?
                          0
                          1
                          146

                        • Can google crawl text in jquery sliders?
                          TheLangleyGroup
                          TheLangleyGroup
                          0
                          6
                          2.6k

                        • How does the toolbar caclulate text to code ratio?
                          AaronWheeler
                          AaronWheeler
                          0
                          7
                          2.7k

                        • Whats your Favorite font for text
                          Getz.pro
                          Getz.pro
                          0
                          5
                          1.3k

                        Get started with Moz Pro!

                        Unlock the power of advanced SEO tools and data-driven insights.

                        Start my free trial
                        Products
                        • Moz Pro
                        • Moz Local
                        • Moz API
                        • Moz Data
                        • STAT
                        • Product Updates
                        Moz Solutions
                        • SMB Solutions
                        • Agency Solutions
                        • Enterprise Solutions
                        • Digital Marketers
                        Free SEO Tools
                        • Domain Authority Checker
                        • Link Explorer
                        • Keyword Explorer
                        • Competitive Research
                        • Brand Authority Checker
                        • Local Citation Checker
                        • MozBar Extension
                        • MozCast
                        Resources
                        • Blog
                        • SEO Learning Center
                        • Help Hub
                        • Beginner's Guide to SEO
                        • How-to Guides
                        • Moz Academy
                        • API Docs
                        About Moz
                        • About
                        • Team
                        • Careers
                        • Contact
                        Why Moz
                        • Case Studies
                        • Testimonials
                        Get Involved
                        • Become an Affiliate
                        • MozCon
                        • Webinars
                        • Practical Marketer Series
                        • MozPod
                        Connect with us

                        Contact the Help team

                        Join our newsletter
                        Moz logo
                        © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                        • Accessibility
                        • Terms of Use
                        • Privacy