Hey everyone. Im confused as to how to edit the inner html of an element to make a custom 4 point gradient. I found a CSS code generator online but when I edit the inner HTML, it gives me the element with the code pasted as code:
Also the code you were given is CSS so you can place inline as Greg has shown you or you can place it within a style tag like so …
<div class="gradient"></div>
<style>
/* but make sure you declare what element you're styling */
.gradient {
/* code goes here! */
}
<style>
Also -webkit-linear-gradient is quite an old standard there is a new way that almost all the browsers support and it’s using just the "linear-gradient" declaration.
for example
.gradient {
background-image:
linear-gradient(
to right,
red,
#f06d06,
rgb(255, 255, 0),
green
);
}
notice the background-image as well. If you just do this with background then you might reset other css properties declared elsewhere.
I hope this gives you a little more insight into linear-gradient. Google is your friend if you want to learn more