CSS布局,div居中,文字居中
.main {
width: 100%;
margin: 0 auto;
.banner {
img {
width: 100%;
}
}
.article {
margin-bottom: 100px;
.title {
margin-top: 80px;
font-size: 36px;
font-weight: 500;
text-align: center;
}
.sub-title {
margin-top: 26px;
font-size: 18px;
font-weight: 400;
text-align: center;
color: #999999;
}
.slogan {
// 宽高
width: 1000px;
height: 82px;
// 布局
margin: 0 auto; /* div水平居中 */
margin-top: 30px;
text-align: center; /* 文字居中 */
line-height: 82px; /* 文字就垂直居中了 */
// 字体
font-size: 18px;
font-weight: 500;
// 其他
border-left: 1px solid #E6E6E6;
border-right: 1px solid #E6E6E6;
border-top: 1px solid #E6E6E6;
border-bottom: 4px solid #222222;
}
.content {
width: 1000px;
margin: 0 auto; /* div水平居中 */
margin-top: 60px;
font-size: 16px;
font-weight: 400;
color: #555555;
line-height: 32px;
p {
text-indent: 30px; /* 文本缩进 */
}
}
}
}
div居中
margin: 0 auto; /* div水平居中 */
文字居中
text-align: center; /* 文字居中 */
文字垂直居中
line-height: xxxpx; /* 文字就垂直居中了 */
CSS布局,div居中,文字居中的更多相关文章
- css一div内文字居中
在说到这个问题的时候,也许有人会问CSS中不是有vertical-align属性来设置垂直居中的吗?即使是某些浏览器不支持我只需做少许的CSS Hack技术就可以啊!所以在这里我还要啰嗦两句,CSS中 ...
- CSS实现DIV水平自适应居中
DIV水平自适应居中 <!DOCTYPE html> <html lang="cn"> <head> <meta charset=&quo ...
- CSS 之 div中文字超出时自动换行
在开发中很容易遇到div中文字超出的问题,在此总结以下方法: 1. white-space :属性设置如何处理元素内的空白.这个属性声明建立布局过程中如何处理元素中的空白符.所有浏览器都支 ...
- 不同CSS布局实现与文字鼠标选择的可用性——张鑫旭
by zhangxinxu from http://www.zhangxinxu.com本文地址:http://www.zhangxinxu.com/wordpress/?p=2401 一.文字选择的 ...
- CSS布局奇技淫巧:各种居中
居中是我们使用css来布局时常遇到的情况.使用css来进行居中时,有时一个属性就能搞定,有时则需要一定的技巧才能兼容到所有浏览器,本文就居中的一些常用方法做个简单的介绍. 注:本文所讲方法除了特别说明 ...
- CSS布局技巧之——各种居中
居中是我们使用css来布局时常遇到的情况.使用css来进行居中时,有时一个属性就能搞定,有时则需要一定的技巧才能兼容到所有浏览器,本文就居中的一些常用方法做个简单的介绍. 注:本文所讲方法除了特别说明 ...
- css布局之块上下左右居中
以下方案的通用代码: HTML code: <div class="box"> <div class="content"> <!- ...
- 关于css如何让图片文字居中的方法
在将父级转换为单元格形式时,设置的相关属性 可以达到如下效果:
- css实现div,文字水平居中的方案。
本文的目的为记录个人开发中常用的几种居中方案,以供大家参考. //basic css html, body { height: 100%; width: 100%; margin: 0; paddin ...
- css布局-多行文字垂直居中
方法一: 代码: <style> *{padding: ;margin:;font-size: 12px;} div{float: left;width: 200px;height:200 ...
随机推荐
- centos /usr/local 和/opt 安装软件你什么不同../configure --prefix=/usr...
/usr/local下一般是你安装软件的目录,这个目录就相当于在windows下的programefiles这个目录(所有文件在一个文件夹) /opt这个目录是一些大型软件的安装目录,或者是一些服务程 ...
- 1.二层常用技术-STP
1.STP定义: STP(Spanning Tree Protocol)是生成树协议的英文缩写.STP在IEEE 802.1D文档中定义,该协议的原理是按照树的结构来构造网络拓扑,消除网络中的环路,避 ...
- 封装打包Python脚本
1.前言 封装打包Python的好处,节省了安装各种各样包依赖的问题,同时可以加强我们代码隐私的安全性,这里我的演示环境是Python3.6 ,CentOS7的系统,同时打包工具采用pyinstall ...
- kafka背着你做了什么?
Kafka中有broker.主题.分区.副本等概念,底层有日志和日志分片. 我们先简单介绍一下这些概念,做个类比. broker可以简单理解为一台物理机,其实一台机器上可以有多个broker进程,但是 ...
- hdu 1541 (cdq分治)
Problem Description Astronomers often examine star maps where stars are represented by points on a p ...
- [CF套题] CF-1201
CF-1201 传送门 # = * A 500 B 1000 C 1500 D 2000 E1 2000 E2 1000 1 (2217) 1672 482 00:09 400 01:40 790 0 ...
- AtCoder Beginner Contest 183
第二次ak,纪念一下. 比赛链接:https://atcoder.jp/contests/abc183/tasks A - ReLU 题解 模拟. 代码 #include <bits/stdc+ ...
- zjnu1730 PIRAMIDA(字符串,模拟)
Description Sample Input 6 JANJETINA 5 1 J 1 A 6 N 6 I 5 E Sample Output 1 0 2 1 1 题意:给你一个长度小于等于10^6 ...
- 【noi 2.6_8471】切割回文(DP)
题意:给一个字符串,问至少切割几次使每子串都是回文的. 解法:f[i]表示前i个字符至少需要切割几次,预处理p[i][j]表示子串s[i]~s[j]是否为回文串.O(n^2) 另外,这题也类似&quo ...
- poj3083 Children of the Candy Cor
Description The cornfield maze is a popular Halloween treat. Visitors are shown the entrance and mus ...