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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:01:26+00:00 2026-06-10T15:01:26+00:00

I am having problem with margin-top in ie7 if i use position fixed in

  • 0

I am having problem with margin-top in ie7 if i use position fixed in css.

I searched in web for a solution and tried many but nothing worked.

margin-top for the test div is not working.

Any help would be appreciated.

Here is my html

<!DOCTYPE html>
<html lang="en">
<head>
<title> test </title>
<link rel="stylesheet" href="test.css">

<!--[if IE 7]><link rel="stylesheet" href="ie7.css" type="text/css" media="screen"/><![endif]-->



</head>

<body>
<div id="fixed1">
<div id="fixed"></div>
</div>


<div id="test">
ayhd iaudiuawdyiaudyw
</div>
<div class="clear">
</div>

</body>
</html>

Here is my css

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote,
pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, 
q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, 
form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
margin : 0;
padding : 0;
border : 0;
outline : 0;
font-weight : inherit;
font-style : inherit;
font-size : 100%;
font-family : inherit;
vertical-align : baseline;}
:focus {
outline : 0;
}
body {
line-height : 1;
color : black;
background : white;
}
ol, ul {
list-style : none;
}
table {
border-collapse : separate;
border-spacing : 0;
}
caption, th, td {
text-align : left;
font-weight : normal;
}


#fixed1 {
position : fixed;
width : 100%;
top : 0;
background-color : red;
}
#fixed {
margin : 0 auto;
height : 20px;
background-color : blue;
width : 980px;
}
#test {
margin : 0 auto;
margin-top : 20px;
margin-bottom : 20px;
height : 2000px;
width : 980px;
background-color : red;
}

Here is ie7.css

#fixed1{
left:0px;
}

#test{
margin-top:30px;
background-color:grey;
}

Thank U,
Kishore.

  • 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-10T15:01:28+00:00Added an answer on June 10, 2026 at 3:01 pm

    Check this fiddle. I have added your code in fiddle. It works for ie 7 also http://jsfiddle.net/S9AVa/1/

    Problem was because of margin specified in 2 ways, margin : 0 auto; and again margin-top and margin-bottom. IE considers the first call.

    It should be like

    #test {
    margin : 20px auto 20px auto;
    float:left;
     height : 2000px;
    width : 1040px;
    background-color : red;
    }
    

    and I have added left:0; to fixed1 class.

    Updated demo http://jsfiddle.net/S9AVa/2/

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

Sidebar

Related Questions

Hi I'm having some problem with css to IE7 I want to put some
I'm having a problem, which already searched the internet but can not solve. I
i am having the strangest problem with jQuery animate when i use marginTop it
I'm having a problem with IE7 displaying a table (don't worry it's used for
I'm having a problem with setting the height of <div> tags using CSS. I'm
I'm having a very strange problem with css3 border radius property. My following CSS
I'm trying to build a layout for a blog-like application having: a fixed-position fixed-width
I am having a problem with my web page, because I have a wrapper
My goal is to use CSS ONLY for some tooltips. I like the solution
I'm having a really really weird problem with a web app I'm programming. Basically,

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.