Skip to content

Instantly share code, notes, and snippets.

@Gayo
Last active September 10, 2023 07:04
Show Gist options
  • Save Gayo/d66181a59507d4a842bf83eb890ca07e to your computer and use it in GitHub Desktop.
Save Gayo/d66181a59507d4a842bf83eb890ca07e to your computer and use it in GitHub Desktop.
A simple demo of color hints in linear and radial gradients.
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Gradient test</title>
<style>
.box {
width: 400px;
height: 300px;
border: 2px solid black;
margin: 10px;
text-align: center;
vertical-align: middle;
line-height: 300px;
}
.linear-gradient {
background: linear-gradient(yellow, 75%, red);
}
.radial-gradient {
background: radial-gradient(yellow, 75%, red);
}
</style>
</head>
<body>
<div class="box linear-gradient">Linear with 75% color hint</div>
<div class="box radial-gradient">Radial with 75% color hint</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment