CSS的某些基本知识点

By | 1月 24, 2018
1.消除<a>添加链接后显示的蓝色文字和下划线
a{

 text-decoration: none;

 color: #000000;

 }
 2.设置文字字体、大小、粗细
font: "微软雅黑", arial; #字体被设置为微软雅黑,下行同理。
 (font: "microsoft yahei", arial;) #
 font-sixe: 15px; #字体大小。
 font-weight: 500px; #字体粗细
 (weight值:100-900,lighter(细体),normal(等同于400,正常),bold(等同于700,粗体),bolder(超粗体),inherit(继承父类))
3.实现文字在<div>标签中居中对齐
假设行高 weight = 50px; 
设置line-weight = 50px;
4.设置两个<div>标签在同一行
display: inline-block;

5.设置背景图片

background:url(../images/footer-b.png); #具体的url根据实际情况

6.设置<div>标签或其他水平居中

marign:0 auto;

7.margin属性

 

margin:1px 2px 3px 4px; #四个属性按照顺时针分别为上边距、右边距、下边距、左边距。

margin: 2px 4px; #上下边距为2px, 左右边距为4px。

margin: 3px; #上下左右边距都为3px.

 

发表评论

您的电子邮箱地址不会被公开。