CSS3 Border Style

Source: Internet
Author: User

When we design the Web page style, often use the border, then CSS in the specific style of the border, let us look at.

First of all, when setting border in CSS, we generally give three values, line style, line thickness, line color.

The above three values, the line style is must be set, otherwise the border can not be displayed on the page, border line style has four kinds, namely:

Solid Line (solid)
Point line (dotted)
Double solid Line (double)
Dashed line (dashed)

The weight and color can default, and the weight defaults to 3px, and the color is determined by the text color of the current element.

So we can usually write this in the initial border: the element name. {border:solid 1px red;}, set three values at the same time.

And then we'll see border. In addition to the default of four boxes can also be used.

First, use border to underline the split line

We know that in HTML you can use HR to underline the split line, but the HR split line can't set the weight style, which is inconvenient to use.

So we can use border to set an upper or lower border for an element to achieve the effect of dividing lines.

The specific code is as follows:

P{border-bottom:solid 1px Red;}

The effect of dividing line is realized by setting a 1px red lower border line for P element and adjusting the position of border.

You can also choose to use border other edges to set different effects

Second, use border to add fillet effects to Element shapes

The elements we see in the Web page are not just square rectangles, sometimes rounded corners, so how does that happen?

It is also a border border application.

The code is p:{border:solid 1px red;

border-radius:3px;}

Indicates that a fillet with a radius of 3px is added to the P element, and 3px represents the arc size of the fillet, the higher the value, the greater the Radian

You must give the border style before you can set a fillet, or you cannot display it on the page.

These are some of the actual applications of the border border in CSS, and there are more styles for us to discover together.

CSS3 Border Style

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.