Div positioning - need help

Discussion in 'HTML & Website Design' started by Longy909, Nov 14, 2008.

  1. #1
    I'm currently in the middle of making a website for my friend for his clan, and I've almost finished coding the main layout, but I need help with positioning for 2 divs that simply won't look right on IE.

    On firefox, the divs are located exactly where I want them to be, but on IE they are in the wrong place. Any help would be awesome, thanks.

    http://www.longynet.com/kor/index.php
    http://www.longynet.com/kor/style.css
     
    Longy909, Nov 14, 2008 IP
  2. jagan123

    jagan123 Active Member

    Messages:
    775
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    85
    #2
    IE sucks..!! Thtz all i can say.
    You need to add few extra lines of code to make that appear well in IE.
    Me too waiting for someone to help :D
     
    jagan123, Nov 14, 2008 IP
  3. greenbaret

    greenbaret Peon

    Messages:
    24
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    is it any IE BuG ?
     
    greenbaret, Nov 14, 2008 IP
  4. Hades

    Hades Well-Known Member

    Messages:
    1,873
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    150
    #4
    Uhm.. I am slightly confused as to why you would chose to code it like that at all?

    You could have just as easily done:

    <h2>Latest News</h2> and <h2>Latest Matches</h2>

    h2 { background:url(images/thewholebannerimage.gif) no-repeat; /* I would probably use repeat on this, but it's up to you. it's a bit more complciated if you use repeat but smaller file size */
    font:normal 1em/2.833em Arial, Helvetica, Sans Serif; /* 1em in this case is 12px */
    color:#fff; 
    height:/*height of the banner image */;
    width:/* width of the banner image */;
    /* and use margins or positions or whatever to move it. you just made it really complicated */}
    Code (markup):
    This isn't exact, but play with it. It's soo much easier than doing what you did.

    Also, what is up with having margin:0 and padding:0 on like every style? body already has margin:0; and padding:0; meaning you don't have to put it on anything else unless it's inherited from something else.

    Regards,
    Nick
     
    Hades, Nov 14, 2008 IP
  5. Longy909

    Longy909 Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hmm, I can't seem to get the <h2> tags to work the way I want. The reason I did it that way is becuase they have to overlap each other, and it's the only way I could think of doing it.

    Is there a way of doing this with Divs?
     
    Longy909, Nov 14, 2008 IP
  6. Hades

    Hades Well-Known Member

    Messages:
    1,873
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    150
    #6
    position relative on the big part. Position absolute on the h2. top:-5px; left:-10px; approximately of course. That will make it overlap.

    It would be the same with divs instead of h2's.
     
    Hades, Nov 14, 2008 IP
  7. bryanfilm

    bryanfilm Peon

    Messages:
    101
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    what version of IE are you having problems with for your web design?
     
    bryanfilm, Nov 14, 2008 IP
  8. Longy909

    Longy909 Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Ie7 (7.0.5730.13)
     
    Longy909, Nov 14, 2008 IP
  9. Hades

    Hades Well-Known Member

    Messages:
    1,873
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    150
    #9
    Here:
    
    * {
    	margin:0;
    	padding:0;
    }
    h2 {
    	background:url(header.png) no-repeat;
    	font:normal 12px/54px Arial, Helvetica, sans-serif;
    	color:#FFF;
    	position:absolute;
    	top:-5px;
    	left:-5px;
    	height:34px;
    	width:365px;
    	padding:0 5px;
    }
    #news {
    	background:url(midcontenttop.png) no-repeat;
    	width:375px;
    	height:165px;
    	margin:22px 0 0 47px;
    	position:relative;
    }
    #matches {
    	background:url(midcontentbottom.png) no-repeat;
    	width:375px;
    	height:165px;
    	margin:20px 0 0 47px;
    	position:relative;
    }
    
    Code (markup):

    <div id="news">
    	<h2>Latest News</h2>
    </div>
    
    <div id="matches">
    	<h2>Latest Matches</h2>
    </div>
    HTML:

    If you know how to combine the css, you should. Since a lot is repeated in there.

    Regards,
    Nick
     
    Hades, Nov 14, 2008 IP
  10. cipals15

    cipals15 Well-Known Member

    Messages:
    1,085
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    100
    #10
    My current website project is working on Google Chrome, Firefox and Opera but when i tried it IE it doesn't look like what i've coded.

    One of the <div> element had overlapped the other <div> element. Hmmm... Something strange, i searched through various forums but couldn't find one.

    Update: This is in relation Longy's website being displayed abnormally on IE.
     
    cipals15, Nov 14, 2008 IP
  11. Hades

    Hades Well-Known Member

    Messages:
    1,873
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    150
    #11
    Longy909 is actually trying to overlap here. Cipals15 you should make your own thread on this.

    YIPKP,
    Nick
     
    Hades, Nov 14, 2008 IP
  12. Longy909

    Longy909 Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    That code works great for Internet explorer, but on Firefox there is a gap that shouldn't be there.
     
    Longy909, Nov 14, 2008 IP
  13. Longy909

    Longy909 Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Never mind, I fixed it by adding a margin: 0px; on to the <h2> stylesheet.
    Thank you very much for your help.
     
    Longy909, Nov 14, 2008 IP
  14. Hades

    Hades Well-Known Member

    Messages:
    1,873
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    150
    #14
    no problem.
     
    Hades, Nov 14, 2008 IP
  15. thefandango

    thefandango Active Member

    Messages:
    787
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #15
    SIgh...tables were so simple...
     
    thefandango, Nov 15, 2008 IP