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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:33:20+00:00 2026-05-11T20:33:20+00:00

I am having trouble positioning a (div) element at the top right of a

  • 0

I am having trouble positioning a (div) element at the top right of a span. It works in FF3, but not in IE7:

<html>
<head>
<style>
body
{
    font-size: 24px;
}

.tag
{
    padding: 3px;
    background-color: lightblue;
    position: relative;
}

.x
{
    position: absolute;
    top: 0px;
    right: 0px;
    width: 10px;
    height: 10px;
    background-color: orange;
}
</style>
</head>
<body>
text <span class="tag">tag<div class="x"></div></span> text 
</body>
</html>

In FF3, a 10×10 orange box is rendered at the top right corner of the light blue box. I am having trouble getting this to work in IE7. Thanks!

  • 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-11T20:33:20+00:00Added an answer on May 11, 2026 at 8:33 pm

    First, get a proper doctype for your page so that it’s not rendered in quirks mode.

    W3C: Recommended list of DTDs

    Second, make sure that the code is valid. You can not put a block element (div) inside an inline element (span).

    W3C markup validation

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

Sidebar

Related Questions

I am using a jqgrid but am having trouble positioning to a specific page.
Having trouble with an .htaccess file on WAMP. Works on the live server, but
Having trouble getting the following code to work. Calling swapLevel() directly works fine, but
I'm having trouble properly positioning some divs within a larger div and having them
I'm having trouble with the browser compatible div positioning. I'm doing an image map
I'm having trouble displaying a overlay div saying Please wait... on top of a
I'm having some trouble positioning the Google +1 button on my website. The div
I am having troubles for positioning a span with the watermark text on top
I'm having some trouble with the positioning in an android listview, the next activity
Having trouble accessing javascript code in a mixed html/js ajax response. jQuery ajax doc

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.