Connecting Tech Pros Worldwide Forums | Help | Site Map

How to extend a div ?

Kerberos
Guest
 
Posts: n/a
#1: Jul 21 '05
I have a main div with 2 divs inside, one of them floating to the right
(they look like 2 columns).
The main div has a background image.

How can I have the main div to adapt to the maximum height of the divs
inside of it so that the background image of the main div repeats
vertically according to the height of the 2 divs inside? This way, the
content of one of the 2 divs wouldn't overlap the main div, but push its
border.

Thanks.

--

Kerberos.

http://www.opera.com
http://www.freebsd.org
http://www.auriance.com
http://www.osresources.com
http://exodus.jabberstudio.org

Mark Tranchant
Guest
 
Posts: n/a
#2: Jul 21 '05

re: How to extend a div ?


Kerberos wrote:[color=blue]
> I have a main div with 2 divs inside, one of them floating to the right
> (they look like 2 columns).
> The main div has a background image.
>
> How can I have the main div to adapt to the maximum height of the divs
> inside of it so that the background image of the main div repeats
> vertically according to the height of the 2 divs inside? This way, the
> content of one of the 2 divs wouldn't overlap the main div, but push
> its border.[/color]

It should do anyway, unless you are using absolute positioning. URL?

--
Mark.
http://tranchant.plus.com/
Chris Leipold
Guest
 
Posts: n/a
#3: Jul 21 '05

re: How to extend a div ?


Hi,

your post sounds like the second try of your basic question. I fear it's
not so basic... I thought a bit - you might try it like your first
attempt, two divs side by side, giving each a border of 1px (wich gives
a sum of 2 px) and move the right div with margin-left:-1px one pixel to
the left. Then you have a border with a width of 1px and the length of
the longer div.

Don't forget to set the div with the negative margin position:relative,
since IE will hide a part of the div otherwise.

Chris


Kerberos wrote:[color=blue]
> I have a main div with 2 divs inside, one of them floating to the right
> (they look like 2 columns).
> The main div has a background image.
>
> How can I have the main div to adapt to the maximum height of the divs
> inside of it so that the background image of the main div repeats
> vertically according to the height of the 2 divs inside? This way, the
> content of one of the 2 divs wouldn't overlap the main div, but push
> its border.
>
> Thanks.
>[/color]
Johannes Koch
Guest
 
Posts: n/a
#4: Jul 21 '05

re: How to extend a div ?


Mark Tranchant wrote:
[color=blue]
> Kerberos wrote:
>[color=green]
>> I have a main div with 2 divs inside, one of them floating to the
>> right (they look like 2 columns).
>> The main div has a background image.
>>
>> How can I have the main div to adapt to the maximum height of the
>> divs inside of it so that the background image of the main div
>> repeats vertically according to the height of the 2 divs inside? This
>> way, the content of one of the 2 divs wouldn't overlap the main div,
>> but push its border.[/color]
>
> It should do anyway, unless you are using absolute positioning. URL?[/color]

No, Kerberos uses float. So the floated column may overlap.
Kerberos: add an element with 'break: right' within the main div after
the two column divs.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Mark Tranchant
Guest
 
Posts: n/a
#5: Jul 21 '05

re: How to extend a div ?


Johannes Koch wrote:
[color=blue]
> No, Kerberos uses float. So the floated column may overlap.
> Kerberos: add an element with 'break: right' within the main div after
> the two column divs.[/color]

My mistake. To make up for it, I'll point out that I think you mean
"clear" instead of "break"?

--
Mark.
http://tranchant.plus.com/
Johannes Koch
Guest
 
Posts: n/a
#6: Jul 21 '05

re: How to extend a div ?


Mark Tranchant wrote:
[color=blue]
> My mistake. To make up for it, I'll point out that I think you mean
> "clear" instead of "break"?[/color]

Yes, my mistake :-)
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Kerberos
Guest
 
Posts: n/a
#7: Jul 21 '05

re: How to extend a div ?


Em Thu, 06 Jan 2005 17:43:47 +0100, Johannes Koch <koch@w3development.de>
escreveu:
[color=blue]
> Mark Tranchant wrote:
>[color=green]
>> My mistake. To make up for it, I'll point out that I think you mean
>> "clear" instead of "break"?[/color]
>
> Yes, my mistake :-)[/color]

Thank you guys ;) I know there is this solution of adding a block-level
element such as a division, and defining it as clear: both, it works fine
actually:

http://www.auriance.com/docs/auriance/autre.html

But then, we don't separate content and structure from presentation
anymore :D
I know, I know...

--

Kerberos.

http://www.opera.com
http://www.freebsd.org
http://www.auriance.com
http://www.osresources.com
http://exodus.jabberstudio.org
kchayka
Guest
 
Posts: n/a
#8: Jul 21 '05

re: How to extend a div ?


Kerberos wrote:[color=blue]
>
> http://www.auriance.com/docs/auriance/autre.html[/color]

Are you aware that there are no background colors set? My browser
default background color is not white, so it's pretty obvious.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Kerberos
Guest
 
Posts: n/a
#9: Jul 21 '05

re: How to extend a div ?


Em Thu, 06 Jan 2005 18:14:03 -0600, kchayka <usenet@c-net.us> escreveu:
[color=blue]
> Kerberos wrote:[color=green]
>>
>> http://www.auriance.com/docs/auriance/autre.html[/color]
>
> Are you aware that there are no background colors set? My browser
> default background color is not white, so it's pretty obvious.
>[/color]

Really? Good to know... What browser do you use?

--

Kerberos.

http://www.opera.com
http://www.freebsd.org
http://www.auriance.com
http://www.osresources.com
http://exodus.jabberstudio.org
Johannes Koch
Guest
 
Posts: n/a
#10: Jul 21 '05

re: How to extend a div ?


Kerberos wrote:
[color=blue]
> Em Thu, 06 Jan 2005 18:14:03 -0600, kchayka <usenet@c-net.us> escreveu:
>[color=green]
>> Are you aware that there are no background colors set? My browser
>> default background color is not white, so it's pretty obvious.
>>[/color]
>
> Really? Good to know... What browser do you use?[/color]

Many browser allow you to change the default (background) color.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
kchayka
Guest
 
Posts: n/a
#11: Jul 21 '05

re: How to extend a div ?


Kerberos wrote:[color=blue]
> Em Thu, 06 Jan 2005 18:14:03 -0600, kchayka <usenet@c-net.us> escreveu:
>[color=green]
>> Kerberos wrote:[color=darkred]
>>>
>>> http://www.auriance.com/docs/auriance/autre.html[/color]
>>
>> Are you aware that there are no background colors set? My browser
>> default background color is not white, so it's pretty obvious.[/color]
>
> Really? Good to know... What browser do you use?[/color]

I don't think that's relevant. Like Johannes said, many browsers let you
set default page colors. Even Netscape 4.x has that option. Try looking
around your own browser prefs and you may find this setting somewhere.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Kerberos
Guest
 
Posts: n/a
#12: Jul 21 '05

re: How to extend a div ?


Em Fri, 07 Jan 2005 16:33:11 +0100, Johannes Koch <koch@w3development.de>
escreveu:
[color=blue]
> Many browser allow you to change the default (background) color.[/color]

Yes, I know, but I thought no browser had grey as default background
anymore...
Oh well, I haven't used all browsers yet.
"Link" has black as default background color!

--

Kerberos.

http://www.opera.com
http://www.freebsd.org
http://www.auriance.com
http://www.osresources.com
http://exodus.jabberstudio.org
kchayka
Guest
 
Posts: n/a
#13: Jul 21 '05

re: How to extend a div ?


Kerberos wrote:[color=blue]
> Em Fri, 07 Jan 2005 16:33:11 +0100, Johannes Koch <koch@w3development.de>
> escreveu:
>[color=green]
>> Many browser allow you to change the default (background) color.[/color]
>
> Yes, I know, but I thought no browser had grey as default background
> anymore...[/color]

Noone said the factory-installed default background color was gray. I
just said that my browser default wasn't white. I changed mine from
white to something less harsh on the eyes.

You might consider doing likewise, then you'd see right away when you
forget to set body colors in your stylesheet.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Kerberos
Guest
 
Posts: n/a
#14: Jul 21 '05

re: How to extend a div ?


Em Sat, 08 Jan 2005 17:00:20 -0600, kchayka <usenet@c-net.us> escreveu:
[color=blue]
> Noone said the factory-installed default background color was gray. I
> just said that my browser default wasn't white. I changed mine from
> white to something less harsh on the eyes.
>
> You might consider doing likewise, then you'd see right away when you
> forget to set body colors in your stylesheet.[/color]

Interesting. Then I think setting body's background color as white would
force the browser of users who prefer to use a less agressive color to
actually a flashy white. Maybe it wouldn't be nice for these people /
antiethical. I think most web sites don't have a predefined bg color, then
these users are used to a color that is less harsh. If suddenly the bg is
white, it might ennoy them.

--

Kerberos.

http://www.opera.com
http://www.freebsd.org
http://www.auriance.com
http://www.osresources.com
http://exodus.jabberstudio.org
Kerberos
Guest
 
Posts: n/a
#15: Jul 21 '05

re: How to extend a div ?


Em Sat, 08 Jan 2005 17:00:20 -0600, kchayka <usenet@c-net.us> escreveu:
[color=blue]
> Noone said the factory-installed default background color was gray. I
> just said that my browser default wasn't white. I changed mine from
> white to something less harsh on the eyes.[/color]

You were right:
http://www.w3.org/QA/Tips/color


--
Kerberos.
Closed Thread