Jump to content
  • 0

Проблема с вложенностью блоков


Girn
 Share

Question

Вот есть у меня уже сверстаный блок.

44df3d82cc3c.png

Вот его код:


<div id="line1">
<div class="block-line1">
<div class="block-header">
<h1>About WhiteSquare</h1>
<span></span>
</div>
<div class="block-body">
<div class="block-image"><img src="images/img1.png" alt="" /></div>

<div class="block-text">
<p>In ultricies pellentesque massa a porta. Aliquam ipsum enim, hendrerit ut porta nec, ullamcorper et nulla. In eget mi dui, sit amet scelerisque nunc. Aenean augue arcu, convallis ac vulputate vitae, mollis non lectus. Donec hendrerit lacus ac massa ornare hendrerit sagittis lacus tempor. Vivamus et dui et neque accumsan varius et ut erat. Enean augue arcu, convallis ac ultrices.</p>
</div>
<div class="block-more"><a href="#">Read more</a></div>
</div>
</div>
<div class="block-line1">
<div class="block-header">
<h1>a word from OUR ceo</h1>
<span></span>
</div>
<div class="block-body">
<div class="block-image"><img src="images/img1.png" alt="" /></div>
<div class="block-text">
<p>“In ultricies pellentesque massa a porta. Aliquam ipsum enim, hendrerit ut porta nec, ullamcorper et nulla. In eget mi dui, sit amet scelerisque nunc. Aenean augue arcu, convallis ac vulputate vitae, mollis non lectus. Donec hendrerit lacus ac massa ornare hendrerit sagittis lacus tempor. Vivamus et dui et neque accumsan varius et ut erat. Enean augue arcu, convallis ac.”</p>
</div>
<div class="block-more">Yane Naumoski, CEO</div>
</div>
</div>
</div><!-- end line1-->

и css:


/* <Блок> */
.block-line1,
.block-line2,
.block-line3,
.block-header,
.block-header span,
.block-body,
.block-text {
overflow: hidden;
}
.block-line1 {
float: left;
width: 460px;
margin-left: 10px;
padding-right: 10px;
}
.block-line2{
float: left;
width: 300px;
margin-left: 10px;
padding-right: 10px;
}
.block-line3 {
float: left;
width: 940px;
margin-left: 10px;
padding-right: 10px;
}
.block-header h1 {
float: left;
height: 15px;
font-size: 13px;
font-family: Oswald, Geneva, sans-serif;
text-transform: uppercase;
color: #7e7e7e;
padding: 2px 9px 1px 20px;
background: url(images/title-bg.png) no-repeat;
}
.block-header span {
display: block;
height: 15px;
background: url(images/title-bg2.png) repeat-x;
}
.block-body {
margin-top: 15px;
}
.block-image {
float: left;
width: 136px;
height: 137px;
padding: 1px;
margin-right: 19px;
border: 1px solid #cccccc;
}
.block-text {
height: 125px;
padding-top: 4px;
font-size: 12px;
font-family: Tahoma, Geneva, sans-serif;
color: #8f8f8f;
line-height: 1.3;
}
.block-more {
font-size: 13px;
font-family: Tahoma, Geneva, sans-serif;
color: #525252;
}
.block-more a {
font-size: 13px;
font-family: Tahoma, Geneva, sans-serif;
color: #525252;
}
.block-text p {
margin: 0;
}
/* </Блок> */

Вроде бы все нормально, но вот мне понадобилось сделать отступ ниже этого блока, делаю так:


#line1 {
margin-bottom: 15px;
}

Но ничего не происходит. Разбираю в чем пролбема, делаю так:


#line1 {
margin-bottom: 15px;
border: 1px solid black;
}

И вижу что рамки вокруг моего блока нет, она только сверху (потому и не работает правильно отступ):

e24dd7d8464e.png

Соответственно вопрос: как сделать чтобы Блок line1 захвативал содержимое нормально?

Edited by Girn
Link to comment
Share on other sites

2 answers 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