/    Sign up×
Community /Pin to ProfileBookmark

dynamic div height

Hi!

I have a layout problem on my page. I have a Everything Div and two Divs inside Everything Div. LeftSidePart div and TextPart div. My code looks something like this:

[code=html]
<div class=”Everything”>
<div class=”LeftSidePart”>
**Verticaly Stretching swf file here**
</div>
<div class=”TextPart”>
very long text in here
</div>
</div
[/code]

layout.css:

[CODE]
.Everything {
border: thin black solid;
width: 800px;
float: left;/*because i have another div on the right…*/
display: inline;
}

.LeftSidePart {
border: thin red solid;
width: 20px;
height: inherit;
float: left;
}

.TextPart {
border: thin blue solid;
width: 780px;
height: auto;
}
[/CODE]

I would like to have LeftSidePart div and TextPart div side by side, with the same height. The problem is, that i don’t have a static height. Height is “defined” by the length of the text in TextPart div.

In other words: I would like to stretch LeftSidePart div as much as TextPart div is stretched by content(text) inside. So if have a few pages long text(on the right, i would like to have swf file stretched all along that text.

Any suggestions on how to solve this problem?

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@WebJoelJan 22.2007 — I am assuming that the missing ">" in your HTML is a typo. Sounds to me like 'faux columns'(?)

"20px;" width for .LeftSidePart ?? That is as wide as a scrollbar... I do not think that IE will let you define a width less than anything that will occupy it. -IE will 'expand' it minimally, at least. Whilst Fx will merely 'overflow' maybe?

You will want to 'float:left;" your 'very long line' to make it fall 'below' the left-column.... like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"

"http://www.w3.org/TR/html4/strict.dtd">

<html><head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<meta http-equiv="Content-Style-Type" content="text/css" />

<meta http-equiv="Content-Script-Type" content="text/javascript" />

<title></title>

<style type="text/css">

* {border:0; padding:0; margin:0;}/* Set everything to "zero" */

body { font-size:1.0em;}/*
Assist IE rendering */

h1, h2, h3, h4, h5, h6 {font-family: 'times new roman', arial, verdana, serif;

font-style:normal; font-variant:normal; font-weight:normal; margin-left:16px;}/*
indent all, 16px */

h1{font-size: 1.93em;}

h2{font-size: 1.72em;}

h3{font-size: 1.52em;}

h4{font-size: 1.42em;}

h5{font-size: 1.32em;}

h6{font-size: 1.21em;}

.Everything {

border:thin black solid;

width:800px;

float: left;/*because i have another div on the right...*/

display: inline;

}

.LeftSidePart {

border:thin red solid;

[B]width:150px;[/B]

height:inherit;

float: left;

}

.TextPart {

border:thin blue solid;

width:100%;

[B]float:left;[/B]

height:auto;

}


</style>

<script type="text/javascript"><!--

// -->

</script>

</head>

<body>

<div class="Everything">

<div class="LeftSidePart">

**Verticaly Stretching swf file here**

<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

Suspendisse egestas ultricies pede. Phasellus suscipit blandit risus.

Praesent nonummy. In erat. Duis nibh pede, accumsan eu, pulvinar et,

volutpat vel, elit. Curabitur nec dui sed nunc congue tempus. Nulla ac

dui ac libero fringilla nonummy. Maecenas ullamcorper sodales risus.

Vivamus pretium dolor. Proin eu turpis. Phasellus ut mauris non nulla

mattis luctus. Nunc porttitor dapibus sapien. In malesuada fermentum

metus. Nulla egestas, tellus a vestibulum pharetra, nunc purus auctor

lacus, ut semper purus ipsum eu velit. Praesent dui. Nulla accumsan

turpis at erat.</p>

<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

Morbi lacus felis, euismod at, pulvinar sit amet, dapibus eu, eros.

Etiam tellus. Nam vestibulum porttitor urna. Phasellus aliquet pretium

quam. Proin pharetra, wisi nec tristique accumsan, magna sapien pulvinar

purus, vel hendrerit ipsum tellus at ante.</p>



</div>
<div class="TextPart">
very long text in here

<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

Suspendisse egestas ultricies pede. Phasellus suscipit blandit risus.

Praesent nonummy. In erat. Duis nibh pede, accumsan eu, pulvinar et,

volutpat vel, elit. Curabitur nec dui sed nunc congue tempus. Nulla ac

dui ac libero fringilla nonummy. Maecenas ullamcorper sodales risus.

Vivamus pretium dolor. Proin eu turpis. Phasellus ut mauris non nulla

mattis luctus. Nunc porttitor dapibus sapien. In malesuada fermentum

metus. Nulla egestas, tellus a vestibulum pharetra, nunc purus auctor

lacus, ut semper purus ipsum eu velit. Praesent dui. Nulla accumsan

turpis at erat.</p>

<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

Morbi lacus felis, euismod at, pulvinar sit amet, dapibus eu, eros.

Etiam tellus. Nam vestibulum porttitor urna. Phasellus aliquet pretium

quam. Proin pharetra, wisi nec tristique accumsan, magna sapien pulvinar

purus, vel hendrerit ipsum tellus at ante.</p>

</div>

</div>

</body>

</html>[/QUOTE]
[B]Changes that I made[/B] are in bold.

-This seems to work equally well in Fx as it does in IE, with no errors.
Copy linkTweet thisAlerts:
@MihaaauthorJan 23.2007 — WebJoel, thank you for your effort and suggestion on 'faux columns', you directied me into the right way of exploring. After some googling for 'faux columns' i realized, that i'm actually looking for Equal Height Columns with CSS ?. After some testing, I completely abandoned that concept, because it just isn't working right in my case. I can get 2 columns of equal height, but my flash animation in the left one(it realy is only 20px wide), just doesn't stretch all the way to the bottom of that div.And it is an issue with column heights, because if i set div height hard coded to 2000px just for testing purposes, it works like a charm, so i am sure that embeding of that flash animation is allright.

Anyway, that flash animantion just isn't worth that much, so i abandoned it.
×

Success!

Help @Mihaa 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 5.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...