css背景(背景属性在一条声明之中)
<!DOCTYPE html> <html> <head> <style> body { background: #ffffff url("/i/photo/tree.png") no-repeat right top; margin-right: 200px; } </style> </head> <body> <h1>background 属性</h1> <p>background 属性是在一条声明中指定所有背景属性的简写属性。</p> <p>在这里,背景图像只显示一次,并位于右上角。</p> <p>我们还添加了右外边距,以使文本不会覆盖背景图片。</p> </body> </html>
css边框类型
<!DOCTYPE html> <html> <head> <style> p.dotted {border-style: dotted;} p.dashed {border-style: dashed;} p.solid {border-style: solid;} p.double {border-style: double;} p.groove {border-style: groove;} p.ridge {border-style: ridge;} p.inset {border-style: inset;} p.outset {border-style: outset;} p.none {border-style: none;} p.hidden {border-style: hidden;} p.mix {border-style: dotted dashed solid double;} </style> </head> <body> <h1>border-style 属性</h1> <p>此属性规定要显示的边框类型:</p> <p class="dotted">点状边框。</p> <p class="dashed">虚线边框。</p> <p class="solid">实线边框。</p> <p class="double">双线边框。</p> <p class="groove">凹槽边框。</p> <p class="ridge">垄状边框。</p> <p class="inset">3D inset 边框。</p> <p class="outset">3D outset 边框。</p> <p class="none">无边框。</p> <p class="hidden">隐藏边框。</p> <p class="mix">混合边框。</p> </body> </html>
边框颜色
<!DOCTYPE html> <html> <head> <style> p.one { border-style: solid; border-color: #0000ff; } p.two { border-style: solid; border-color: #ff0000 #0000ff; } p.three { border-style: solid; border-color: #ff0000 #00ff00 #0000ff; } p.four { border-style: solid; border-color: #ff0000 #00ff00 #0000ff rgb(250,0,255); } </style> </head> <body> <p class="one">一种颜色的边框!</p> <p class="two">两种颜色的边框!</p> <p class="three">三种颜色的边框!</p> <p class="four">四种颜色的边框!</p> <p><b>注释:</b>如果单独使用,"border-color" 属性不起作用。请首先使用 "border-style" 属性来设置边框。</p> </body> </html>