Skip to content

Instantly share code, notes, and snippets.

@ImBIOS
Created March 8, 2022 04:48
Show Gist options
  • Save ImBIOS/82f92711e7d978b87dd3499fde991fe5 to your computer and use it in GitHub Desktop.
Save ImBIOS/82f92711e7d978b87dd3499fde991fe5 to your computer and use it in GitHub Desktop.
Several technique to set a background color of an element
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
body {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
background-color: #d3d3d3;
}
div {
height: 30vh;
width: 50vw;
/* background: white; */
/* background: #a3fcff; */
/* background: rgb(120, 223, 163); */
/* background: rgb(120, 223, 163, 0.5); */
background: hsl(91, 56%, 71%);
}
</style>
</head>
<body>
<div></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment