- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我试图保持相同的样式(摘要描述和摘要标题)。我希望包含 Apple、Banana 和 Carrot 文本的 div 全部居中。
我想让西瓜文字保持左对齐。
我将如何完成这个?
查看我的 jsfiddle:http://jsfiddle.net/p28Qz/12/
<div id="wrapper-threecol">
<div id="threecol_row">
<div class="threecol_cell1">
<p class="summary-headline">Apple</p>
<p class="summary-description">Apple designs and creates iPod and iTunes, Mac laptop and desktop computers, the OS X operating system, and the revolutionary iPhone and iPad</p>
</div>
<div class="threecol_cell2">
<p class="summary-headline">Banana</p>
<p class="summary-description">Apple designs and creates iPod and iTunes, Mac laptop and desktop computers, the OS X operating system, and the revolutionary iPhone and iPad</p>
</div>
<div class="threecol_cell3">
<p class="summary-headline">Carrot</p>
<p class="summary-description">Apple designs and creates iPod and iTunes, Mac laptop and desktop computers, the OS X operating system, and the revolutionary iPhone and iPad</p>
</div>
</div>
</div>
<div class="wrapper-data">
<div class="data_row">
<div class="data_cell1_lt">
<p class="summary-headline">Watermelon</p>
<p class="summary-description">We here at the National Watermelon Promotion Board have one goal: to increase consumer demand for fresh watermelon through promotion.</p>
</div>
<div class="data_cell2_lt"> </div>
<div class="data_cell3_lt"><img alt="New Search Field" height="273" src="http://www.juicing-for-health.com/wp-content/uploads/2012/06/watermelon.jpg" width="420" /></div>
</div>
</div>
#wrapper-threecol {
position:relative;
width:100%;
border: none;
margin: 20px 0 37px 0;
}
#threecol_row {
height:100%;
white-space:nowrap;
}
.threecol_cell1, .threecol_cell2, .threecol_cell3 {
height:100%;
width:30%;
display:inline-block;
white-space:normal;
vertical-align: top;
margin-left: 5%;
}
.threecol_cell1{
margin-left: 0;
}
.summary-headline {
color: #232323;
font-family: Helvetica, Arial, sans-serif;
font-size: 20px;
line-height: 24px;
margin:0 0 10px 0;
text-align: left;
}
.summary-description {
color: #232323;
font-family: Helvetica, Arial, sans-serif;
font-size: 13px;
line-height: 23px;
margin: 0;
text-align: left;
}
.wrapper-data {
position:relative;
width:100%;
border: none;
margin: 40px 0 0 0;
overflow: hidden;
}
.data_row {
height:100%;
min-height:100%;
white-space:nowrap;
display:table;
width: 100%;
}
/* Landing Data - Left Content */
.data_cell1_lt {
width:47%;
white-space:normal;
display:table-cell;
vertical-align:middle;
}
.data_cell2_lt {
width:6%;
display:table-cell;
white-space:normal;
}
.data_cell3_lt {
width:47%;
display:table-cell;
white-space:normal;
}
.data_cell3_lt img {
display:block;
margin:0 auto;
}
.data_cell3_lt p {
text-align:center;
}
最佳答案
您缺少 rtecenter 的定义:
.rtecenter {text-align: center;}
然后确保也将它添加到您的第一个 block 中:
<p class="summary-headline rtecenter">Apple</p>
关于html - 将 Apple、Banana 和 Carrot div 中的所有文本居中的最佳做法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25000674/
我正在使用 Carrot Search FoamTree 代码将超链接添加到我的 html 页面。这是我的代码: // Initialize FoamTree after the whole p
我对应该使用哪一个有点困惑。我认为任何一种都可以,但哪一种比另一种更好或更合适? http://github.com/ask/carrot/tree/master http://github.com/
我有兴趣学习以智能、优雅的方式在整个站点中构建导航项,这些导航项具有胡萝卜,单击后会展开菜单项列表。 我希望动态构建菜单项(不一定全部使用 ajax)。但它们不应在页面上进行硬编码。 这似乎是像 TW
我试图保持相同的样式(摘要描述和摘要标题)。我希望包含 Apple、Banana 和 Carrot 文本的 div 全部居中。 我想让西瓜文字保持左对齐。 我将如何完成这个? 查看我的 jsfiddl
我是一名优秀的程序员,十分优秀!