CSS border (rounded corner, shadow, background image), css border

Source: Internet
Author: User

CSS border (rounded corner, shadow, background image), css border

 

1. rounded corner

Border-radiusIs to add a rounded border to the element.

Usage:

Border-radius: 10px;/* All corners use rounded corners with a radius of 10 PX */

Border-radius: 5px 4px 3px 2px;/* The Four radius values are the upper left corner, the upper right corner, the lower right corner, and the lower left corner, clockwise */

 

Solid circle:

Div {height: 100px;/* Consistent with width setting */width: 100px; background: # 9da; border-radius: 50px; /* set the four rounded corners to half the width or height value */}

Solid upper half circle:

Div {height: 50px;/* is half of width */width: 100px; background: # 9da; border-radius: 50px 50px 0 0; /* set the radius to at least the value of height */}

 

2. Shadow

Box-shadow: X axis offset Y axis offset [shadow blur radius] [shadow extended radius] [shadow color] [Projection mode];

Shadow blur radius: this parameter is optional. Its value can only be a positive value. If its value is 0, it indicates that the shadow has no blur effect. The greater the value, the blurrier the edge of the shadow;

Radius of shadow Extension: this parameter is optional. The value can be positive or negative. If the value is positive, the entire Shadow is extended. If the value is negative, the shadow is reduced;

 

Add a shadow to the box. The projection mode can be internal or external. The inset mode is internal and the default mode is external.

Sample Code:

.box_shadow{  box-shadow:4px 2px 6px #333333; }
 
3. Border
Background: url(xx.jpg) 10px 20px repeat;
// 10px 20px indicates the width of the cut image. There are three ways to extend the image: repeat, round, and stretch)

 

 

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.