Skip to content

Instantly share code, notes, and snippets.

@vaebe
Created November 21, 2024 09:49
Show Gist options
  • Save vaebe/d5526e561e7f6cc0b7f0b36de2524751 to your computer and use it in GitHub Desktop.
Save vaebe/d5526e561e7f6cc0b7f0b36de2524751 to your computer and use it in GitHub Desktop.
html 元素四角边框
&:before {
content: "";
width: 100%;
height: 10px;
position: absolute;
top: 0;
left: 0;
background: linear-gradient(to left, #7BBBDC, #7BBBDC) left top no-repeat, linear-gradient(to bottom, #7BBBDC, #7BBBDC) left top no-repeat, linear-gradient(to left, #7BBBDC, #7BBBDC) right top no-repeat, linear-gradient(to bottom, #7BBBDC, #7BBBDC) right top no-repeat;
background-size: 2px 10px, 10px 2px, 2px 10px, 10px 2px;
}
&:after {
content: "";
width: 100%;
height: 10px;
position: absolute;
bottom: 0;
left: 0;
background: linear-gradient(to left, #7bbbdc, #7bbbdc) left bottom no-repeat,
linear-gradient(to bottom, #7bbbdc, #7bbbdc) left bottom no-repeat,
linear-gradient(to left, #7bbbdc, #7bbbdc) right bottom no-repeat,
linear-gradient(to bottom, #7bbbdc, #7bbbdc) right bottom no-repeat;
background-size: 2px 10px, 10px 2px, 2px 10px, 10px 2px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment