CSS (cascading style sheets): Cascading Style Sheets
1. Image Replacement Technology
The following code means: Click on the Baidu logo image will jump to Baidu home page.
<style>. baidu{
/ * Width height definition picture width/height */width:154px height:30px Border:1px solid Black background:url (.. /... Baidu Logo.png) No repeat Overflow:hidden/*Beyond Hidden*/ }. Baidu a{Line-height:200px Display:block/*Sub-block*/ }</style><Body> <H1class= "Baidu"> <ahref= "Http://www.baidu.com">Baidu</a> </H1></Body>
2.sprite Chart (Sprite chart)
<style>/*pixel size to use PS to measure the image*/. Sprite{/*Define picture size*/width:100px height:80px background:url (.. /.. picture. jpg);background-position:-10px-20px; /*To make a picture move to a defined image size coincident*/ }. Sprite:hover{background-position:-60px-30px;/*show another picture when Mouse is moved in*/ }</style><Body><Divclass= "Sprite"></Div></Body>
3. Background
The following code shows a picture with a red background that starts with a 20s of time, and repeats on the browser.
<style>. Box{width:300px height:300px background:red No repeat center;Animation:Bian 20s Infinite; }@key frames Bian{from{Background:Red} to{background:Black} }
}</style><Body><Divclass= "box"></Div></Body>
4. Text
<style>. Text{Color:Green;font-size:40px;font-family:Fangsong;Font-weight: -;Font-style:Litalic;text-indent:30px; /*Text Indent*/letter-spacing:10px; /*Word spacing*/word-spacing:10px; /*Word spacing*/Line-height:20px;text-decoration:Underline; }. Text1{Text-transform:Capitalize/*capitalize the first letter of text in English*/ }</style><Body> <Pclass= "text">Learn the Web front end</P> <Pclass= "Text1">Learn Web</P></Body>
Basic CSS Learning