. NET Learning notes----2015-07-14 (a detailed description of style attributes in CSS)

Source: Internet
Author: User

CSS has a very large number of properties, which can be broadly divided into the following categories: Font, background, text, location, layout, Edge, List

1), Font

Font properties mainly include the text font, size, color, display effect and other basic styles. The following is a detailed description of the various font properties

Font-family: This property is used to set the font family

Font-size: This property defines the size of the text, you can use the units of measure to set the size of the font, or you can use a relative font size. You can also use an absolute size tag.

The absolute size is set to either Xx-small, X-small, small, medium, large, x-large, or Xx-large. Xx-small minimum, xx-large for maximum

Font-style: This property is used to define a font style of normal, italic, or oblique (italic)

Text-decoration: This property is used to underline, underline, underline, and blink effects in text

Font-weight: This property is used to set the point size of a bold word

The values for this property are: Normal, bold, bolder, Ligthter, 100-900

<!DOCTYPE HTML><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"/>    <title></title>    <styletype= "Text/css">#p1{font-family:DFKAI-SB;        }#p2{font-size:Xx-small;        }#p3{Font-style:Italic;        }P.P4{Border-top:Dashed;Border-left:dotted;Border-bottom:Double;        }P.P5{Font-weight:Bolder;        }    </style></Head><Body>    <PID= "P1">Short hair, Stephen, illegal income, see Dallas.</P>    <PID= "P2">Short hair, Stephen, illegal income, see Dallas.</P>    <PID= "P3">Short hair, Stephen, illegal income, see Dallas.</P>    <Pclass= "P4">Short hair, Stephen, illegal income, see Dallas.</P>    <Pclass= "P5">Short hair, Stephen, illegal income, see Dallas.</P></Body></HTML>

2), background

Backgrounds include background color, background image, and background image control.

Background-color: Set background color, transparent transparent background color

Background-image: Setting the background picture of an element

Background-repeat: Determine if and how the background image repeats

The value of this property No-repeat: Indicates that the background image appears only once in the display area of the element

Repeat: Vertical in horizontal and vertical direction

Repeat-x and repeat-y are repeated horizontally or vertically, respectively.

Background-attachment: Determines whether the background image follows content scrolling,

When set to fixed, represents a pinned background image, scroll represents the movement of the image following the content

Background-position: Specifies the horizontal and vertical position of the background image

The horizontal position value can be left, center, right. It can also be a numeric value

The vertical value can be top, center, right or numeric

Document Flow:

<! DOCTYPE html>

3), text

Attributes of text include: text spacing, alignment, superscript, subscript, arrangement, first line indent

Word-spacing: Set the spacing between words

Letter-spacing: Set the spacing between characters

Text-align: Sets the horizontal alignment of the text, with the value can be left, right, center, Justfy

<!DOCTYPE HTML><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Head>    <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" />    <title></title>    <styletype= "Text/css">P.P1{word-spacing:10px;letter-spacing:20px;        }. P2{text-align:Center;text-indent:15px;Line-height:40px;Background-color:Red;        }    </style></Head><Body>    <Pclass= "P1">Abcdefghijklmnopqrstuvwxyz</P>    <Pclass= "P2">font properties mainly include the text font, size, color, display effect and other basic styles. The following is a detailed description of the various font properties font-family: This property is used to set the font family font-size: This property defines the size of the text, you can use the units of measure to set the size of the font, or you can use a relative font size.        You can also use an absolute size tag. The absolute size is set to either Xx-small, X-small, small, medium, large, x-large, or Xx-large. Xx-small minimum, Xx-large is the maximum Font-style: This property is used to define a font style of normal, italic, or oblique (italic) Text-decoration: This property is used to underline, underline, and Underline, Flicker effect Font-weight: This property is used to set the point size of a bold character the value of this property is: Normal, bold, bolder, Ligthter, 100-900</P></Body></HTML>

 

. NET Learning notes----2015-07-14 (a detailed description of style attributes in CSS)

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.