CSS border effect, css border

Source: Internet
Author: User
Tags border image

CSS border effect, css border
Previous

This article introduces the CSS border effect in detail.

 

Translucent border
  border:10px solid hsla(0, 0%, 100%,.5);  background-clip:padding-box;

 

Sewing Effect
  outline: 1px white dashed;  outline-offset:-10px;  border-radius:4%;  background:#795548;

 

Border rounded corner

The idea is as follows: Set the rounded corner for the element, and set the outline for the outer layer. Fill the gap between the rounded corner and the right corner with a shadow. The shadow size is half of the radius of the rounded corner.

  border-radius:10px;  background: tan;  outline:10px solid #655;  box-shadow:0 0 0 5px #655;

 

Envelope border

There are two ways to implement the envelope border:

1. Use background gradient

  padding:1em;  border: 1em solid transparent;  background: linear-gradient(white,white) padding-box,repeating-linear-gradient(-45deg, red 0, red 12.5%, transparent 0, transparent 25%, #58a 0, #58a 37.5%, transparent 0, transparent 50%) 0/5em 5em; 

2. Use a border image

  padding:1em;  border: 1em solid transparent;  border-image:repeating-linear-gradient(-45deg, red 0, red 1em, transparent 0, transparent 2em, #58a 0, #58a 3em, transparent 0, transparent 4em)  16;

The effect is as follows:

 

Footer Effect

Because currentColor is used, it automatically adapts to changes in the color attribute.

  padding-top:1em;  border-top: .2em solid transparent;  border-image: 100% 0 0 linear-gradient(90deg,currentColor 4em,transparent 0);

 

Ant line
@keyframes ants{100%{background-position:100%;}}div{  width:200px;  height: 70px;  border: 1px solid transparent;  background: linear-gradient(white,white) padding-box,repeating-linear-gradient(-45deg, black 0, black 25%, white 0, white 50%) 0/.6em .6em;   animation:ants 12s linear infinite;}  

 

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.