【发布时间】:2015-07-22 08:07:20
【问题描述】:
我的 WP 网站中有由帖子创建的响应式“单元格”。
HTML
<article>
<div id="post-<?php the_ID(); ?>" <?php post_class( 'row'); ?> >
<div class="col-md-12">
<div class="text-cell">
<h1><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<h3><?php the_category(' '); ?></h3>
</div>
</div>
</div>
<!-- /#post -->
</article>
CSS
article {
position: relative;
margin: 0;
padding: 18% 0;
}
.text-cell {
position: absolute;
height: 100%;
width: 30%;
top: 0;
left: 0;
background-color: #fff;
}
如果可能,我不希望“文章”设置高度(我使用填充为“文章”创建动态高度)
我希望“文本单元格”是文章的全高和宽度的 30%。在它移动之前,它将是全宽和 30% 的高度。 100% 的高度似乎不起作用。
视觉前。
【问题讨论】:
-
您当前的代码不起作用吗? jsfiddle.net/fzwqn3uh/2
-
我认为应该,但我的“背景颜色”没有显示。但我希望它像你的小提琴表演一样工作
-
那么你的框架导致了这个问题,元素上可能有更多的css
标签: javascript jquery html css