Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Strange Positioning of Divs
Old 02-16-2008, 07:43 PM Strange Positioning of Divs
Ultra Talker

Posts: 316
Trades: 0
I have two divs on my page that are giving me greif.

One with the style 'bottom' applied to it and the other with 'top-right'.

The 'top-right' is ok in Firefox but in IE I would like it flush against the side of the div it is in. It is high lighted in yellow on this page in the top right corne:
http://www.jfwebdesign.co.uk/photog/work.php

The CSS is as follows:
Code:
.top-right {
    margin: 0px;
    padding-right: 3px;
    background-color: yellow;
    float: right;
    text-align: right;
    width: 14%;
}
The second offending div has the style called 'bottom'. It is coloured red so you can see it. On two pages it is at the top and on the third it is further down, I would like it at the bottom outside of all the other divs/containers.

Here is it style:
Code:
.bottom {
    margin: 0px;
    padding: 0px;
    background-color: red;
    border: 0px solid #999999;
    height: 20px;
    width: 100%;
}
If you look at the html you will see it is outside of the other divs but it is being placed inside them.

Can anyone help?

Thanks.
Joe3000 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-16-2008, 09:19 PM Re: Strange Positioning of Divs
blue-dreamer's Avatar
King Spam Talker

Posts: 1,222
Location: Middle England
Trades: 0
The first thing to do is add a valid DOCTYPE to your page - do this and troubleshooting will be a lot easier!
blue-dreamer is offline
Reply With Quote
View Public Profile
 
Old 02-17-2008, 03:21 AM Re: Strange Positioning of Divs
Junior Talker

Posts: 3
Name: Aleksey Melnikov
Trades: 0
Put this to the very first line of your HTML code:

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

Please login or register to view this content. Registration is FREE
melnikoff is offline
Reply With Quote
View Public Profile Visit melnikoff's homepage!
 
Old 02-17-2008, 06:24 AM Re: Strange Positioning of Divs
Ultra Talker

Posts: 316
Trades: 0
Thanks. Pages now start like this:
HTML Code:
<?php include('rotator.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
Joe3000 is offline
Reply With Quote
View Public Profile
 
Old 02-17-2008, 06:27 AM Re: Strange Positioning of Divs
Ultra Talker

Posts: 316
Trades: 0
Which has fixed the top-right div issue.


There is no button to edit threads in Firefox.
Joe3000 is offline
Reply With Quote
View Public Profile
 
Old 02-17-2008, 06:40 AM Re: Strange Positioning of Divs
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
There is no button to edit threads in Firefox.
Bottom right of post alongside the "quote" button, but you do have a limited time where you can edit your own posts, should be longer than 3 minutes though.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-17-2008, 06:47 AM Re: Strange Positioning of Divs
Ultra Talker

Posts: 316
Trades: 0
I don't even have the option to quote or do a new post. I can only post in the Quick Reply box.
Joe3000 is offline
Reply With Quote
View Public Profile
 
Old 02-17-2008, 07:27 AM Re: Strange Positioning of Divs
Gilligan's Avatar
Website Designer

Posts: 1,670
Name: Stefan
Location: London, UK
Trades: 0
Why is this line in the code?

Code:
.bottom {
    margin: 0px;
    padding: 0px;
    background-color: red;
    border: 0px solid #999999;
    height: 20px;
    width: 100%;
}
Your basically saying you want NO border to have a color of #999999.
Gilligan is offline
Reply With Quote
View Public Profile
 
Old 02-17-2008, 07:45 AM Re: Strange Positioning of Divs
Ultra Talker

Posts: 316
Trades: 0
Because when I am changing the sizes of divs to adjust the layout I like to be able to turn on the border easily by changing the zero to a one.

This helps me see the size, shape and position of the div if the background color has not been set.

Without this I would have to guess what size and position the div actually is. Guessing can be time consuming and can lead to problems further down the line.
Joe3000 is offline
Reply With Quote
View Public Profile
 
Old 02-21-2008, 05:46 PM Re: Strange Positioning of Divs
Ultra Talker

Posts: 316
Trades: 0
Right, I've added the doctype and its still not working.

The DIV with the red background should be at the very bottom of the page, under the large DIV.

This is the HTML placing it on the page:
HTML Code:
  <!-- InstanceEndEditable --></div>
<div class="bottom">bottom</div>
</body>
You can see it is the last DIV on the page.

Yes I am using Dreamweaver templates.

Here is the CSS for the bottom class:
Code:
.bottom {
 margin: 0px;
 padding: 0px;
 background-color: red;
 border: 0px solid #999999;
 height: 20px;
 width: 100%;
}
It appres in different places on different pages.

'bottom' DIV at the top of the page:
http://www.jfwebdesign.co.uk/photog/

'bottom' DIV almost at the bottom of the page:
http://www.jfwebdesign.co.uk/photog/about.php
'bottom' DIV at the top of the page:
http://www.jfwebdesign.co.uk/photog/work.php

'bottom' DIV at the top of the page:
http://www.jfwebdesign.co.uk/photog/contact.php

Here is a link to the CSS file:
http://www.jfwebdesign.co.uk/photog/styles.css

Can anyone explain why?

Many thanks.
Joe3000 is offline
Reply With Quote
View Public Profile
 
Old 02-21-2008, 09:07 PM Re: Strange Positioning of Divs
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Get rid of the position:absolute on the CONTENT div and the bottom div should go where you want it - below "content". As it is, you have taken 'content' completely out of the document flow, so the bottom div goes to the top - ignoring "content' completely - which is what happens when you use positioning that way.

After you get rid of the position:absolute on .content, set the margin on .content to margin: 0 auto; to center it.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 02-21-2008, 09:15 PM Re: Strange Positioning of Divs
Banned

Posts: 57
Name: Amir Mullick
Location: USA, New York---Born in India
Trades: 0
The first thing to do is add a valid DOCTYPE to your page - do this and troubleshooting will be a lot easier!
Amirmullick3 is offline
Reply With Quote
View Public Profile Visit Amirmullick3's homepage!
 
Old 02-22-2008, 04:50 AM Re: Strange Positioning of Divs
Ultra Talker

Posts: 316
Trades: 0
Quote:
Originally Posted by LadynRed View Post
Get rid of the position:absolute on the CONTENT div and the bottom div should go where you want it - below "content". As it is, you have taken 'content' completely out of the document flow, so the bottom div goes to the top - ignoring "content' completely - which is what happens when you use positioning that way.

After you get rid of the position:absolute on .content, set the margin on .content to margin: 0 auto; to center it.

Thank you very much. It now appears to working fine.

Just the bottom DIV on the 'about' page is positioned inside the content DIV.
Joe3000 is offline
Reply With Quote
View Public Profile
 
Old 02-22-2008, 10:04 AM Re: Strange Positioning of Divs
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
Just the bottom DIV on the 'about' page is positioned inside the content DIV.
Sounds like you might be missing the a closing </div> for content.

This validation warning confirms it:
line 17 column 1 - Warning: missing </div>
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 02-22-2008, 10:19 AM Re: Strange Positioning of Divs
Ultra Talker

Posts: 316
Trades: 0
Excellent.

Thank you very much.
Joe3000 is offline
Reply With Quote
View Public Profile
 
Old 02-22-2008, 02:48 PM Re: Strange Positioning of Divs
Ultra Talker

Posts: 316
Trades: 0
I can't get the container div to contain the text-col divs.

I want all the other divs apart from bottom to go inside it.

Any ideas?

Thanks.
Joe3000 is offline
Reply With Quote
View Public Profile
 
Old 02-22-2008, 08:09 PM Re: Strange Positioning of Divs
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
You have to clear the floats of those floated columns. The clear:both on the footer isn't doing it.

Add this to your CSS:

.brclear{
clear:both;
height:0;
margin:0;
font-size: 1px;
line-height: 0;
}

Add this <br class="brclear" /> after the closing </div> of the 3 column area.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 02-23-2008, 08:15 AM Re: Strange Positioning of Divs
Ultra Talker

Posts: 316
Trades: 0
Thanks. Worked perfectly.
Joe3000 is offline
Reply With Quote
View Public Profile
 
Old 02-23-2008, 10:40 AM Re: Strange Positioning of Divs
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Excellent
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Strange Positioning of Divs
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.59433 seconds with 12 queries