让div填充中心容器旁边的空格 [英] Let div fill up space next to centered container

查看:88
本文介绍了让div填充中心容器旁边的空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网页包含一个带有内容的集中容器,我想在其旁边显示一个徽标。

I have a webpage containing a centered container with content and I want to display a logo next to it.

布局如下:div - container。其中容器位于中心,容器的div lef需要填满屏幕上剩余的宽度。

The layout is as following: div - container. Where the container is centered and the div lef of the container needs to fill out the width left on the screen.

html, body {
 height: 100%;
 width: 100%;
}
#container {
 width: 800px;
 margin-left: auto;
 margin-right: auto;
 min-height: 100%;
}

<div id="container">

</div>
<div id="lef">
</div>

此代码的jsfiddle可在 http://jsfiddle.net/7QJQn/

A jsfiddle with this code is available on http://jsfiddle.net/7QJQn/

推荐答案

这是

http:/ /jsfiddle.net/7QJQn/4/

http://jsfiddle.net/7QJQn/4/

我认为最好的解决方案是使用javascript / jQuery。

I think that the best solution for doing something like this is just using javascript / jQuery.

这篇关于让div填充中心容器旁边的空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆