0% found this document useful (0 votes)
85 views

CSS Hack

The document provides CSS code snippets for various styling effects and animations that can be copied, such as: 1. Adding directionality, backgrounds, gradients, animated gradients, text gradients, and blink/hover effects. 2. Adding submenus, scrolling to sections, and element animations. 3. Styling progress bars, adding decorations to sections, underline text effects, and positioning text between lines. 4. Links to external websites that contain additional CSS codes for effects like progress bars, round buttons, toggles, animations, patterns, and decorative lines.

Uploaded by

rachid
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views

CSS Hack

The document provides CSS code snippets for various styling effects and animations that can be copied, such as: 1. Adding directionality, backgrounds, gradients, animated gradients, text gradients, and blink/hover effects. 2. Adding submenus, scrolling to sections, and element animations. 3. Styling progress bars, adding decorations to sections, underline text effects, and positioning text between lines. 4. Links to external websites that contain additional CSS codes for effects like progress bars, round buttons, toggles, animations, patterns, and decorative lines.

Uploaded by

rachid
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Note: Any thing in code can be edited

Note: Use this website (https://liveweave.com/) for live preview


and edit code

For Identify: /*your text here*/

********************************************************

From left To Right


#element id {
direction: rtl;
}

Backgrounds And Buttons Gradient


#element id {
gradient code from website (https://cssgradient.io/ &
https://uigradients.com/ & https://gradient.shapefactory.co/ &
https://csshero.org/mesher/)
}

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/)
}

Animated Gradient (Any Thing)


@keyframes animatedgradient {
0% { background-position: 0% 50% }
50% { background-position: 100% 50% }
100% { background-position: 0% 50% }
}

#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%;
}

Blink Effect (appear & disappear)


@keyframes textblink {
from {color: color;}
to {color: color;}
}

#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;
}

Gradient On Click Effect


#element id:hover {
background-image: linear-gradient(to right, #43e97b 0%, #38f9d7 100%);
border: 0px!important;
-webkit-box-shadow: 0px 14px 23px 0px rgba(98,106,115,0.4)!important;
-moz-box-shadow: 0px 14px 23px 0px rgba(98,106,115,0.4)!important;
box-shadow: 0px 14px 23px 0px rgba(98,106,115,0.4)!important;
}

Gray to Color Effect


#Image id {
filter: grayscale(100%);
-webkit-filter: grayscale(100%);
-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;
}

Color Shadow Effect (Any Thing)


#element id {
all code from website (https://www.cssmatic.com/box-shadow)
}

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>

Adding Button Scroll to a Section


only take id code and put it in url button

Adding Animations to Elements


<head>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css
"
/>
</head>

<style>
#element id {
display: inline-block;
margin: 0 0.5rem;

animation: Animation Name (From: https://animate.style/); /* referring


directly to the animation's @keyframe declaration */
animation-duration: 2s; /* don't forget to set a duration! */
}
</style>

Adding Animated Progress Bars


<style>
$background: #2c303a;

.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>

Adding Decorations For Sections


#element id {
-webkit-clip-path: polygon(0 0, 100% 0, 100% 94%, 50% 100%, 0 94%);
clip-path: polygon(0 0, 100% 0, 100% 94%, 50% 100%, 0 94%);
}

Adding CSS Underline Text Effects


<style>
#element id u {
text-decoration-color: #a3d7df !important;
background-color: rgba(209, 236, 240, 0.5);
}
</style>

Putting TEXT Between Two Line


#element id {
background-image: linear-gradient(
to right,
pink,
white 35%,
white 65%,
pink
);
background-repeat: no-repeat;
background-size: 100% 2px;
background-position: 0 center;
}

How to take any css code from any website?


(This Is For You)
https://alvarotrigo.com/blog/progress-bar-css/
https://www.sliderrevolution.com/resources/css-progress-bar/
https://www.makeuseof.com/css-progress-bar-examples/
https://stackoverflow.com/questions/15945288/animating-progress-bars-with-
css
https://freefrontend.com/css-progress-bars/
https://css-irl.info/animating-underlines/
https://speckyboy.com/underline-text-effects-css/
https://sharkcoder.com/visual/underline
https://sharkcoder.com/visual
https://alvarotrigo.com/blog/css-round-button/
https://alvarotrigo.com/blog/toggle-switch-css/
https://alvarotrigo.com/blog/10-cool-css-animations-to-add-to-your-website/
https://alvarotrigo.com/blog/css-text-animations/
https://alvarotrigo.com/blog/html-css-timelines/
https://www.makeuseof.com/css-background-patterns-examples/
https://pqina.nl/blog/drawing-decorative-lines-with-css/

You might also like