/    Sign up×
Community /Pin to ProfileBookmark

Expanding div w/ height in non IE browsers

Hi.

Lets say I have a div container, within it there is another div which needs to be 100% height of its parent (there are other divs in there pushing the height of the container, but to keep it simple lets stick to one div).

How can I do this?

[code=html]
<div>
<div style=”float:left;padding:0;margin:0;height:100%;width:50%;background-color:red;”>abcdefg</div>
<div style=”float:left;padding:0;margin:0;height:100%;width:50%;background-color:blue;”>hijk<br />lmnop</div>
</div>
[/code]

I don’t think there has been any way at this moment of time to do this but it’s worth asking.

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@jassincNov 06.2008 — Set the parents height...

[code=html]
<div style="position:relative; height:400px;">
<div style="float:left;padding:0;margin:0;height:100&#37;;width:50%;background-color:red;">abcdefg</div>
<div style="float:left;padding:0;margin:0;height:100%;width:50%;background-color:blue;">hijk<br />lmnop</div>
</div>
[/code]


The inner divs should take the size of the container, in theory anyway...
Copy linkTweet thisAlerts:
@TaboauthorNov 07.2008 — Set the parents height...

[code=html]
<div style="position:relative; height:400px;">
<div style="float:left;padding:0;margin:0;height:100%;width:50%;background-color:red;">abcdefg</div>
<div style="float:left;padding:0;margin:0;height:100%;width:50%;background-color:blue;">hijk<br />lmnop</div>
</div>
[/code]


The inner divs should take the size of the container, in theory anyway...[/QUOTE]


But you've specified a height of 400!
Copy linkTweet thisAlerts:
@jassincNov 07.2008 — It's an example, you just change it to whatever height you want it to be...
Copy linkTweet thisAlerts:
@TaboauthorNov 07.2008 — It's an example, you just change it to whatever height you want it to be...[/QUOTE]

But the hight changes during runtime, that's the problem, I have no idea what hight the content will be. I don't want to have to use the

background:transparent url("red_1x1px.gif") repeat-y 0 0;

trick though.

I want a clean column effect (though I'm not using this for columns lol).
×

Success!

Help @Tabo spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...