新手学HTML+CSS

新手学HTML+CSS

4 (21人评价)
  • 课时:(21)

  • 学员:(1260)

  • 浏览:(30300)

  • 加入课程

新手学HTML+CSS 12的笔记

相关课时: 笔记详情:

CSS 标签性语言

***连接样式表

*连接外部样式表

<head>中

<link href="XXX.css" rel="stylesheet" type="text/css" />

</head>

*链接内部样式表

=》样式表内容写在头部标签内

<head>

<style type="text/css">

<!--

 

/*zhe shi yang shi biao zhu shi */

 

-->

</style>

 

*链接行内样式表

body 内加css属性

e.g 11.3 div in body

 

***选择器

CSS样式表里定义出来的可供HTML选择使用的名字,通过调用, HTML可以根据内容的不同,而选择不同的样式来作为内容的修饰

*派生选择器

HTML主体绑定

<head>

...

<style type="text/css">

<!--

td span(color: #0000ff:)

/* ... */

 

-->

</style>

</head>

<body>

<table>

          <tr>

                  <td><span>这里使用了样式</span>这里没有</td>

</table>

</body>

*id选择器

body标签内用id连接样式表

<head>

...

<style type="text/css">

<!--

td span(color: #0000ff:)

#file1( color: #rr0000;)

/* ... */

 

-->

</style>

</head>

<body>

<table>

          <tr>

                  <td><span>这里使用了样式</span>, 这里<div id=:file1:>没有</td>

</table>

</body>

*类选择器

相比id可反复使用

<head>

...

<style type="text/css">

<!--

td span(color: #0000ff:)

#file1( color: #rr0000;)

。file2( color:#rr00rr;>

/* ... */

 

-->

</style>

</head>

<body>

<table>

          <tr>

                  <td><span>这里使用了样式</span>, 这里<div id=:file1:>没有</div>

<div class=:file2">这是类选择器</div></td>

</table>

</body>

***CSS 优先权

就近原则

Spexificity

***CSS框架模型

内编剧,外边距

0 0

你感兴趣的课程

2万+浏览/ 92学员/ 5评分
免费
2万+浏览/ 580学员/ 4.7评分
免费
编程开发 Dreamweaver CS5教程
2万+浏览/ 416学员/ 4.2评分
免费