Skip to content

Instantly share code, notes, and snippets.

@MelodicCrypter
Last active March 31, 2021 01:30
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 MelodicCrypter/b0872d56b760a2457ba54d4a0b16a3b8 to your computer and use it in GitHub Desktop.
Save MelodicCrypter/b0872d56b760a2457ba54d4a0b16a3b8 to your computer and use it in GitHub Desktop.
Image with overlay text CSS
#theElement {
background-image:
linear-gradient(to bottom, rgba(245, 246, 252, 0.52), rgba(117, 19, 93, 0.73)),
url('images/background.jpg');
width: 80%;
height: 400px;
background-size: cover;
color: white;
padding: 20px;
}
// Snippet from:
// https://webdevetc.com/blog/how-to-add-a-gradient-overlay-to-a-background-image-using-just-css-and-html
<div id='theElement'>Smaple Text Here</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment