Basic CSS Learning

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.