html5 中的 css 文章和旁白问题

标签 css html

这是我的代码:

<aside class="aside">
    <img src="img/agencies.png" alt="agencies" />
    <h3>From the Blog</h3>
    <p class="windows">DAVID  <i> on </i>c# Windows</p>
    <p class="hex">How to convert System.Color to HTML color (hex)?</p>
    <p class="sidebar-pgf">I'm working on an application that requires converting the back color of the panel to HTML that can be used as a div background color. Please help.</p>
    <a  href="#" class="view">view answer</a>
</aside>

这是我的 jsfiddle:http://jsfiddle.net/d0teo50p/

我为 article 设置了 75% 的宽度,为 aside 设置了 25% 的宽度。但是 aside 部分显示在该部分的右下角。

请查看我的 JSfiddle,并帮助我解决我的错误。

提前致谢..

最佳答案

使用 display:tabledisplay:table-cell 来实现这一点。

 #section {
 display:table;
 }

.article {
width:75%;
padding-bottom: 50px;
display:table-cell;
vertical-align:top;
}

.aside{
display:table-cell;
vertical-align:top;
width:25%;  
} 

DEMO

关于html5 中的 css 文章和旁白问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25482689/

相关文章:

html - 具有圆形路径的图像上的 CSS 剪辑

html - 输入router-outlet后css发生变化

html - 与事件状态的链接

javascript - 如果单击上一页上的按钮,则自动滚动

javascript - timepicker 不显示下拉菜单

javascript - Twitter Bootstrap 选项卡运行不正常

HTML 元素不显示调试器所说的内容

html - 如何使选择框跨越 div、rails 4、bootstrap 的剩余宽度

javascript - 如何更好地处理多个菜单项之间的 hide()、show() div?

javascript - 在选中时更改 td 的背景颜色