HTML5样式和列表、CSS链接的四种状态_html/css_WEB-ITnose
Jun 24, 2016 am 11:32 AM
一、HTML5样式
1、标签:
:资源引用;
2、属性:
type="text/css":引入文档类型;
rel="stylesheet":外部样式表;
3、三种样式表插入方法:
(1)外部样式表:
在
中写入://href标签处引入文档的地址
(2)内部样式表:
在
中写入:
(3)内联样式表:
直接在标签内部写入,例如:
XXX
二、HTML5列表
标签 | 描述 |
有序列表 | |
无序列表 | |
列表项 | |
自定义列表 | |
自定义列表项 | |
描述 |
1、无序列表:
使用标签:
- 、
- ;属性(type):disc(默认的实体圆)、circle(空心圆)、square(实体方块)、none(什么都没有)
**若想去掉列表前面的圆点,还可用CSS样式:list-style-type:none**
2、有序列表:
使用标签:
- 、
- ;属性(type):A、a、I、i、start
3、自定义列表:
使用标签:
- 、
- 、
- (
- 、
- 一起使用表示对话)
三、CSS链接的四种状态
一般用标签表示链接,可以嵌入
表示跳转地址,其中 表示跳转到自己 链接有如下四种状态:
1、a:link 普通的、未被访问的链接
2、a:visited 用户已访问的链接
3、a:hover 鼠标指针位于链接的上方
4、a:active 链接被点击的时刻
eg:
1
1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
> 2 <html xmlns=
"http://www.w3.org/1999/xhtml"
> 3 <head> 4 <meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/> 5 <title>CSS链接状态</title> 6 <style type=
"text/css"
> 7 a:link,a:visited{ 8 color:#609; 9 text-decoration:none; //去掉下划线10 }11 a:hover,a:active{ 12 color:#C00;13 text-decoration:underline;14 }15 </style>16 </head>17 18 <body>19 <a href=
"http://www.baidu.com"
>百度一下,你就知道!</a><br />20 <a href=
"http://www.jikexueyuan.com"
>学知识就到极客学院!</a>21 </body>22 </html>
Copy after login效果:
(1)target="_blank":以前页面任然存在,在新的页面打开
(2)target="_self":在当前页面打开
(3)target="_parent":在父级空间打开
(4)target="_top":在顶级页面打开
(3)(4)是
**中还有name 属性,name 属性规定锚(anchor)的名称。可以使用 name 属性创建 HTML 页面中的书签,name可以用id来代替**
- ;属性(type):A、a、I、i、start

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Difficulty in updating caching of official account web pages: How to avoid the old cache affecting the user experience after version update?

How do I use HTML5 form validation attributes to validate user input?

How to efficiently add stroke effects to PNG images on web pages?

What is the purpose of the <iframe> tag? What are the security considerations when using it?

What are the security implications of using iframes, and how can I mitigate them?

How do I use the HTML5 <meter> element to display numerical data within a range?

What are the best practices for cross-browser compatibility in HTML5?

How do I use HTML links effectively for navigation and SEO?
