Как увеличить высоту столбцов в CSS, используя 960
Хорошего дня.
Я использую сетку 960, и два div созданы для использования в качестве фоновой оболочки, которая находится за пределами ширины 960, и, во-вторых, для использования в качестве контента для 3 столбцов, состоящих из текстов и изображений.
Моя проблема в том, что я пытался установить высоту 100% как для фона, так и для контента, но он не будет расширяться, чтобы изображения и тексты не перекрывали оболочку фона.
Я что-то пропустил? Ваша помощь очень ценится.
<div id="contentMain" class="container_12">
<div class="sub3 grid_4">
<h2>Graphic Design</h2>
<hr>
<p><span>I specialize in designing different graphic materials aimed to catch your target audience and bring more business to you.</span></p>
<div class="frameImg">
<img src="images/graphicdesign_image.jpg" alt="graphic design" />
</div><!-- end of framImg -->
</div><!-- end of sub1 -->
<div class="sub3 grid_4">
<h2>Web Design</h2>
<hr>
<p><span>I can give life into your existing website and wow your visitors. When I work for a company, I always make sure they are happy with the results. I strive to think creatively for my clients, making myself a mirror of many faces.</span></p>
<div class="frameImg">
<img src="images/web_image.jpg" alt="web design" />
</div><!-- end of framImg -->
</div><!--end of sub2 -->
<div class="sub3 grid_4">
<h2>Motion Effects</h2>
<hr>
<p>I am familiar with creating sophisticated motion graphics and cinematic visual effects using Adobe After Effects. I transform moving images for delivery to theaters, living rooms, personal computers, and mobile devices.</p>
<div class="frameImg">
<img src="images/motioneffects_image.jpg" alt="motion effects" />
</div><!-- end of framImg -->
</div><!--end of sub3 -->
</div><!-- end of contentMain -->
<div class="clear"></div> <!-- Important! -->
#contentMainBackground {
background:url("../images/body_bg.jpg") repeat;
min-height:290px;
height:auto !important;
height:290px;
width:100%;
position:absolute;
}
#contentMain {
min-height:290px;
height:auto !important;
height:290px;
2 ответа
Почему бы вам просто не создать контейнер div для сетки из 12 столбцов и применить фон к этому элементу контейнера верхнего уровня?
<div id="wrapper">
<div id="contentMain" class="container_12">
<div class="sub3 grid_4">
<h2>Graphic Design</h2>
<hr>
<p><span>I specialize in designing different graphic materials aimed to catch your target audience and bring more business to you.</span></p>
<div class="frameImg">
<img src="images/graphicdesign_image.jpg" alt="graphic design" />
</div><!-- end of framImg -->
</div><!-- end of sub1 -->
<div class="sub3 grid_4">
<h2>Web Design</h2>
<hr>
<p><span>I can give life into your existing website and wow your visitors. When I work for a company, I always make sure they are happy with the results. I strive to think creatively for my clients, making myself a mirror of many faces.</span></p>
<div class="frameImg">
<img src="images/web_image.jpg" alt="web design" />
</div><!-- end of framImg -->
</div><!--end of sub2 -->
<div class="sub3 grid_4">
<h2>Motion Effects</h2>
<hr>
<p>I am familiar with creating sophisticated motion graphics and cinematic visual effects using Adobe After Effects. I transform moving images for delivery to theaters, living rooms, personal computers, and mobile devices.</p>
<div class="frameImg">
<img src="images/motioneffects_image.jpg" alt="motion effects" />
</div><!-- end of framImg -->
</div><!--end of sub3 -->
</div><!-- end of contentMain -->
</div>
<div class="clear"></div> <!-- Important! -->
Или может вместо этого применить фон к тегу body?
Настоятельно рекомендуется фреймворк, я использовал его для нескольких проектов.
Позволяет вам избежать раздражающих CSS-хаков, подобных этому.