CSS borders and common styles

Source: Internet
Author: User

First, CSS settings style

  1.1 Border border

Function: Set the border around the label, method board: Width style color, Normal style using solid solid, and dotted dashed

<Head>    <MetaCharSet= "UTF-8">    <title>CSS Border</title>    <style>. C1{Border:1px solid Red;        }    </style></Head><Body><Divclass= "C1">It's a nice day today.</Div></Body>
Border

There are also Border-top,border-left,border-right,border-bottom, the top of the border, the border to the left, the border to the right, the bottom of the border

  1.2 Altitude height

  Function: Set the height of the label, How to: Height: High, can be a specific number size such as: 20px, can also be a percentage: 80%, but the height does not have a fixed value, this setting is within a border, otherwise meaningless.  

<Head>    <MetaCharSet= "UTF-8">    <title>CSS Border</title>    <style>. C1{Border:1px solid Red;Height:80px;        }    </style></Head><Body><Divclass= "C1">It's a nice day today.</Div></Body>
Height

  1.3 Width widths

Function: Set the width of the label, how to use: Width: Size, this is the same as the height above, can be specific size: 50px, can also be set according to the browser size as a percentage: 80%

    <style>. C1{Border:1px solid Red;Height:80px;width:70%;        }    </style>
width

  1.4 Font Size Font-size

Role: Set the font size within the label, using: font-size: Font Size, example: font-size:20px

<style>. C1{Border:1px solid Red;Height:80px;width:70%;font-size:20px;    }</style>
font-size

 1.5 Font colors Color

Role: Set the font color within the label, using: color: Colors, Example: color:red

<style>. C1{Border:1px solid Red;Height:80px;width:70%;font-size:20px;Color:Blue;    }</style>
Color

  1.6 Font Bold Font-weight

Function: give you the font in the label is bold. How to use: Font-weight:bold

<style>. C1{Border:1px solid Red;Height:80px;width:70%;font-size:20px;Color:Blue;Font-weight:Bold;    }</style>
Font-weight

 1.7 Horizontal Center

Function: The font within the label can be horizontally centered. How to use: Text-align:center

<style>. C1{Border:1px solid Red;Height:80px;width:70%;font-size:20px;Color:Blue;Font-weight:Bold;text-align:Center;    }</style>
text-align

  1.8 Center Vertically

Function: The font within the label can be horizontally centered. How to use: Line-height: Label height value.

<style>. C1{Border:1px solid Red;Height:80px;width:70%;font-size:20px;Color:Blue;Font-weight:Bold;text-align:Center;Line-height:80px;    }</style>
Line-height

CSS borders and common styles

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.