Deep understanding of CSS learning notes border and css learning notes

Source: Internet
Author: User

Deep understanding of CSS learning notes border and css learning notes

1. border-width

Border-width does not support percentages: semantics and scenarios are determined. In reality, the concepts of borders do not support percentages.

Border-width supports keywords: thin, medium (default), and thick. The values are 1px, 3px, and 5px (except IE7 ).

Why is the default value of border-width medium (3px)? Because border-style is double, it takes at least 3px to see the effect.

2. border-style

Border-style is some interesting data about dashed:

  

Differences between border-style and dotted browsers:

  

The dot Effect of IE can be used to achieve the rounded corner effect under IE7/8.

The calculation rule for the border-style is double: the borders on both sides are always equal, with an interval of ± 1 in the middle.

Border-style is double to implement the triplicate icon:

3. border-color

Border-color: by default, border-color has the same value as color, such as box-shadow and text-shadow.

4. Create border and triangle Images

  Using border's solid style, You Can skillfully construct triangles:

  

You can also use the stitching method to bring up and down two small trapezoid shapes to form the effect of rounded corners:

    

5. border and transparent border

Transparent border functions:

  • Add a click area.
  • Add a rendering area.

6. border application in Layout

High la s implemented by border (the border size cannot be a percentage, so the left side is fixed width ):

  

  

 

Related Article

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.