CSS Hack
CSS Hack
********************************************************
Text Gradient
#element id {
gradient code from website (https://cssgradient.io/ &
https://uigradients.com/ & https://gradient.shapefactory.co/ &
https://csshero.org/mesher/)
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
or
#element id {
all code from website (https://www.cssportal.com/css-text-gradient-
generator/)
}
#element id {
gradient code from website (https://cssgradient.io/ &
https://uigradients.com/ & https://gradient.shapefactory.co/)
-webkit-animation: animatedgradient 3s ease infinite alternate;
animation: animatedgradient 3s ease infinite alternate;
background-size: 300% 300%;
}
#element id {
animation-name: textblink;
animation-duration: 1s;
animation-iteration-count: infinite;
animation-direction: alternate;
}
Hover Effect (effect or animation occur by
mouse click on any element)
Scale Effect
#element id:hover {
transform: scale(1.1);
-webkit-transition: all 1s ease;
}
#Image id:hover{
filter: grayscale(0%);
filter: gray;
-webkit-filter: grayscale(0%);
filter: none;
transition: 1s ease;
}
Fade In Effect
#Image id{
opacity:0.5;
transition: 1s ease;
}
#Image id:hover{
opacity:1;
transition: 1s ease;
}
Move Up Effect
#element id {
position: relative; top: 0; transition: top ease 0.5s;
}
#element id:hover{
top: -10px;
}
Adding A Submenu
<style>
a{
text-decoration: none;
}
nav {
font-family: Sans-serif;
float: right;
}
ul {
list-style: none;
margin: 0;
padding-left: 0;
}
li {
color: #fff;
display: block;
float: left;
padding: 1rem;
position: relative;
text-decoration: none;
transition-duration: 0.5s;
}
/*Text Color*/
li a {
color: #ffffff;
}
/*Hover Color*/
li:hover,
li:focus-within {
background: orange;
cursor: pointer;
}
li:focus-within a {
outline: none;
}
/*Inner submenu styling*/
ul li ul {
z-index: 50;
visibility: hidden;
opacity: 10;
background: orange;
min-width: 5rem;
position: absolute;
transition: all 0.5s ease;
margin-top: 1rem;
left: 0;
display: none;
font-size: 13px;
}
ul li:hover > ul,
ul li:focus-within > ul,
ul li ul:hover,
ul li ul:focus {
visibility: visible;
opacity: 1;
display: block;
}
ul li ul li {
clear: both;
width: 100%;
}
</style>
<div>
<nav role="navigation">
<ul>
<li><a href="Link Here">Menu Item</a></li>
<li><a href="Link Here" aria-haspopup="true">Menu Item</a>
<ul class="dropdown" aria-label="submenu">
<li><a href="Link Here">Sub Menu 1</a></li>
<li><a href="Link Here">Sub Menu 2</a></li>
<li><a href="Link Here">Sub Menu 3</a></li>
</ul>
</li>
<li><a href="Link Here" aria-haspopup="true">Menu Item</a>
<ul class="dropdown" aria-label="submenu">
<li><a href="Link Here">Sub Menu 1</a></li>
<li><a href="Link Here">Sub Menu 2</a></li>
<li><a href="Link Here">Sub Menu 3</a></li>
</ul>
</li>
<li><a href="Link Here">Menu Item</a></li>
</ul>
</nav>
</div>
<style>
#element id {
display: inline-block;
margin: 0 0.5rem;
.container {
margin: 100px auto;
width: 500px;
text-align: center;
}
.progress {
padding: 6px;
background: rgba(0, 0, 0, 0.25);
border-radius: 6px;
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25), 0 1px rgba(255, 255, 255,
0.08);
}
.progress-bar {
height: 18px;
background-color: #ee303c;
border-radius: 4px;
transition: 0.4s linear;
transition-property: width, background-color;
}
.progress-striped .progress-bar {
background-color: #FCBC51;
width: 80%;
background-image: linear-gradient(
45deg, rgb(252,163,17) 25%,
transparent 25%, transparent 50%,
rgb(252,163,17) 50%, rgb(252,163,17) 75%,
transparent 75%, transparent);
animation: progressAnimationStrike 6s;
}
@keyframes progressAnimationStrike {
from { width: 0 }
to { width: 80% }
}
</style>
<div class="container">
<div class="progress progress-striped">
<div class="progress-bar">
</div>
</div>
</div>