shorthand for CSS (font and background)

Source: Internet
Author: User
Tags set background

Transferred from: http://blog.csdn.net/shenzhennba/article/details/7356095

1. Font properties mainly include the following:
font-family (font family): "Arial", "Times New Roman", "Song Body", "bold" and so on;
Font-style (font style): normal (normal), italic (italic), or oblique (italic);
Font-variant (font Change): normal (normal) or small-caps (small capital letters);
Font-weight (font bias): is normal or bold (bold). Some browsers even support the use of numbers from 100 to 900 (in hundred units);
Font-size (font size): Can be set in a number of different units (such as pixels or percentages), such as: 12xp,12pt,120%,1em

If you use the Font property, you can simplify several styles to reduce the number of books; The value of the Font property should be written in the following order (separated by a space between the attributes):
Font-style | Font-variant | Font-weight | Font-size | Font-family
For example:
. FONTSTYLE01 {
Font-style:italic;
Font-variant:normal
Font-weight:bold;
font-size:30px;
Font-family:arial, Sans-serif;
}
The above style is abbreviated as:
. FONTSTYLE01 {font:italic normal bold 12px Arial,verdana;}

2. Background
 background-color: #999999;//element background color
 background-image : url ( "Path/bgfile.gif"); Set background image
 background-repeat : repeat-x | repeat-y | repeat | no-repeat;//Set Repeat
  background-attachment : fixed | Scroll Sets the fixed way of the background picture
 background-position : x axis coordinates, y coordinate [top,bottom,center,left,right,20px,10%];   Sets the position of the upper-left corner of the background, in which the coordinates can be abbreviated as a percentage or a fixed unit

Background each value in the following order:
background-color | background-image  | Background-repeat | background-attachment | Background-position
    If you omit a property from being written out, the default value is automatically taken for it. For example, if you remove Background-attachment and background-position:
background: #FFCC66 URL ("butterfly.gif") no-repeat;
For example:
. bg01 {
   background-image:url ("Path/bgfile.gif");
   background-repeat:no-repeat;
   background-attachment:fixed;
   background-position:left top;
}

The above can be abbreviated as:
. BG01 {
Background: #FFCC66 URL ("path/bgfile.gif") no-repeat fixed left top;
}

shorthand for CSS (font and background)

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.