/    Sign up×
Community /Pin to ProfileBookmark

Minimum height for div

Hello,

I have the code below, but I can’t create the border correctly if the text is not enough. I want the the block should be at least 100px height. If it is more than the border is correct else not.

How can I solve this?

[CODE]<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “DTD/xhtml1-transitional.dtd”>
<html>
<head>
<style type=”text/css”>
body {
background-color:#F1F3F5;
}
#container{
border: 1px solid #ccc;
background-color:#fdfdfd;
margin: auto;
width: 500px;
background-color:#fdfdfd;
font-family: Arial, Helvetica, sans-serif;
font-weight:normal;
margin-top:10px;
}

#icon {
float:left;
width:143px;
height:100px;
font-size : 10px;
padding-left:5px;
padding-top:5px;
}

#text {
float:left;
width:340px;
border-left:1px solid #ccc;
font-size : 12px;
padding-left:5px;
padding-top:5px;
}

</style>
</head>
<body>
<div id=”container”>
<div id=”icon”>Demo</div>
<div id=”text”>This is a text</div>
</div>
<div id=”container”>
<div id=”icon”>Demo</div>
<div id=”text”><p>This is a text</p><p>This is a text</p><p>This is a text</p><p>This is a text</p><p>This is a text</p><p>This is a text</p></div>
</div>

</body>[/CODE]

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJul 11.2006 — You just need to "clear the floats". Add this to your style:
<i>
</i>.clear {
font-size: 1px;
line-height: 1px;
margin: 0;
padding: 0;
border: none;
clear: both;
}

In your HTML:
[code=html]
<div id="container">
<div id="icon">Demo</div>
<div id="text">This is a text</div>
<div class='clear'></div>
</div>
[/code]
Copy linkTweet thisAlerts:
@elmuauthorJul 11.2006 — Thanks!

Unfortunatelly in IE it doesn't work for me ?
×

Success!

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

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

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