Jump to content
  • 0

Высота дива


ros.pro
 Share

Question

Как сделать, чтобы при увеличении размера контента дива, он увеличивался бы по высоте, если в ксс указан overflow: hidden ?

overflow: visible не подходит, т.к когда я его указываю, вся верстка "валится" в мозиле и опере.

зы: Это надо сделать в дивах, которые поочередно расположены по горизонтали...

Или альтернативный вопрос: как сделать чтобы верстка не валилась при overflow: visible ? =)

.block_main{
position: relative;
margin-top: 5px;
margin-bottom: 5px;
}
.block_top_1{
margin-left: -10px;
margin-top: -5px;
margin-bottom: 5px;
height: 32px;
line-height: 18px;
overflow: hidden;
background: #FFF;
border: 2px solid #f6f6f6;
border-bottom: 1px solid #dddddd;
}
.block_content{
padding-left: 10px;
padding-top: 5px;
padding-bottom: 5px;
background: #f6f6f6;
_display: inline-block;
overflow: hidden;
position: relative;
border: 1px solid #dddddd;
font-family: Arial;
font-weight: normal;
font-size: 11px;
color: #000;
}
.block_content_2{
padding-left: 10px;
padding-top: 5px;
padding-bottom: 5px;
overflow: hidden;
float: left;
width: 50%;
margin-right: 3px;
_margin-right: 0px;
background: #f6f6f6;
position: relative;
border: 1px solid #dddddd;
font-family: Arial;
font-weight: normal;
font-size: 11px;
color: #000;
}

<div class="block_main">
<div class="block_top">Последние новости</div>
<div class="block_content_2" style="height: 150px; margin-bottom: 3px;">
<div class="block_top_1"><img src="themes/site/images/news_pic.gif" align="left" hspace=5><a href="http://localhost/bb/index.php" id="link_menu"></a></div>
</div>
<div class="block_content" style="height: 150px; margin-bottom: 3px;">
<div class="block_top_1"><img src="themes/site/images/news_pic.gif" align="left" hspace=5><a href="http://localhost/bb/index.php" id="link_menu"></a></div>
</div>
</div>

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

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