CSS Border instance tutorial

Source: Internet
Author: User
Tags border color

Border CSS, our favorite CSS attribute, allows you to completely customize HTML elements near the border. With HTML, it was once an element near the impossible boundary, except for seating. The CSS border allows you to create clear, custom border styles rarely work, while the old method of HTML.
Border style
There are many types of border styles at your disposal. We recommend that you try a lot of color/boundary combinations to get an idea all different and you will be able to create it. Note: We use the following CSS classes. Therefore, check the CSS class lessons if you do not understand.

P. solid {border-style: solid ;}
P. double {border-style: double ;}
P. groove {border-style: groove ;}
P. dotted {border-style: dotted ;}
P. dashed {border-style: dashed ;}
P. inset {border-style: inset ;}
P. outset {border-style: outset ;}
P. ridge {border-style: ridge ;}
P. hidden {border-style: hidden ;}

This may be obvious, but one of the default boundary style settings is hidden.

Border width border-width
Change the border width attribute used by border thickness. You can use key words or exact values to define the border width. Note: You must determine the appearance of a boundary style boundary. Existing Conditions: thin, medium, and thick.

Table {border-width: 7px;
Border-style: outset ;}
Td {border-width: medium;
Border-style: outset ;}
P {border-width: thick;
Border-style: solid ;}

Border color border-color
The current creative CSS border! With the border color attribute, you will be able to create custom boundaries to adapt to flow and layout on your website. The border color can be any color defined by RGB, hexadecimal, or key terms. The following is an example of each type.

Border defense: border defense (direction)
If you want to create an HTML element with only one side of a border, or you want to have a unique look for the respective border, then use the border (direction ). The selected direction is: top, right, bottom, and exit. CSS allows you to treat each side of the border from the other three aspects. Each side can have its own color, width, and style settings, as shown below.

P {border-bottom-style: dashed;
Border-bottom-color: yellow;
Border-bottom-width: 5px ;}

H4 {border-top-style: double;
Border-top-color: purple;
Border-top-width: thick ;}

H5 {border-left-style: groove;
Border-left-color: green;
Border-left-width: 15px;
Border-bottom-style: ridge;
Border-bottom-color: yellow;
Border-bottom-width: 25px ;}

Border defense: all
Although this is a good CSS that allows web developers to create custom boundaries very specifically, sometimes it is only easier, less headache to build a unified boundary, all in a single CSS code. Tizag is built on most boundaries in this way.

P {border: 20px outset blue ;}
H4 {border: 5px solid ;}
H5 {border: dotted ;}

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.