Jump to content
  • 0

Не рабоотает padding-bottom при float-left для вложенных дивов. Почему?


Semreg
 Share

Question

Пример кода как нужно:

<!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=windows-1251">

<style type="text/css">

.d1 {
width: 500px;
border: 1px solid #424142;
}

.d2 {
padding: 10px;
}

.d3 {
width: 100px;
background: #999999;
}

.d4 {
float:left;
width: 100px;
background: #555555;
}

</style>

</head>

<body>

<div class="d1">
<div class="d2">
<div class="d3">
Блок 1
</div>
</div>
</div>

</body>
</html>

Только внутри мне нужно вложить 3-и прифлоатенных блока. Вкладываю - пропадает паддинг снизу:

<!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=windows-1251">

<style type="text/css">

.d1 {
width: 500px;
border: 1px solid #424142;
}

.d2 {
padding: 10px;
}

.d3 {
float:left;
width: 100px;
background: #999999;
}

.d4 {
float:left;
width: 100px;
background: #555555;
}

</style>

</head>

<body>

<div class="d1">
<div class="d2">
<div class="d3">
Блок 1
</div>
<div class="d4">
Блок 2
</div>
<div class="d3">
Блок 3
</div>
</div>
</div>

</body>
</html>

Как лечить? :blink:

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

лови :blink:

<!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=windows-1251">

<style type="text/css">

.d1 {
width: 500px;
border: 1px solid #424142;
overflow: hidden;
}

.d2 {
padding: 10px;
overflow: hidden;
}

.d3 {
float:left;
width: 100px;
background: #999999;
}

.d4 {
float:left;
width: 100px;
background: #555555;
}

</style>

</head>

<body>

<div class="d1">
<div class="d2">
<div class="d3">
Блок 1
</div>
<div class="d4">
Блок 2
</div>
<div class="d3">
Блок 3
</div>
</div>
</div>

</body>
</html>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy