Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CSS Positioning

Featured Replies

http://www.robmarchant.co.uk/about_me.html

 

I'm trying to place a div (upcoming gigs box) so that it sits perfectly underneath the image.

 

It looks fine it IE7:

 

29wn394.jpg

 

But it's out of line in IE6:

 

fuoqxe.jpg

 

Does anybody know why this is happening? Surely there must some code that makes it look the same on both browsers??

 

At the moment I'm using "px" to determine the div's position - I've also tried using "%" but the same problem occurs.

 

CSS:

 

body{

background-image: url("images/clouds.jpg");

background-repeat: no-repeat;

text-align:center;

}

 

#center{

margin:0 auto;

width:851px;

}

 

.title{

width:851px;

margin-top:15px;

text-align:left;

}

 

.main_links{

margin-top:15px;

font-size:12pt;

font-family:century gothic;

text-align:center;

background-color:white;

width:851px;

border:1px solid #1b4e78;

padding-bottom:8Px; padding-top:8Px;

}

 

.main_body{

margin-top:15px;

width:851px;

font-size:12pt;

font-family:century gothic;

}

 

.main_body_html{

margin-top:15px;

padding-bottom:20px; padding-top:20px;

border:1px solid #1b4e78;

text-align:center;

background-color:white;

width:851px;

font-size:12pt;

font-family:century gothic;

}

 

.tracklist{

font-size:11pt;

font-family:century gothic;

}

 

.download{

margin-top:15px;

text-align:center;

width:851px;

font-size:12pt;

font-family:century gothic;

background-color:white;

margin-bottom:10px;

border:1px solid #1b4e78;

padding-bottom:8Px; padding-top:8Px;

}

 

.main_body_about_me{

margin-top:15px;

width:851px; padding-left:15px; padding-right:15px; padding-top:15px; padding-bottom:15px;

font-size:10pt;

font-family:century gothic;

background-color:white;

border:1px solid #1b4e78;

text-align:left;

}

 

.main_body_about_me2{

position:absolute; left:865px; top:540px;

width:300px;

font-size:10pt;

font-family:century gothic;

background-color:white;

text-align:left;

}

 

.main_body_mix_archive{

margin-top:15px;

font-size:12pt;

font-family:century gothic;

background-color:white;

text-align:center;

width:851px;

border:1px solid #1b4e78;

}

 

a:link{

color:#1b4e78;

}

 

a:visited{

color:#1b4e78;

}

 

-------------------------------------------------------------------------------------------------------

 

HTML:

 

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

 

<html xmlns="http://www.w3.org/1999/xhtml" >

 

<head>

<title>Rob Marchant - DJ / About Me</title>

<meta name="Author" content="Rob Marchant" />

<meta name="Keywords" content="Rob Marchant, DJ, house music, mixes, DJ mixes, download, music, electro, funky, ibiza, london" />

<meta name="Description" content="A site about DJ Rob Marchant" />

<link href="stylesheet.css" rel="stylesheet" type="text/css"/>

<style type="text/css"></style>

</head>

 

<body>

 

<div id="center">

 

<div class="title">

<p><img src="images/title.jpg" alt="title"/></p>

</div>

 

<div class="main_links">

<a href="index.html">HOME</a>     

<a href="about_me.html">ABOUT ME</a>     

<a href="mix_archive.html">MIX ARCHIVE</a>     

</div>

 

<div class="main_body_about_me">

<img src="images/rob5.jpg" alt="rob" style="float:right";/>Rob has been DJ'ing for over 10 years, 5 of which have been spent building his reputation in residencies over Europe. He bought his first record at 15 and before he was even old enough to legally drink he was offered a residency in mainland Spain. In 2002 his hunger to play in front of bigger and better crowds drew him to the only place to be, Ibiza. He struggled initially but with persistance he was offered a residency at one of the main bars in San Antonio, Koppas.<br /><br />Since then he has played at some of the biggest clubs in the world, including Space, Ministry of Sound, Es Paradis and Eden. His vast experience has helped to develop a unique style of mixing and the ability to fuse progression into his sets.<br /><br /><b>VENUE'S PLAYED AT INCLUDE:</b><br /><br />Space - Ibiza (Good Fridays)<br />Eden - Ibiza (Judgement Sundays, Dave Pearce's Dance Anthems, Worker's Parties)<br />Es Paradis - Ibiza (Dusted, Opening Party)<br />Ministry of Sound - London (Subliminal Sessions, Delirium, Sander K, Rulin)<br />Egg - London (Immaculate Touch)<br />Pacha - London (Gliteratti, DirtyDubbin)<br />Turnmills - London (Innuendo)<br />The Cross - London (Space, Random)<br />The Golden Jubilee Boat - London (Electronic Sessions)<br />Babalou - London (Tanuki)<br />Raduno - London (DirtyDubbin)<br />Koppas - Ibiza<br />Plastik - Ibiza<br />Savannah - Ibiza<br />Jokers - Benidorm<br />Pacha - Benidorm<br />Colloseum - London (Immaculate Touch)<br />Studio 33 - London (Highlife, Immaculate Touch)<br />Foundation - Newcastle (Shindig, Wise Buddha)<br />Inigo - London (Licked)<br />The Chapel Bar - London<br />The Charterhouse - London (Coordinated)<br />The Telegraph - London (Dopamine)<br />20's Reunion - Skegness

 

<div class="main_body_about_me2">

<b>UPCOMING GIGS:</b><br /><br />The Gallery @ Ministry of Sound - 20th June<br />Licked's Birthday @ Apothecary - 4th July<br />Westfest 2008 @ Royal Bath and West Showground - 25th October<br /><br /><b>CONTACT ME</b><br /><br />Tel: 07743126703<br />Email: <a href="mailto:robm2002@hotmail.com">robm2002@hotmail.com</a><br /><br /><b>OTHER SITES</b><br /><br /><a href="http://www.mixdepot.net/robmarchant">Mixdepot Page</a><br /><a href="http://www.facebook.com/group.php?gid=21308715397">Facebook Group</a><br /><a href="http://www.dontstayin.com/members/robmarchant">DontStayIn Profile</a>

</div>

 

</div>

 

</div>

 

</div>

 

</body>

 

</html>

 

-------------------------------------------------------------------------------------------------------

 

Can anyone help?

Hi, could you post your html as well?

And some more of your css?

A live link would be better.

  • Author
Hi, could you post your html as well?

And some more of your css?

A live link would be better.

 

Edited, cheers. :D

i can tell without even looking at the code, your container is smaller than the things inside it. IE6 is respecting the width you gave the outer container while the other browsers are just pushing it out.

 

it should line up with the top header

 

*EDIT* You need to account for your padding you have the correct width but when you add padding you need to subtract that from the overall width of your div's

 

width:851px; padding-left:15px; padding-right:15px; padding-top:15px; padding-bottom:15px;

Should be

width:821px; padding-left:15px; padding-right:15px; padding-top:15px; padding-bottom:15px;

 

padding add's to the width and height of the div

(was just the first one I saw.. there could be more)

  • Author
i can tell without even looking at the code, your container is smaller than the things inside it. IE6 is respecting the width you gave the outer container while the other browsers are just pushing it out.

 

it should line up with the top header

 

*EDIT* You need to account for your padding you have the correct width but when you add padding you need to subtract that from the overall width of your div's

 

width:851px; padding-left:15px; padding-right:15px; padding-top:15px; padding-bottom:15px;

Should be

width:821px; padding-left:15px; padding-right:15px; padding-top:15px; padding-bottom:15px;

 

padding add's to the width and height of the div

(was just the first one I saw.. there could be more)

 

So what exactly is it I need to change in order to get the div to line up with the image??

Why don't you make .main_body_about_me and .main_body_about_me2 two separate divs instead of nesting one inside the other?

Put the image and the Upcoming Gigs inside one and the rest of the content inside the other.

Float one left and one right with widths of 70% and 30% or use specific pixel measurements if it's a fixed width site.

So what exactly is it I need to change in order to get the div to line up with the image??

 

I put what you need to change up there already.

 

 

here it is with the whole class

 

.main_body_about_me{
margin-top:15px;
width:821px; padding-left:15px; padding-right:15px; padding-top:15px; padding-bottom:15px;
font-size:10pt;
font-family:century gothic;
background-color:white;
border:1px solid #1b4e78;
text-align:left;
}

 

and for the "td" i guess you could put a margin on the side to push it over more like if 10px is not enough change it higher. not 100% sure if it will work or not so back up your file before you do it

 

<td valign="top" align="left">
<img src="images/rob5.jpg" alt="rob"/><br /><br /><b><div style="margin-left:10px">UPCOMING GIGS:</b><br /><br />The Gallery @ Ministry of Sound - 20th June<br />Licked's Birthday @ Apothecary - 4th July<br />Westfest 2008 @ Royal Bath and West Showground - 25th October<br /><br /><b>CONTACT ME</b><br /><br />Tel: 07743126703<br />Email: <a href="mailto:robm2002@hotmail.com">robm2002@hotmail.com</a><br /><br /><b>OTHER SITES</b><br /><br /><a href="http://www.mixdepot.net/robmarchant">Mixdepot Page</a><br /><a href="http://www.facebook.com/group.php?gid=21308715397">Facebook Group</a><br /><a href="http://www.dontstayin.com/members/robmarchant">DontStayIn Profile</a></div>
</td>

  • Author
Why don't you make .main_body_about_me and .main_body_about_me2 two separate divs instead of nesting one inside the other?

Put the image and the Upcoming Gigs inside one and the rest of the content inside the other.

Float one left and one right with widths of 70% and 30% or use specific pixel measurements if it's a fixed width site.

 

I can't do that because I still want border that .main_body_about_me gives, if I didn't nest the second div it wouldn't happen.

  • Author

I've now changed my CSS to this:

 

body{
 background-image: url("images/clouds.jpg");
 background-repeat: no-repeat;
 text-align:center;
}

#center{
margin:0 auto;
width:851px;
}

.title{
width:851px;
margin-top:15px;
text-align:left;
}

.main_links{
margin-top:15px;
font-size:12pt;
font-family:century gothic;
text-align:center;
background-color:white;
width:851px;
border:1px solid #1b4e78;
padding-bottom:8px; padding-top:8px;
}

.main_body{
margin-top:15px;
width:851px;
font-size:12pt;
font-family:century gothic;
}

.main_body_html{
margin-top:15px;
padding-bottom:20px; padding-top:20px;
border:1px solid #1b4e78;
text-align:center;
background-color:white;
width:851px;
font-size:12pt;
font-family:century gothic;
}

.tracklist{
font-size:11pt;
font-family:century gothic;
}

.download{
margin-top:15px;
text-align:center;
width:851px;
font-size:12pt;
font-family:century gothic;
background-color:white;
margin-bottom:10px;
border:1px solid #1b4e78;
padding-bottom:8px; padding-top:8px;
}

.main_body_about_me{
margin-top:15px;
width:821px; padding-left:15px; padding-right:15px; padding-top:15px; padding-bottom:15px;
font-size:10pt;
font-family:century gothic;
background-color:white;
border:1px solid #1b4e78;
text-align:left;
}

.main_body_about_me2{
position:relative; left:63%; bottom:46%;
height:0px;
width:280px;
font-size:10pt;
font-family:century gothic;
background-color:white;
text-align:left;
}

.main_body_mix_archive{
margin-top:15px;
font-size:12pt;
font-family:century gothic;
background-color:white;
text-align:center;
width:851px;
border:1px solid #1b4e78;
}

a:link{
color:#1b4e78;
}

a:visited{
color:#1b4e78;
}

 

Changed the second div's positioning to relative so that it doesn't move around when I change the browser's window size, and used % instead of PX.

 

Again, in IE7 it's perfect:

 

24l5szo.jpg

 

But in IE6 it's now completely ****ed, the first "about_me" div even extends further down the page for some reason.

 

2j4qyvl.jpg

 

I know I probably sound extremely stupid, but can someone please give me step-by-step guide on what I have to do to fix this problem.

 

All I want is for it to look exactly the same on both IE7 and IE6.

absolute positioning? tut tut tut.

 

It would be alot easier to use the flow of the document:

 

<div id="content" style="width: 800px; margin: 0 auto;">
<div id="left" style="width:70%; float:left;">
content
</div>
<div id="right" style="width:30%; float: right;">
<div id="pic">
<img src="whatever" />
</div>
<div id="upcoming_gigs">
etc etc
</div>
</div>

  • Author
absolute positioning? tut tut tut.

 

It would be alot easier to use the flow of the document:

 

<div id="content" style="width: 800px; margin: 0 auto;">
<div id="left" style="width:70%; float:left;">
content
</div>
<div id="right" style="width:30%; float: right;">
<div id="pic">
<img src="whatever" />
</div>
<div id="upcoming_gigs">
etc etc
</div>
</div>

 

I'll give that a go when I'm home later.

 

Cheers ^_^

Why dont you just post the DIV syntax for the one whhich is going wrong...

Also if you try using the Draw DIV layer in DW it should work, remember the position:absolute; attribute is what makes it stay put!

 

Niel

http://www.Hangar-77.com

  • 2 weeks later...

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.