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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:10:08+00:00 2026-05-14T07:10:08+00:00

I am new in CSS so please help me in this problem. I hope

  • 0

I am new in CSS so please help me in this problem. I hope to describe it wright.

I am making div named content where my site content is. I made it with z-index:-1; so an image to be over this div. But in Chrome, FF and safari, content became inactive. I cant select text , click on link and write in the forms. So I tried with positive states in the z-index but IE don’t know what this means. Damn. So I decided to make conditional div. Here is the code:

.content
{
    background:#FFF;
    width:990px;
    position:relative;
    float:left;
    top:50px;
}
.content_IE
{
    background:#FFF;
    width:990px;
    position:relative;
    float:left;
    top: 50px;
    z-index:-1;
}

and here is the HTML:

<!--[if IE 7]>
    <div class="content_IE" style="height:750px;">
        <![endif]-->
            <div class="content" style="height:550px;">

Everything is fine with the z-index but the problem is that if there is no top in .content class everything looks fine in IE but there is no space in the other browsers. If i put back the top:50px; there onother 50px like padding in the .content_IE class. I mean that the page looks like I’ve put top:50px; and padding-top=50px;. I’ve try everything like margin-top:-50px; padding-top:-50px; and stuff like this but I am still in the circle. It look fine only if there is no top option in .content class. Please help.

  • 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-14T07:10:09+00:00Added an answer on May 14, 2026 at 7:10 am

    The problem is that the two divs aren’t mutually exclusive – IE’s seeing both of your .content and .content_IE divs, and the positioning that you’re trying to set is being governed by the interior .content div (because both have position: relative applied to them). Try removing the .content div from your code and look at it in IE, you’ll likely see the same issues you’re having in the other browsers. (For more information, this article covers positioning pretty well)

    (this is perhaps a bit verbose, but it provides some reasonable strategies for preventing this sort of issue in the future):

    There are a few things going on here: IE-specific handling, and z-index issues.

    First, a few style/strategy recommendations:

    1. Don’t use inline styles (the height you’re setting on the .content and .content_IE classes), this makes even less sense since you’re setting other style properties (like width) through the CSS. The only reason I can see for doing this (and even then I’d still recommend against it) is if you’re doing something with Javascript.
    2. For the IE-specific declarations, a better approach is to set up your styles so that you can take care of the Cascade – set the base styles (height, width, etc) on the .content class, and then apply a few IE specific rules (like the different height). It would look something like this:

      <style>
          .content {
              background: #fff;
              height: 550px;
              width: 990px;
              position: relative;
              float: left;
              top: 50px;
          }
      </style>
      <!--[if IE 7]>
      <style>
          .content {
              height: 750px;
          }
      </style>
      <![endif]-->
      

    That way you should experience a) less potential weirdness, and b) an easier time maintaining your code. If your stylesheets are large enough, break up the rules in to two (like “main.css” and “ie7.css”, and link to the IE one from inside of the conditional comment.

    Now, as far as the z-index issue goes – I would recommend applying the z-index on the image that you’re trying to place ‘on top’ of the content, and use a positive value. This should prevent some of what I believe you’re seeing happen in IE (IE tends to have issues with negative values in general, so try to avoid them if you can).

    If that fixes the problem, keep working with your code so that you don’t need the conditional CSS, too.

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

Sidebar

Related Questions

Still having issues with this problem. Please help if you can. So I am
First off, I apologize if this doesn't make sense. I'm new to XHTML, CSS
New to javascript/jquery and having a hard time with using this or $(this) to
I've already posted this problem but i didn't manage to resolve the issue from
I am new to CSS, I found an layout online, but I have a
I am sort of new to the whole html and css scene! All I
New class is a subclass of the original object It needs to be php4
New to xml. Looking for XPath to search a xml file with python ElementTree
New to silverlight. Traditionally if I were to design a wizard-like process where a
New to both Ruby and Rails but I'm book educated by now (which apparently

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.