本节课第一节我们轮播图的下方,设计一个内容介绍,内容介绍分两部分,本次为上半部分。
一.首页内容介绍
对应的 CSS 部分
body {
font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft YaheiUI", "Microsoft YaHei", SimHei, "\5B8B\4F53", simsun, sans-serif;
}
.tab-h2 {
font-size: 20px;
color: #0059B2;
text-align: center;
letter-spacing: 1px;
}
.tab-p {
font-size: 15px;
color: #999;
text-align: center;
letter-spacing: 1px;
margin: 20px 0 40px 0;
}
.tab1 {
margin: 30px 0;
color: #666;
}
.tab1 .media-heading {
margin: 5px 0 20px 0;
}
.tab1 .text-muted {
color: #999;
text-decoration: line-through;
}
.tab1 .media-heading {
margin: 5px 0 20px 0;
}
.tab1 .text-muted {
color: #999;
text-decoration: line-through;
}
.tab1 .col {
padding: 20px;
}
/* 小屏幕(平板,大于等于 768px) */
@media (min-width: 768px) {
.tab-h2 {
font-size: 26px;
}
.tab-p {
font-size: 16px;
}
}
/* 中等屏幕(桌面显示器,大于等于 992px) */
@media (min-width: 992px) {
.tab-h2 {
font-size: 28px;
}
.tab-p {
font-size: 17px;
}
}
/* 大屏幕(大桌面显示器,大于等于 1200px) */
@media (min-width: 1200px) {
.tab-h2 {
font-size: 30px;
}
.tab-p {
font-size: 18px;
}
}
现在我们制作一下首页内容介绍的下半部分。
一.首页内容介绍
先完成底部的 footer
底部 CSS
立即学习“Java免费学习笔记(深入)”;
#footer {
padding: 20px;
text-align: center;
background-color: #eee;
border-top: 1px solid #ccc;
}
//两段内容
![]()
强大的学习体系
经过管理学大师层层把关、让您的企业突飞猛进。
![]()
完美的管理方式
最新的管理培训方案,让您的企业赶超同行。
CSS 部分
.tab2 {
background: #eee;
padding: 60px 20px;
text-align: center;
}
.tab2 img {
width: 40%;
height: 40%;
}
.tab3 {
padding: 40px 0;
text-align: center;
}
.tab3 img {
width: 65%;
height: 65%;
}
.text h3 {
font-size: 20px;
}
.text p {
font-size: 14px;
}
/* 小屏幕(平板,大于等于 768px) */
@media (min-width: 768px) {
.text h3 {
font-size: 22px;
}
.text p {
font-size: 15px;
}
.tab2-text {
float: left;
}
.tab2-img {
float: right;
}
}
/* 中等屏幕(桌面显示器,大于等于 992px) */
@media (min-width: 992px) {
.text h3 {
font-size: 24px;
}
.text p {
font-size: 16px;
}
.tab2-text {
float: left;
}
.tab2-img {
float: right;
}
}
/* 大屏幕(大桌面显示器,大于等于 1200px) */
@media (min-width: 1200px) {
.text h2 {
font-size: 26px;
}
.text p {
font-size: 18px;
}
.tab2-text {
float: left;
}
.tab2-img {
float: right;
}
}
JS 控制垂直居中
$('.text').eq(0).css('margin-top', ($('.auto').eq(0).height() - $('.text').eq(0).height()) / 2 + 'px');
$(window).resize(function() {
$('.text').eq(0).css('margin-top', ($('.auto').eq(0).height() - $('.text').eq(0).height()) / 2 + 'px');
});
$('.text').eq(1).css('margin-top', ($('.auto').eq(1).height() - $('.text').eq(1).height()) / 2 + 'px');
$(window).resize(function() {
$('.text').eq(1).css('margin-top', ($('.auto').eq(1).height() - $('.text').eq(1).height()) / 2 + 'px');
});
更多内容可以参考:Bootstrap学习教程
以上就是Bootstrap首页内容介绍的全部内容,希望大家喜欢,之后还会有更多精彩的内容呈现,不要错过。











