SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2009
    Location
    A city equidistant from two coasts of India.
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Show a Div just below another Div with cross browser compatibility

    I have two Div sections as below:

    Code HTML4Strict:
    <body>
    <Form>
      <div id="divMain" style="top:40px">
     
      </div>
     
      <div id="divFooter" style="top:550px">
     
      </div>
    </Form>
    </body>

    If I use- position:absolute for both Divs, they render well on IE, but on firefox, the footer Div renders on the base-line of the Main div.

    Even if I use Top, the pixel difference between two browsers disturbs rendering.

    Is there any way to render the Divs same in both browsers?

  2. #2
    SitePoint Wizard donboe's Avatar
    Join Date
    Jun 2010
    Location
    Netherlands
    Posts
    2,096
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi for a starter is it not a good idea to use inline styles. Can you give an example of what you would like to reach? I would never use an absolute divs there are different ways to have those div's line up correctly.
    “Good artists copy, great artists steal” (Pablo Picasso - 1934)

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2009
    Location
    A city equidistant from two coasts of India.
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want to display both Divs just one below the other. I have given the code, what else example you want?

  4. #4
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    That's default behaviour for a div, so you don't need any styling at all, unless you have specified all divs to have margins elsewhere.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •