Div overflows... |
Author: |
Message: |
jren207
Senior Member
JR! - We <3 Fanta
Posts: 870 Reputation: 28
35 / / –
Joined: Sep 2003
|
O.P. Div overflows...
I'm working on a new website design and i'm using mainly Div's. When I view a page i'm working on (screenshot), in Firefox, the Div inside seems to overflow out of the Div that it's inside. In IE, it perfectly overflows. Can anyone specifiy any CSS I can use to stop it overflowing out of the Div?
The "Back to top ^" link is being pushed out also. It has a <br /><br /> inbetween it and the Div.
(See attached screenshot)
Thanks.
Attachment: overflowing_div.JPG (113.27 KB)
This file has been downloaded 133 time(s).
This post was edited on 07-17-2005 at 04:36 PM by jren207.
|
|
07-17-2005 04:34 PM |
|
|
-dt-
Scripting Contest Winner
;o
Posts: 1819 Reputation: 74
36 / /
Joined: Mar 2004
|
RE: Div overflows...
IE will stretch the div to fit the content which is in fact the wrong thing , infact its sposed to let the content flow out if it dosnt fit the container.
the css thing you could use is the "overflow" statement try using overflow:auto or something but that will add scroll bars to the div scince the content is larger than the containing div.
Happy Birthday, WDZ
|
|
07-17-2005 04:43 PM |
|
|
jren207
Senior Member
JR! - We <3 Fanta
Posts: 870 Reputation: 28
35 / / –
Joined: Sep 2003
|
O.P. RE: Div overflows...
ah, that works, I applied it to the div property:
div{
overflow:auto;
}
but it has scrollbars like you said , thanks anyway, I might use tables instead...
This post was edited on 07-17-2005 at 05:02 PM by jren207.
|
|
07-17-2005 05:01 PM |
|
|
-dt-
Scripting Contest Winner
;o
Posts: 1819 Reputation: 74
36 / /
Joined: Mar 2004
|
RE: Div overflows...
quote: Originally posted by jren207
ah, that works, I applied it to the div propertyiv{ overflow:auto; } but it has scrollbars like you said , thanks anyway, I might use tables instead...
you can use overflow:hidden to hide the overflowed content.......(also theres overflow-x and overflow-y which you should be able to work out ) but i doubt thats something you would want to do...why not just increase the area of your div?
edit:
sorry if my post seems not spaced I just noticed fixing some bugs in my wysiwyg editor has broken my <br>'s from parsing (stopping newlines in my posts...)
This post was edited on 07-17-2005 at 05:18 PM by -dt-.
Happy Birthday, WDZ
|
|
07-17-2005 05:16 PM |
|
|
jren207
Senior Member
JR! - We <3 Fanta
Posts: 870 Reputation: 28
35 / / –
Joined: Sep 2003
|
O.P. RE: Div overflows...
can't seem to get overflow-x/overflow-y to work... blah...
I was thinking of increasing the div size, but on the main page, it's like a blogging thing and there will be posts which may be long etc. (I will be spanning posts over an amount of pages with PHP though).
I'll just use tables, seems easier...
This post was edited on 07-17-2005 at 05:24 PM by jren207.
|
|
07-17-2005 05:24 PM |
|
|
hmaster
Senior Member
Posts: 716 Reputation: 24
33 / /
Joined: Nov 2004
|
RE: Div overflows...
Nope better way without scrollbars which is as follows:
In your css locate:
code: div.main{
padding-left: 8px;
background-color: #F3F4F7;
width: 95%;
height: 300px;
border-left: #19B7F1 1px solid;
border-right: #1286E1 1px solid;
font-size: 9px;
}
and change
code: height: 300px;
to
code: height:auto;
According to what I'm seeing on my computer it works but I'm not 100% sure.
This post was edited on 07-17-2005 at 05:26 PM by hmaster.
|
|
07-17-2005 05:25 PM |
|
|
jren207
Senior Member
JR! - We <3 Fanta
Posts: 870 Reputation: 28
35 / / –
Joined: Sep 2003
|
O.P. RE: Div overflows...
aha, you're a genius hmaster5!
thanks and thanks -dt- for your help as well.
Well that solves that then
|
|
07-17-2005 05:26 PM |
|
|
hmaster
Senior Member
Posts: 716 Reputation: 24
33 / /
Joined: Nov 2004
|
RE: Div overflows...
no problem, nice layout btw
|
|
07-17-2005 05:30 PM |
|
|
RaceProUK
Elite Member
Posts: 6073 Reputation: 57
39 / /
Joined: Oct 2003
|
RE: Div overflows...
quote: Originally posted by hmaster5
and change
code: height: 300px;
to
code: height:auto;
According to what I'm seeing on my computer it works but I'm not 100% sure.
That should work properly, as now the browser will calculate height on-the-fly, based on the area required for the content.
|
|
07-17-2005 08:07 PM |
|
|
|