下载高清图:css常用属性和值(思维导图总结)
1.字体
<title>font</title> <style> h1{ font-family:times,courter; font-size:150% font-style:italic; font-variant:normal; font-weight:normal; } h2{ font-family:serif,times; font-size:1cm; font-style:normal; font-variant:small-caps; font-weight:900; } p{ font:oblique small-caps bold 1cm sans-serif; } </style> <h1 id="this-is-header-one">this is header one</h1> <h2 id="this-is-header-two">this is header two</h2> <p>this is a paragraph </p>
运行结果:
2.文本
<title>text</title> <style> h1{ letter-spacing:-3px; text-align:right; text-decoration:overline; } h2{ letter-spacing:0.5cm; text-align:center; text-decoration:line-through; } p{ text-align:left; text-decoration:underline; text-indent:1cm; text-transform:lowercase; } a{ /*去掉链接下划线*/ text-decoration:none; text-indent:0.8cm; text-transform:uppercase; } </style> <h1 id="this-is-header-one">this is header one</h1> <h2 id="this-is-header-two">this is header two</h2> <p>this is a paragraph </p> <a href="http://www.baidu.com">baidu</a>
运行结果:
3.背景
由于博主懒的去找背景的素材,所以运行之后,丑的不堪入目,不过重点没有错误嘛,大家关注代码所对应的效果就好了。
<title>background</title> <style> body{ background-color:yellow; background-image:url(a.png); background-repeat:repeat; background-attachment:fixed; } h1{ background-color:green; background-image:url(bb.png); background-repeat:repeat-x; background-position:bottom; } h2{ background-color:blue; } p{ background-image:url(bb.png); background-repeat:no-repeat; height:100px; background-position:center; } a{ background:red url(bb.png) no-repeat left center; padding:10px; }b </style> <h1 id="this-is-header-one">this is header one</h1> <h2 id="this-is-header-two">this is header two</h2> <p>this is a paragraph </p> <a href="http://www.baidu.com">aaaaaaaaaaaaaaaaa</a>
运行结果:
这张截图有点,看起来乱七八糟的,但是根据代码来找效果,也是很快的。很容易搞明白,每一句代码的意思。url就是自己随便哦添加的路径,大家不必在意。
4.边框(PS:加几句关于鼠标指针的代码)
<title>border</title> <style> div{ width:80px; height:25px; border-style:solid dotted; cursor:move; } h1{ border-style:solid double dashed inset; border-top-style:solid; border-right-style:double; border-bottom-style:dashed; border-left-style:inset; border-width:1px 2px 3px 4px; /* 设置边框第二种方式: border-top-width:1px; border-right-width:2px; border-bottom-width:3px; border-left-width:4px; */ border-color:red yellow green blue; cursor:wait; } h2{ border:3px solid green; /*会覆盖上面的border设置*/ border:1px dashed red; cursor:pointer; } </style> <div> aaaaaa </div> <h1 id="this-is-header-one">this is header one</h1> <h2 id="this-is-header-two">this is header two</h2>
运行结果:
当鼠标移到三个边框上时,鼠标指针会发生相应变化:分别变成移动,等待,还有小手的状态。具体参考
5.列表
<title>list</title> <style> </style>
- aaaaaaaaaaaaa
- aaaaaaaaaaaaa
- aaaaaaaaaaaaa
- aaaaaaaaaaaaa
- aaaaaaaaaaaaa
- aaaaaaaaaaaaa
- aaaaaaaaaaaaa
- aaaaaaaaaaaaa
- aaaaaaaaaaaaa
- aaaaaaaaaaaaa
- aaaaaaaaaaaaa
- aaaaaaaaaaaaa
运行结果:
截图中所显示的两个列表分别是一个无序列表和一个有序列表。
但是在以后的开发中,我们基本不会使用默认的图像,都是自定义列表前面的图像。style="list-style-type:none.这句代码就是将列表前的符号风格设置为空,然后我们就可以自行添加自己需要的图像了。
document.body.oncopy=function(){
event.returnValue=false;
var t=document.selection.createRange().text;
l4ever = parent.document.location;
var s=”本文来源: 李硕的专栏”;
var y=”原文地址:” + http://blog.csdn.net/wzqnls + ” “;
clipboardData.setData(’Text’,”+t+’\r\n’+s+’\r\n’+y+”);
}

在css中,可用list-style-type属性来去掉ul的圆点标记,语法为“ul{list-style-type:none}”;list-style-type属性可设置列表项标记的类型,当值为“none”可不定义标记,也可去除已有标记。

区别是:css是层叠样式表单,是将样式信息与网页内容分离的一种标记语言,主要用来设计网页的样式,还可以对网页各元素进行格式化;xml是可扩展标记语言,是一种数据存储语言,用于使用简单的标记描述数据,将文档分成许多部件并对这些部件加以标识。

在css中,可以利用cursor属性实现鼠标隐藏效果,该属性用于定义鼠标指针放在一个元素边界范围内时所用的光标形状,当属性值设置为none时,就可以实现鼠标隐藏效果,语法为“元素{cursor:none}”。

在css中,可以利用“font-style”属性设置i元素不是斜体样式,该属性用于指定文本的字体样式,当属性值设置为“normal”时,会显示元素的标准字体样式,语法为“i元素{font-style:normal}”。

在css中,rtl是“right-to-left”的缩写,是从右往左的意思,指的是内联内容从右往左依次排布,是direction属性的一个属性值;该属性规定了文本的方向和书写方向,语法为“元素{direction:rtl}”。

转换方法:1、给英文元素添加“text-transform: uppercase;”样式,可将所有的英文字母都变成大写;2、给英文元素添加“text-transform:capitalize;”样式,可将英文文本中每个单词的首字母变为大写。

在css3中,可以用“transform-origin”属性设置rotate的旋转中心点,该属性可更改转换元素的位置,第一个参数设置x轴的旋转位置,第二个参数设置y轴旋转位置,语法为“transform-origin:x轴位置 y轴位置”。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

SublimeText3汉化版
中文版,非常好用

适用于 Eclipse 的 SAP NetWeaver 服务器适配器
将Eclipse与SAP NetWeaver应用服务器集成。

VSCode Windows 64位 下载
微软推出的免费、功能强大的一款IDE编辑器

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)