在一个HTML表中,cellpadding并cellspacing可以设置是这样的:
<table cellspacing="1" cellpadding="1">
Run Code Online (Sandbox Code Playgroud)
如何使用CSS完成同样的工作?
我有一个位置的元素:固定,因此滚动页面我不知道如何.当用户向上滚动时,我希望元素在某一点停止滚动,比如当它距离页面顶部250px时,这可能吗?任何帮助或建议都会有所帮助,谢谢!
我有一种感觉,我需要使用jquery这样做.我尝试获取用户所在位置的滚动或位置,但真的很困惑,是否有任何jquery解决方案?
我有一个长div容器设置为display:table和&divs设置为display:table-cell; vertical-align: middle.
我对垂直对齐的结果非常满意,但是:
float: right不起作用display: table-cell.这是一个例子(我想将金色div浮动到右边).我不能用JS.如果IE7不可能,我需要它在IE7 +或IE8 +中工作.任何提示/想法?
您好,我在尝试让我的子 div 扩展到其所在父 div 的高度时遇到问题。
这是父 div 的 css
#wrapper #content {
border: 1px ridge #999;
height: auto;
min-height: 1000px;
width: 1100px;
margin-top: 40px;
margin-right: auto;
margin-bottom: 30px;
margin-left: auto;
float: left;
}
Run Code Online (Sandbox Code Playgroud)
这是子 div 的 css
.tab_container {
clear: both;
width: 100%;
border-right: 1px ridge #999;
margin-bottom: 20px;
height: 100%;
}
Run Code Online (Sandbox Code Playgroud)
有什么想法我能做什么吗?
我试图使这些信息块的大小相同,而不管每个信息的数量.如示例所示,当一个块的文本少于另一个块时,一个块变小,另一个块保持不同的大小.
现在我的问题是,无论内容或图像如何,我如何实现这些块的大小相同?我也将在他们下方使用另一对.

这是CSS代码:
/***********All containers**************/
.bottomContainers{
position: absolute;
margin-left: 0%;
display: inline-box;
}
/**********Small Containers*************/
.container{
max-width: 30%;
max-height: 30%;
margin-top:5%;
margin-bottom: 5%;
margin-left: 10%;
padding-left: 2%;
padding-right: 2%;
padding-bottom: 2%;
background-color: #ecf0f1;
color: grey;
display: inline-block;
/*display: inline-block;*/
border-radius: 5px;
border-bottom: 2px solid grey;
}
Run Code Online (Sandbox Code Playgroud)
这是HTML代码:
<div class="bottomContainers" role="moreInfo">
<!--Small Inner Containers for Information-->
<div class="container" id="firstContainer">
<br />
<center><img src="img/map.png"></center>
<br>
<article>
Some random text is in this block, It doesnt size like the next one
</article>
</div> …Run Code Online (Sandbox Code Playgroud) 我想在我的css表中使用百分比.不幸的是,它对我不起作用.
这段代码出了什么问题?我应该使用flexbox而不是table吗?
我想用表,因为我想要相同的高度列.
ul {
list-style: none;
margin: 0;
display: table;
table-layout: fixed;
width: 100%;
}
li {
width: 50%;
display: table-cell;
}Run Code Online (Sandbox Code Playgroud)
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
</ul>Run Code Online (Sandbox Code Playgroud)
我正在使用带有2列布局的Bootstrap 3.右栏是我的侧栏.我有不同的背景,我可以告诉我的侧边栏不会一直持续到主内容包装器的底部.在大多数情况下,右侧的主要内容比侧边栏内容长,但我不希望看到主要内容区域的背景,但侧边栏内容背景仍在继续.
这是我为了达到100%高度侧边栏而模仿的jsfiddle,但我似乎无法让它工作.
这是我的代码的要点:
<div id="content" class="clearfix row">
<div id="main" class="col-sm-8 clearfix" role="main">
<article id="post-1728" class="post-1728 page type-page status-publish hentry clearfix" role="article" itemscope="" itemtype="http://schema.org/BlogPosting">
<header>
<div class="page-header"><h1 class="entry-title" itemprop="headline">About</h1></div>
</header> <!-- end article header -->
<section class="post_content clearfix" itemprop="articleBody">
<p class="lead">LENGTHY CONTENT</p>
</section> <!-- end article section -->
<footer>
</footer> <!-- end article footer -->
</article> <!-- end article -->
</div> <!-- end #main -->
<div id="sidebar1" class="col-sm-4" role="complementary">
<div class="sidebar-content"></div>
</div>
<div style="clear:both">
</div>
Run Code Online (Sandbox Code Playgroud)
这是我的jsfiddle:
如果有人之前遇到过这个问题,那将会很棒.我看到很多LEFT侧边栏100%,但没有右边的Bootstrap.
谢谢.
无论如何我可以告诉 React 组件全屏显示并且背景颜色为绿色。下面的代码不会使高度为 100%。
var rootStyle = {
backgroundColor : 'green',
color : 'white',
height : '100%'
}
class App extends Component {
render() {
return (
<div style={rootStyle}>
<Poll />
</div>
);
}
}
Run Code Online (Sandbox Code Playgroud) .propertydetailbox2 {
overflow:auto;
border: 1px black solid;
}
.propertydetailtextbox {
width: 30%;
float:left;
border: 1px solid #cccccc;
border-radius: 8px;
margin: 0 auto;
margin-right:1%;
padding:20px;
padding-left:50px;
height: auto;
text-align:left;
}
.propertydetailagentbox {
width: 30%;
height: 100%;
float:left;
border: 1px solid #cccccc;
border-radius: 8px;
margin: 0 auto;
margin-left:1%;
padding:20px;
}Run Code Online (Sandbox Code Playgroud)
<div class ="propertydetailbox2">
<div class="propertydetailtextbox">1<br>2<br>3<br>4<br> </div>
<div class="propertydetailagentbox">1<br>2</div>
</div>Run Code Online (Sandbox Code Playgroud)
嗨我有一个容器,其中包含两个盒子(子盒子),我希望父母可以使用已经完成使用的最高孩子的高度overflow:auto;,然后我希望第二个孩子(很短)与父母一样高.我已经尝试过这里给出的各种解决方案CSS - 将float子DIV高度展开到父级的高度,但使用相对和绝对堆栈,子项相互重叠,并使用margin-bottom:-99999px; padding-bottom:99999px; 从底部切割第二个孩子的边界,我需要有响应的解决方案.
父母div
.propertydetailbox2 {
overflow:auto;
}
Run Code Online (Sandbox Code Playgroud)
child1
.propertydetailtextbox {
width: 30%;
float:left;
border: 1px solid …Run Code Online (Sandbox Code Playgroud) css ×8
html ×4
css-tables ×2
alignment ×1
css-float ×1
css3 ×1
flexbox ×1
html-table ×1
jquery ×1
positioning ×1
reactjs ×1
sidebar ×1
web ×1