What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Div overflows...

Div overflows...
Author: Message:
jren207
Senior Member
****

Avatar
JR! - We <3 Fanta

Posts: 870
Reputation: 28
35 / Male / –
Joined: Sep 2003
O.P. Sad  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.

.jpg File 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
Profile E-Mail PM Web Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
36 / Male / Flag
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.
[Image: dt2.0v2.png]      Happy Birthday, WDZ
07-17-2005 04:43 PM
Profile PM Web Find Quote Report
jren207
Senior Member
****

Avatar
JR! - We <3 Fanta

Posts: 870
Reputation: 28
35 / Male / –
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
Profile E-Mail PM Web Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
36 / Male / Flag
Joined: Mar 2004
RE: Div overflows...
quote:
Originally posted by jren207
ah, that works, I applied it to the div property:div{     overflow:auto; } but it has scrollbars like you said [Image: msn_sad.gif], 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-.
[Image: dt2.0v2.png]      Happy Birthday, WDZ
07-17-2005 05:16 PM
Profile PM Web Find Quote Report
jren207
Senior Member
****

Avatar
JR! - We <3 Fanta

Posts: 870
Reputation: 28
35 / Male / –
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
Profile E-Mail PM Web Find Quote Report
hmaster
Senior Member
****

Avatar

Posts: 716
Reputation: 24
33 / Male / Flag
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.
[Image: sig.png]
07-17-2005 05:25 PM
Profile PM Web Find Quote Report
jren207
Senior Member
****

Avatar
JR! - We <3 Fanta

Posts: 870
Reputation: 28
35 / Male / –
Joined: Sep 2003
O.P. RE: Div overflows...
aha, you're a genius hmaster5! :P

thanks :) and thanks -dt- for your help as well.

Well that solves that then :D
07-17-2005 05:26 PM
Profile E-Mail PM Web Find Quote Report
hmaster
Senior Member
****

Avatar

Posts: 716
Reputation: 24
33 / Male / Flag
Joined: Nov 2004
RE: Div overflows...
no problem, nice layout btw (Y)
[Image: sig.png]
07-17-2005 05:30 PM
Profile PM Web Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
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.
[Image: spartaafk.png]
07-17-2005 08:07 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On