Last active
June 8, 2022 10:20
-
-
Save JohnLBevan/acc3daf7cb795155713408fa65bb54b9 to your computer and use it in GitHub Desktop.
CSS for rainbow text. See https://w3bits.com/rainbow-text/ & https://stackoverflow.com/a/14225993/361842 for more.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> | |
<title>Google Demo</title> | |
<style type="text/css" media="screen"> | |
.rainbow-text { | |
background-image: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet); | |
-webkit-background-clip: text; | |
-webkit-text-fill-color: transparent; | |
width: fit-content; | |
} | |
</style> | |
</head> | |
<body lang="en-US"> | |
<h1 class="rainbow-text">Google</h1> | |
<p class="rainbow-text">What is going on? This is a very long piece of text; I'm hoping to make it long enough to hit a line break so we can see what happens to the rainbow with multi-line examples... Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
View Rendered Example