Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set the div border color by css

2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains the "css how to set div border color", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "css how to set div frame color" bar!

1. The border color configuration of the four sides of div

If you do not set the border width, it is useful to configure only border-color colors. Usually we will abbreviate the border name code.

Border:1px solid # F00

This simply sets the border thickness of the equipment decoration object to the 1px solid line red border.

1. Instance CSS code

.exp {width:200px; border:1px solid # F00}

2. Div code for border color example

The color of my four edges is blood color.

Screenshots of examples of equipment furnishings with color settings on 3 and 4 edges

CSS is easy to configure screenshots of 4 border color examples.

Second, the color setting of the top border of div

Border-top (upper border) is used to set the color property of the upper border of the equipment.

1. Instance CSS code

. exp-top {width:200px; border-top:1px solid # F00}

2. Instance HTML code

My upper frame color is blood color.

3. Screenshot of the color effect of the upper border

Screenshots of color sampling examples in the upper frame of css for setting up equipment

Third, configure the color mining of the lower frame of div

The bottom border is CSS word border-bottom

1. The CSS code of the color example of the border below

. exp-bottom {width:200px; border-bottom:1px solid # F00}

2. The following border color example html code

My lower border is red.

3. CSS screenshot of the following border color example

Screenshot of css setting div lower frame color collection setting equipment installation example

4. Div left frame hue setting equipment

Div left border hue required CSS word border-left

1. Set the equipment div left frame hue CSS code

. exp-left {width:200px; border-left:1px solid # F00}

2. The color html code of the left border of the instance div

My left border is red.

3. Set up equipment div left frame color example screenshot

Screenshot of an example of equipment installation in the left frame of div

5. Set the color of the left box of div

Similarly, configure the right border css word as border-right

1. Instance CSS code

. exp-right {width:200px; border-right:1px solid # F00}

2. Instance HTML code

My left border is blood.

3. Screenshot of the color example of the left box of div

Thank you for your reading, the above is the "css how to set div border color" content, after the study of this article, I believe you on css how to set div frame color this problem has a deeper understanding, the specific use of the situation also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report