- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有两个 div,leftSide 和 rightSide,它们的父元素是 innerContainer。我已将两个 div 都 float 到左侧。它们并排出现,但右侧 div 未覆盖父 div 的剩余空间。
我尝试使用 overflow:hidden 并指定了宽度,但它仍然具有相同的宽度。
我的CSS:
#container {
overflow:auto;
margin:10px auto;
}
#innerContainer{
margin:10px auto;
width:1200px;
background:#FFFFFF;
border:2px solid #09F;
overflow:auto;
}
#leftSide{
overflow:auto;
float:left;
width:700px;
border:3px solid #F00;
}
#topheaderProfile{
margin:5px;
border:1px solid #F00;
}
#middleCompanyDescription{
margin:5px;
border:1px solid #333;
}
#Profile{
text-align:left;
}
.ProfileBox{
padding:10px;
cursor:pointer;
overflow:hidden;
text-align:left;
word-break:break-all;
word-wrap:break-word;
}
.CompanyLogo{
float:left;
padding:5px;
}
.rightCover{
overflow:auto;
padding:1px;
}
.companyTitle{
color:#36F;
font-size:24px;
overflow:hidden;
}
.companyTitle a{
text-decoration:none;
}
.CompanyRating{
float:left;
margin-top:3px;
}
.Companylikedicon{
overflow:hidden;
float:right;
margin-left:10px;
}
.Companycommenticon{
float:right;
margin-right:10px;
}
.CompanySlogan{
color:#999;
word-break:break-all;
word-wrap:break-word;
clear:both;
}
#rightSide{
width:100px;
border:1px solid #000;
}
我的 HTML:
<div id="container">
<div id="innerContainer">
<div id="leftSide">
<div id="topheaderProfile">
<div id='Profile'>
<div class='ProfileBox'>
<div class='CompanyLogo'><img src='../Images/defaultPic.jpg' width='90' height='90'/></div>
<div class='rightCover'>
<div class='companyTitle'>My Company</div>
<div class='CompanyRating'>
Rating : <img src='../Images/FilledStar.png' width='20' height='20' id='Star1' />
<img src='../Images/EmptyStar.png' width='20' height='20' id='Star2' />
<img src='../Images/EmptyStar.png' width='20' height='20' id='Star3' />
<img src='../Images/EmptyStar.png' width='20' height='20' id='Star4' />
<img src='../Images/EmptyStar.png' width='20' height='20' id='Star5' />
</div>
<div class='Companylikedicon'><img src='../Images/LikedIcon.png' width='25' height='25' /> 100</div>
<div class='Companycommenticon' ><img src='../Images/comment.png' width='25' height='25' /> 100</div>
<div class='CompanySlogan'>This is the best offer you get 2Rs. off in the besaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaat underwear of the worldffer you get 2Rs. off in the besaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaat underwear of the world.</div>
</div>
</div> <!--ProfileBox-->
</div>
</div><!--TopHeeaderProfile-->
<div id="middleCompanyDescription">
sadasdsad
</div>
</div> <!--LeftSide-->
<div id="rightSide">
sadasdasdasd
</div>
</div>
</div>
好的,我找到了问题。还有另一个 css 文件包含与此文件中相同的 id 名称。这是导致问题的原因。该文件的属性正在此处应用。感谢大家的帮助。
最佳答案
I tried using overflow:hidden and also specified the width but still it is of the same width.
如果您希望#rightSide
填充剩余空间,请使用overflow: hidden
但不要指定任何width
。
参见: http://jsfiddle.net/thirtydot/Yuxzs/
#rightSide {
overflow: hidden;
border: 1px solid #000;
}
关于css 两个 div 向左浮动。右侧 div 未覆盖剩余空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10553017/
在 Vim 中,是否可以将窗口“移动”到左侧或右侧?例如,类似于 r或 x ,但是左/右而不是上/下? 例如,如果我有这个布局: +---+---+---+ | | +---+ | A +--
我有一系列枚举的网页,目前每个页面上都有一个向左和向右箭头图标,用于导航到该系列中的上一页/下一页。 我的问题:实现向左/向右滑动手势以执行相同操作的最简单(!)方法是什么? (没有其他手势 - 请不
在我的网站上,我有三个 div、一个标题、一个主要内容和右侧的侧边栏。侧边栏是实际问题。我希望侧边栏始终位于浏览器窗口的右侧,如果用户调整窗口大小使宽度低于主栏和侧边栏,则侧边栏会停在主要内容的左边缘
请访问http://lindseymotors.com/v然后单击银色卡车顶部的照片。当展开的 View 弹出时,主照片下方有一排照片。当您点击它们时,它会切换到该照片并在您选择的图像上方显示“正在查
请看一下这个 DEMO 。 使用 this post 中的代码我已成功通过单击左侧或右侧链接使图像水平移动。 我想要实现的是以某种方式使图像跳跃更平滑。 这是我的代码: var scroll
我正在尝试向子菜单添加一个不错的小效果,但我不能使用 marginLeft,因为它会弄乱容器。所以我试图通过使用 left 而不是 marginLeft 来实现它,但我无法让它工作......任何想法
我有一个日历,我想让左右滑动和切换月份成为可能。 是否有任何听众向左/向右滑动? 谢谢! 最佳答案 您可以像下面的示例一样使用 SimpleOnGestureListener:(显然,将 toast
我正在尝试实现一个ng-repeats 水平用户媒体对象的小部件,我应该能够向左/向右滑动以显示下一张媒体卡。小部件应该看起来像这样 如图所示 下一张卡片头像是半可见的,暗示还有更多卡片可以刷。 这就
我正在创建一个显示多个“页面”内容的应用程序。通常,这代表基于桌面的应用程序上的选项卡。 在 android 上,我希望能够在屏幕上的任意位置使用手指在信息选项卡之间轻拂。这些选项卡的内容将只是 XM
我正在使用: ViewController = [[ViewControllerClass alloc] initWithNibName:@"ViewControllerClass" bundle:[
这个问题已经存在: How to make this into a sliding left/right div 已关闭10 年前。 下面提供的是我的 html 和 css 代码的片段,我不仅需要在
尝试将 h3 向左滑动,p 向右滑动,.info 从下到上滑动 slider .实际上它在没有 jQuery 的 Chrome 和 Opera 中工作得很好,因为我使用了 Animate.css,但它
我发现这个很好的进度条 CSS 动画。 但我想transform: translate而不是left/right。 如何切换到 transform 它?我试过了,但它不起作用: https://cod
我想用 bootstrap 创建一个表,并在列中插入一些左拉和右拉的内容: http://jsfiddle.net/Zoker/sgdfgkvL/ Some content Some
我怎样才能得到 重叠并停在 Logo 的左边缘?当屏幕宽度扩展时,我试图让绿色条向左扩展,但我希望它停在 Logo 的左边缘。 我试过了 position: absolute;在 #green_bar
试图将这个“手势”功能添加到我的第一个程序中,几乎我所做的每一次搜索都来到了这个线程: Fling gesture detection on grid layout 我能够让它工作..但就我而言,我不
我有带 tablayout 的 viewpager,在 ViewPager 内部我有一个正在创建 RecyclerView 的 fragment , 在 RecyclerVIew roe 项目中,我创
我一直在研究图片库 [html5],它在桌面版本中运行良好,我想为 Ipad/平板电脑设备添加基于触摸的事件。 您能否建议如何使用 javascript/jquery 添加基于触摸的事件。 谢谢,斯里
所以我想通过将盒子相乘然后去掉下半部分来使盒子向各个方向移动。向上和向右有效,但向下和向左无效。单击 4 个按钮中的 1 个即可调用这些功能。基本的 CSS 和 HTML。我该如何解决这个问题? va
我已经像这样创建了一个 RecyclerView ItemTouchHelper - public class MyItemTouchHelper extends android.support.v7
我是一名优秀的程序员,十分优秀!