Skip to content

Instantly share code, notes, and snippets.

@xiongchengqing
Last active June 1, 2022 01:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xiongchengqing/3268f14ba3900b650f7e8ef3c6b70320 to your computer and use it in GitHub Desktop.
Save xiongchengqing/3268f14ba3900b650f7e8ef3c6b70320 to your computer and use it in GitHub Desktop.
diagonal-fill-css
{
"scripts": [],
"styles": []
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>diagonal fill</title>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<div class="diagonal-fill" style="height:200px;"></div>
</body>
</html>
.diagonal-fill {
background-image: linear-gradient(
-45deg,
rgba(204, 204, 204, 0.2) 12.5%,
#0000 12.5%, #0000 50%,
rgba(204, 204, 204, 0.2) 50%, rgba(204, 204, 204, 0.2) 62.5%,
#0000 62.5%, #0000 100%
);
background-size: 8px 8px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment