Div的宽度为100%,旁边的固定宽度为1 [英] Div with a width of 100%, next to a fixed width one

查看:164
本文介绍了Div的宽度为100%,旁边的固定宽度为1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,这个令人难以置信的愚蠢的问题,我觉得在大多数情况下我可以很容易做到这一点,但我现在使用sharepoint,试图做任何事情在这是地狱!



基本上,我有一个侧边导航(.menu垂直)是230px宽,和它旁边的一个div(.mainContent),我想(填充一边!)填充屏幕的其余部分。



不幸的是,有大约798个随机放置的div,跨度和其他任何代码,我似乎不能剥离,不打破网站,所以任何建议如何实现这一点将非常感谢,谢谢!

解决方案


基本上我有一个侧导航(.menu-vertical),宽度为230px
,其旁边的div(.mainContent),我想要
(填充一边!)填充屏幕的其余部分。



..



网站的基础是使用.container div和
.menu -vertical(fixed)and .mainContent(fluid,100%)divs inside。


根据我的理解,这个: http://jsfiddle.net/thirtydot/wv42t/



CSS



  .container {
border:3px固体#666;
overflow:hidden
}
.menu-vertical {
width:230px;
float:left;
padding:10px;
border:2px solid#f0f
}
.mainContent {
overflow:hidden;
padding:30px;
border:2px solid#00f
}



/ strong>

 < div class =container> 
< div class =menu-vertical> menu-vertical< / div>
< div class =mainContent> mainContent< / div>
< / div>


Sorry for the incredibly stupid question, I feel like in most circumstances I could do this easily, but I'm using sharepoint at the moment and trying to do anything in this is hell!

Basically I have a side navigation (.menu-vertical) that is 230px wide, and a div next to it (.mainContent) that I would like to (padding aside!) fill the rest of the screen.

Unfortunately there are around 798 randomly placed divs, spans and whatever else in the code too that I can't seem to strip without breaking the site, so any advice on exactly how to achieve this would be much appreciated, thank you!

解决方案

Basically I have a side navigation (.menu-vertical) that is 230px wide, and a div next to it (.mainContent) that I would like to (padding aside!) fill the rest of the screen.

..

the basis of the site is in place with a .container div, and the .menu-vertical (fixed) and .mainContent (fluid, 100%) divs inside.

From what I understand, you're looking for this: http://jsfiddle.net/thirtydot/wv42t/

CSS:

.container {
    border: 3px solid #666;
    overflow: hidden
}
.menu-vertical {
    width: 230px;
    float: left;
    padding: 10px;
    border: 2px solid #f0f
}
.mainContent {
    overflow: hidden;
    padding: 30px;
    border: 2px solid #00f
}

HTML:

<div class="container">
    <div class="menu-vertical">menu-vertical</div>
    <div class="mainContent">mainContent</div>
</div>

这篇关于Div的宽度为100%,旁边的固定宽度为1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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