Continuing on into Module 2 of Web Dev Basics, I was introduced to Background images and how to an image for a background instead of a color. I also learned about setting a .webp image, which, in short, is basically a .gif that adds animation to the background, which is really cool. But, it made me wonder, is it possible to set an image inside of text? Furthermore, can a .webp image be placed into a text as it's background? So, I set out to find out. Doing this research, I've learned that, not only is it possible, but I how easy it is to do it! I will not include a screenshot of the text background using .webp, because, well, it won't render. But I do have a screenshot of the final browser rendering of the code of the code itself. On a side note, I clearly haven't gotten to the website design module yet. :D Well, that is the brief update. Back to the lessons!
* {
margin: 0;
padding: 0;
}
body {
background-color: rgb(200, 183, 24);
margin: 20px;
}
:root {
font-size: 10px;
}
p {
background: url(images/code.jpg);
background-repeat: repeat;
background-size: contain;
-webkit-background-clip: text;
-webkit-text-stroke: .2rem rgb(179, 2, 2);
background-clip: text;
color: transparent;
margin-top: 2em;
margin-left: 1.5em;
font-family: adlam display;
font-size: 12em;
text-shadow: 2px 2px rgba(0, 0, 0, 0.4);
}

Comments
Post a Comment