html - 显示问题 : right content cont bleeds over onto left column on mobile

标签 html ios css mobile

我的问题是,在移动设备上,右侧内容(白色背景)位于左侧内容(紫色)下方。我已经尝试使用 clear:both,但仍然没有解决问题。

我一直认为这个 CSS 是错误的:

.cont {
    width: 1000px;
    overflow: hidden
}
.cont_left {
    width: 283px;
    height: auto;
    float: left;
    vertical-align: central;
    padding-top: 25px;
    padding-left: 25px;
    padding-right: 25px;
    background-image: url(.//images/sidebar.png);
    padding-bottom: 220px;
}
.cont_right {
    width: 600px;
    padding-left: 25px;
    height: 100%;
    float: left;
    position:relative;
    font: Arial;
    font-size: 12px;
    background: #ffffff;
    padding-right: 25px;
}

实时站点:Website

问题图片:iOS Screenshot

最佳答案

也许您正在寻找 Faux Columns已讨论的技术here .此外,杰夫·格雷厄姆 (Geoff Graham) 写了一篇覆盖面很广的文章 article关于将您的布局分成两半(当然,您不需要像描述的那样达到 50 50)。

在您的情况下,我会使用上述技术之一使用百分比(内容占 70%,边栏占 30%)。请注意,vertical-align: central; 不是有效属性。 Here你可以找到一些关于如何垂直居中的信息。

关于html - 显示问题 : right content cont bleeds over onto left column on mobile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29122054/

相关文章:

javascript - 监听事件 "close enough"到元素

html - 除非用户清除缓存,否则不会在网站上显示新内容

javascript - <!-- 和//--> 在 Javascript 中有什么用?

ios - jonkyking/幻灯片菜单 'attempt to push a View Controller ..its navigationController == nil'

html - 带有 id 和外部 css 样式表的表将无法工作或格式化

javascript - 单击 anchor 时,如何定位没有任何 UL 的 LI

javascript - 如何在动态 html 表 javascript 中选择选项值。未从 jsp 页面中的数据库获取更新的选项值

html - 如何防止悬停期间的链接填充扩展段落填充

ios - UISearchBar 在搜索结果中显示多个部分标题

ios - 如何在 iOS 7 的 UIWebView 中从 JavaScript 调用 Objective-C?