摘要:1 <html> 2 <head> 3 <style type="text/css"> 4 p.ex1 5 { 6 font:italic arial,sans-serif; 7 } 8 9 p.ex210 {11 font:italic bold 12px/30px arial,sans-serif;12 }13 </style>14 </head>15 16 <body>17 <p class="ex1">18 This is a paragraph. This is
阅读全文
摘要:<1>.异体font-variant属性可以设定小型大写字母。小型大写字母不是一般的大写字母,也不是小写字母,这种字母采用不同大小的大写字母。 1 <html> 2 <head> 3 <style type="text/css"> 4 p.normal {font-variant:normal} 5 p.small {font-variant: small-caps} 6 </style> 7 </head> 8 9 <body>10 <p class="normal&quo
阅读全文
摘要:首先来了解一下CSS字体:通用字体系列前面讨论过,实际上相同的字体可能有很多不同的称呼,不过 CSS 迈出了勇敢的一步,力图帮助用户代理把这种混乱状况理清楚。我们所认为的“字体”可能有许多字体变形组成,分别用来描述粗体、斜体文本,等等。例如,你可能已经对字体 Times 很熟悉。不过,Times 实际上是多种变形的一个组合,包括 TimesRegular、TimesBold、TimesItalic、TimesOblique、TimesBoldItalic、TimesBoldOblique,等等。Times 的每种变形都是一个具体的字体风格(font face),而我们通常认为的 Times 是
阅读全文
摘要:<1>字母大小写 1 <html> 2 <head> 3 <style type="text/css"> 4 h1 {text-transform: uppercase} 5 p.uppercase {text-transform: uppercase} 6 p.lowercase {text-transform: lowercase} 7 p.capitalize {text-transform: capitalize} 8 </style> 9 </head>10 11 <body>12
阅读全文
摘要:<1>.对齐文本 1 <html> 2 <head> 3 <style type="text/css"> 4 h1 {text-align: center} 5 h2 {text-align: left} 6 h3 {text-align: right} 7 </style> 8 </head> 9 10 <body>11 <h1>这是标题 1</h1>12 <h2>这是标题 2</h2>13 <h3>这是标题 3</h3&g
阅读全文
摘要:<1>.用比例设置行间距 1 <html> 2 <head> 3 <style type="text/css"> 4 p.small {line-height: 90%} 5 p.big {line-height: 200%} 6 </style> 7 </head> 8 9 <body>10 <p>11 这是拥有标准行高的段落。12 在大多数浏览器中默认行高大约是 110% 到 120%。13 这是拥有标准行高的段落。14 这是拥有标准行高的段落。15 这...
阅读全文
摘要:CSS设置文本字符间的距离 1 <html> 2 <head> 3 <style type="text/css"> 4 h1 {letter-spacing: -0.5em} 5 h4 {letter-spacing: 20px} 6 </style> 7 </head> 8 9 <body>10 <h1>This is header 1</h1>11 <h4>This is header 4</h4>12 </body>13 </htm
阅读全文
摘要:<1>.设置文本颜色 1 <html> 2 <head> 3 <style type="text/css"> 4 body {color: red} 5 h1 {color: #00ff00} 6 p.ex {color: rgb(0,0,255)} 7 </style> 8 </head> 9 10 <body>11 <h1>这是 heading 1</h1>12 <p>这是一段普通的段落。请注意,该段落的文本是红色的。在 body 选择器中定义了本页面
阅读全文
摘要:<1>.默认设置下的背景图片 1 <html> 2 <head> 3 <style type="text/css"> 4 body {background-image: url(这个地方要写的就是你的图片的url地址了);} 5 </style> 6 </head> 7 8 <body> 9 </body>10 </html>那个url地址的填写该如何去做呢?比如你在E盘中新建了一个文件夹My Web,当然你的站点就是建在这里了。而在My Web中你又新建了一个文件夹
阅读全文
摘要:<1>.设置body的背景颜色 1 <html> 2 <head> 3 <style type="text/css"> 4 body {background-color: yellow} 5 h1 {background-color: #00ff00} 6 h2 {background-color: transparent} 7 p {background-color: rgb(250,0,255)} 8 p.no2 {background-color: gray; padding: 20px;} 9 ...
阅读全文