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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:43:10+00:00 2026-06-08T17:43:10+00:00

Looking at this demo , you will see that all browsers, except Opera, position

  • 0

Looking at this demo, you will see that all browsers, except Opera, position the icon on the middle line of letter ‘A’, but Opera positions it slightly higher and over the line. The difference is not much noticeable here, but in some other cases it is.

What may be the reason for this behavior, and how may it be fixed?

  • 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-08T17:43:13+00:00Added an answer on June 8, 2026 at 5:43 pm

    Explanation

    It seems that, although Opera is currently handling fine with either inline-block vertical alignment or line-height definitions for pseudo elements (see reference tests for the former and the later to compare the rendering across UAs), the differentiation lies within the sizing definitions of replaced elements;

    As can be seen by examining a striped down demo on different browsers, solely having a replaced element (generated be the pseudo element’s content URL value) affects the layout such as the replaced element’s dimensions are added to the containing elements’ (in Opera). This results in the bizarre side effect you’re witnessing as, for now, the spec leaves it for the UA’s interpretation to decide how to treat those dimensions:

    Note. This specification does not fully define the interaction of
    :before and :after with replaced elements (such as IMG in HTML). This
    will be defined in more detail in a future specification.

    Suggested Solution

    Sidestep the issue to avoid tackling undefined behaviors, and use a more standard method of positioning pseudo elements; utilize absolute positioning:

    CSS

    .icon {
        /* absolute positioning - parent container */
        position: relative;
        /* layer adjustments for the background image */
        z-index: 1;
        padding-left: 24px;
    }
    .icon:before {
        content: '';
        /* absolute positioning - child element */
        position: absolute;
        /* layer adjustments for the background image */
        z-index: -1;
        display: block;
        width: 24px;
        height: 24px;
        /* vertically align */
        top: 50%;
        left: 0;
        /* compensate for vertical offset due to element's own height */
        margin-top: -12px;
        background-image: url('http://utdallas.docutek.com/eres/images/icon_arrow.gif');
    }
    

    Live Demo

    • The updated jsFiddle

    References

    • Generated content – :before and :after pseudo elements on W3C.
    • Visual formatting model on W3C.
    • vertical-align on Mozilla Developer Network.
    • display on Mozilla Developer Network.

    Further Reading

    • CSS background image hacks by Nicolas Gallagher.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Menu works in all major browsers but it's looking different in IE7. See screen
Looking at this jQuery example, how can I modify the code so that it
I'am looking for this file to work with Android ADK Demo. This Link INSTALL_FAILED_MISSING_SHARED_LIBRARY
I'm looking at some demo code that shows how to use a Fragment Adapter
I'm looking for the code or even a visual demo on how this tree
I'm looking at this Telerik demo, and am unable to get the count statement
I tried looking this up on here but couldnt find a proper answer. I
Looking at this article: http://www.galloway.me.uk/tutorials/singleton-classes/ I have implemented a singleton, my question is the
looking at this example of the jquery ui slider http://jqueryui.com/demos/slider/#steps i want to be
Looking in this StackOverflow question it uses the following to send emails: System.Net.Mail.SmtpClient Is

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.