Here’s the the html
I created the myIcon div so that I can style it into a box but it doesn’t seem to appear in the output
h1 {
font-family: 'sticky notes';
font-weight: 500;
height: 50px;
background-image: linear-gradient(45deg, red, orange, yellow);
background-clip: text;
-moz-background-clip: text;
-webkit-background-clip: text;
color: transparent;
margin: 0;
padding: 43px;
text-align: center;
}
.myIcon {
width: 20px;
height: 20px;
background: linear-gradient(45deg, red, orange, yellow);
margin: 0;
padding: 0;
display: inline;
}
<div class="headers">
<h1><div class="myIcon"></div>STICKY NOTES</h1>
</div>
2
Answers
you can try this:
The problem is your .myIcon div has a
display: inline
property. If you display an element as inline any height and width properties will have no effectTry to display as
inline-block
instead ofinline
.