CSS Not centering it correctly - html

I'm having a bit of trouble trying to center my div class= content onto the middle right under the word freedom. Any help? I also have an image provided here https://gyazo.com/8a38955c74369034a014b20ed8e5d31d
HTML
<p id="einz" style="color: rgb(255, 255, 255);">
<!--marquee direction="right" speed="1" onmouseover="this.stop();" onmouseout="this.start();"-->
[ <a id="einz" href="bla bla bla" target="blank" rel=noopener>discord</a> /
<a id="einz" href="bla bla bla" target="blank" rel=noopener>steam</a> /
<a id="einz" href="bla bla bla" target="blank" rel=noopener>youtube</a> /
<a id="einz" href="bla bla bla" target="blank" rel=noopener>github</a> ]
CSS
```#einz
{
text-align: center;
font-weight: normal;
font-family: 'Courier', sans-serif;
text-shadow: 1px 1px 1px rgba(0,0,0,100), 1px 1px 1px rgba(0,0,0,100);
margin: 0 auto;
z-index: 1;
font-size: 12px;
}

Following your CodePen demo, you have to put the freedom text and links in a wrapper and then center the wrapper in order to keep the respectiveness to the text and links. Further on, since you wanted the links to the bottom-right of the freedom text, the links had to be put in a wrapper as well. Since you wanted the links on two different levels, I'd recommend using blocks to force a new line rather than <br>. You should also refrain from using the style attribute when the element has a class that you can alter. You should also not use similar id attributes more than once, you should refer to using classes instead.
/* temporary code to not blind the view */
body { background: pink }
#freedom-wrapper {
position: absolute;
top: 50%;
left: 50%;
margin-top: -50px;
margin-left: -220px;
}
#freedom-links-wrapper {
float: right;
}
.freedom-links {
color: rgb(255, 255, 255);
font-weight: normal;
font-size: 12px;
font-family: 'Courier', sans-serif;
text-align: center;
text-shadow: 1px 1px 1px rgba(0,0,0,100),
1px 1px 1px rgba(0,0,0,100);
line-height: 18px;
z-index: 1;
}
.glitch {
color: white;
font-size: 100px;
z-index: 1;
}
/* old code */
#keyframes noise-anim {
0% {
clip-path: inset(87% 0 4% 0);
}
5% {
clip-path: inset(3% 0 43% 0);
}
10% {
clip-path: inset(82% 0 4% 0);
}
15% {
clip-path: inset(41% 0 2% 0);
}
20% {
clip-path: inset(96% 0 5% 0);
}
25% {
clip-path: inset(57% 0 35% 0);
}
30% {
clip-path: inset(78% 0 4% 0);
}
35% {
clip-path: inset(100% 0 1% 0);
}
40% {
clip-path: inset(99% 0 1% 0);
}
45% {
clip-path: inset(46% 0 49% 0);
}
50% {
clip-path: inset(16% 0 8% 0);
}
55% {
clip-path: inset(16% 0 72% 0);
}
60% {
clip-path: inset(19% 0 80% 0);
}
65% {
clip-path: inset(8% 0 9% 0);
}
70% {
clip-path: inset(88% 0 6% 0);
}
75% {
clip-path: inset(32% 0 30% 0);
}
80% {
clip-path: inset(46% 0 47% 0);
}
85% {
clip-path: inset(78% 0 21% 0);
}
90% {
clip-path: inset(60% 0 9% 0);
}
95% {
clip-path: inset(48% 0 49% 0);
}
100% {
clip-path: inset(23% 0 64% 0);
}
}
.glitch::after {
content: attr(data-text);
position: absolute;
left: 2px;
text-shadow: -1px 0 red;
top: 0;
overflow: hidden;
animation: noise-anim 2s infinite linear alternate-reverse;
}
#keyframes noise-anim-2 {
0% {
clip-path: inset(19% 0 72% 0);
}
5% {
clip-path: inset(6% 0 35% 0);
}
10% {
clip-path: inset(32% 0 35% 0);
}
15% {
clip-path: inset(97% 0 3% 0);
}
20% {
clip-path: inset(19% 0 57% 0);
}
25% {
clip-path: inset(85% 0 16% 0);
}
30% {
clip-path: inset(46% 0 46% 0);
}
35% {
clip-path: inset(83% 0 15% 0);
}
40% {
clip-path: inset(66% 0 18% 0);
}
45% {
clip-path: inset(90% 0 8% 0);
}
50% {
clip-path: inset(58% 0 34% 0);
}
55% {
clip-path: inset(38% 0 61% 0);
}
60% {
clip-path: inset(93% 0 6% 0);
}
65% {
clip-path: inset(4% 0 83% 0);
}
70% {
clip-path: inset(57% 0 38% 0);
}
75% {
clip-path: inset(97% 0 4% 0);
}
80% {
clip-path: inset(9% 0 57% 0);
}
85% {
clip-path: inset(7% 0 82% 0);
}
90% {
clip-path: inset(14% 0 54% 0);
}
95% {
clip-path: inset(94% 0 6% 0);
}
100% {
clip-path: inset(9% 0 49% 0);
}
}
.glitch::before {
content: attr(data-text);
position: absolute;
left: -2px;
text-shadow: 1px 0 blue;
top: 0;
color: palevioletred;
overflow: hidden;
animation: noise-anim-2 15s infinite linear alternate-reverse;
}
<div id="freedom-wrapper">
<div class="glitch" data-text="freedom">freedom</div>
<div id="freedom-links-wrapper">
<div class="freedom-links">
[
discord
/
steam
/
youtube
/
github
]
</div>
<div class="freedom-links">
[ <a class="toggle">ᴄʟɪᴄᴋ ᴍᴇ</a> ]
</div>
</div>
</div>
target="blank" is also invalid and should be target="_blank". As another note, you can refer to using :after pseudo elements on <a> elements to add a slash when the element is not the last in its child (:not(:last-child):after).
As a final note, refer to not using plain-text "fonts" and use actual fonts instead. Talking about the click me text. You should also not trust your predefined pixel offsets for the freedom margin.

id is unique.
Don’t use id to control the style, use class instead, id is generally used to process data.
<p class="center">
[
title 1
title 2
]
</p>
.center { text-align: center; }

Related

Why does my animation add artefacts to my spinner in Moz Firefox?

I wanted to customise a nice spinner in CSS to indicate loading and it works nicely and looks great in everything except for Mozilla. Can anyone explain to me why, and how to fix it? Or at least point me in the right direction.
<style>
.loader {
display: inline-flex;
width: 0.75em;
height: 0.75em;
border-radius: 50%;
outline: none;
position: relative;
animation: rotate 1s linear infinite
}
.loader::before {
content: "";
box-sizing: border-box;
position: absolute;
inset: 0px;
border-radius: 50%;
border: 0.15em solid;
animation: prixClipFix 1.8s linear infinite;
}
:is(h1, h2, h3, h4, h5) .loader::before {
border-width: 0.1em;
}
#keyframes rotate {
100% {
transform: rotate(360deg)
}
}
#keyframes prixClipFix {
0% {
clip-path: polygon(50% 50%, 0 0, 10% 0, 10% 0, 10% 0, 10% 0)
}
25% {
clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 0, 100% 0, 100% 0)
}
50% {
clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 100% 100%, 100% 100%)
}
75% {
clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 0, 100% 0, 100% 0)
}
100% {
clip-path: polygon(50% 50%, 0 0, 10% 0, 10% 0, 10% 0, 10% 0)
}
}
</style>
<div>
<!-- <div class="spin"></div> -->
<h1>Loading
<div class="loader"></div>
</h1>
<h2>Loading
<div class="loader"></div>
</h2>
<h3>Loading
<div class="loader"></div>
</h3>
<h4>Loading
<div class="loader"></div>
</h4>
<h5>Loading
<div class="loader"></div>
</h5>
Loading
<div class="loader"></div>
</div>
Looking into it, I found that FF doesn't appreciate the div rotating while the polygon grows and shrinks. Turning either one off solves the problem however I would like it to do both.
Thanks to Miriam it is now fixed! I added border-radius: 0.01px; and overflow: hidden; to the .loader parent class.

CSS move up / wipe up vertically animation? On scroll?

I'm working in React js and am trying to emulate the vertical move up animation you see on the text "A DIGITAL DESIGN STUDIO
DRIVEN BY RESEARCH &
STRATEGY" here - https://dashdigital.studio/
From inspecting this site I have tried working with their translation CSS -
transition-delay: .9s;
transition: transform 1.3s cubic-bezier(.075, .82, .165, 1);
transform: translateY(0%);
However there is the "moving up from behind a wall" effect in use that I can't find a starting point for. Ideally I'd have this occur to elements on scroll - is there a package or starting point for anything like this?
How can I create this vertical wipe from behind a wall effect?
You can create vertically animation by following this code
html, body {
height: 100%;
}
body {
font-family: "Baloo Paaji", cursive;
background: #1e90ff;
display: flex;
justify-content: center;
align-items: center;
}
.container {
width: 400px;
height: 220px;
position: relative;
}
h1, h2 {
font-size: 75px;
text-transform: uppercase;
}
h1 span, h2 span {
width: 100%;
float: left;
color: #ffffff;
-webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%);
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%);
transform: translateY(-150px);
opacity: 0;
-webkit-animation-name: titleAnimation;
animation-name: titleAnimation;
-webkit-animation-timing-function: ease;
animation-timing-function: ease;
-webkit-animation-duration: 3s;
animation-duration: 3s;
}
h1 span {
-webkit-animation-delay: 0.6s;
animation-delay: 0.6s;
-webkit-animation-fill-mode: forwards;
}
h1 span:first-child {
-webkit-animation-delay: 0.7s;
animation-delay: 0.7s;
}
h1 span:last-child {
color: #ffe221;
-webkit-animation-delay: 0.5s;
animation-delay: 0.5s;
}
h2 {
top: 0;
position: absolute;
}
h2 span {
-webkit-animation-delay: 4.1s;
animation-delay: 4.1s;
-webkit-animation-fill-mode: forwards;
}
h2 span:first-child {
-webkit-animation-delay: 4.2s;
animation-delay: 4.2s;
}
h2 span:last-child {
color: #ffe221;
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
.usechrome {
font-size: 10px;
color: #fff;
font-family: helvetica, arial;
position: absolute;
bottom: 20px;
width: 100%;
text-align: center;
left: 0;
}
#-webkit-keyframes titleAnimation {
0% {
transform: translateY(-50px);
opacity: 0;
-webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%);
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%);
}
20% {
transform: translateY(0);
opacity: 1;
-webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 15%);
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 15%);
}
80% {
transform: translateY(0);
opacity: 1;
-webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 15%);
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 15%);
}
100% {
transform: translateY(50px);
opacity: 0;
-webkit-clip-path: polygon(100% 0, 100% 0%, 0 100%, 0 100%);
clip-path: polygon(100% 0, 100% 0%, 0 100%, 0 100%);
}
}
#keyframes titleAnimation {
0% {
transform: translateY(-50px);
opacity: 0;
-webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%);
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%);
}
20% {
transform: translateY(0);
opacity: 1;
-webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 15%);
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 15%);
}
80% {
transform: translateY(0);
opacity: 1;
-webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 15%);
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 15%);
}
100% {
transform: translateY(50px);
opacity: 0;
-webkit-clip-path: polygon(100% 0, 100% 0%, 0 100%, 0 100%);
clip-path: polygon(100% 0, 100% 0%, 0 100%, 0 100%);
}
}/*# sourceMappingURL=style.css.map */
<section class="container">
<h1 class="title">
<span>Hi, nice</span>
<span>to see</span>
<span>you here</span>
</h1>
<h2 class="title">
<span>This is</span>
<span>a long</span>
<span>sub title</span>
</h2>
</section>
<span class="usechrome">Use Chrome for a better experience</span>

How do I centralize the text inside a button

I'm building my new website on SquareSpace, and wanted something a bit more fancy for my landing page.
I got this button here ("Button 49," from https://getcssscan.com/css-buttons-examples).
My problem now is getting the text centered and being able to adjust the size.
I tried this text-align but nothing changed, also tried to mess with the line-height but thinks just got funky; and for the size of the button, I can mess with the inputs there but if I do that with the text not centred it gets weird.
I'm using a custom font, but you can use Arial to visualize.
Any help is welcome, I don't know code language or how to explain my problem, but thanks for reading.
As you can see on the image, there is a something wrong on the red circle and the text seems a bit down IMAGE OF BUTTON
Here's my current code:
button,
button::after {
width: 380px;
height: 86px;
font-size: 36px;
font-family: 'Industry Inc Base';
background: linear-gradient(45deg, transparent 5%, #fff 5%);
border: 0;
color: #000;
letter-spacing: 3px;
text-align: center;
line-height: 80px;
box-shadow: 8px 0px 0px #282828;
outline: transparent;
position: relative;
}
button::after {
--slice-0: inset(50% 50% 50% 50%);
--slice-1: inset(80% -6px 0 0);
--slice-2: inset(50% -6px 30% 0);
--slice-3: inset(10% -6px 85% 0);
--slice-4: inset(40% -6px 43% 0);
--slice-5: inset(80% -6px 5% 0);
content: 'ENTER';
display: block;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(45deg, transparent 3%, #FF5E1A 3%, #7b00ff 5%, #FF5E1A 5%);
text-shadow: -3px -3px 0px #7b00ff, 3px 3px 0px #FF5E1A;
clip-path: var(--slice-0);
}
button:hover::after {
animation: 1s glitch;
animation-timing-function: steps(2, end);
}
#keyframes glitch {
0% {
clip-path: var(--slice-1);
transform: translate(-20px, -10px);
}
10% {
clip-path: var(--slice-3);
transform: translate(10px, 10px);
}
20% {
clip-path: var(--slice-1);
transform: translate(-10px, 10px);
}
30% {
clip-path: var(--slice-3);
transform: translate(0px, 5px);
}
40% {
clip-path: var(--slice-2);
transform: translate(-5px, 0px);
}
50% {
clip-path: var(--slice-3);
transform: translate(5px, 0px);
}
60% {
clip-path: var(--slice-4);
transform: translate(5px, 10px);
}
70% {
clip-path: var(--slice-2);
transform: translate(-10px, 10px);
}
80% {
clip-path: var(--slice-5);
transform: translate(20px, -10px);
}
90% {
clip-path: var(--slice-1);
transform: translate(-10px, 0px);
}
100% {
clip-path: var(--slice-1);
transform: translate(0);
}
}
<p><button class="button">Enter</button></p>
The text 'Enter' is centered inside your button, so that's fine. Text is centered by default inside a button, so you can leave out text-align: center; in your CSS.
One way to center your button on the page is with CSS flex layout. This works by wrapping the content in a flex container (see CSS code below). This can be the p element you first had, but as this is not really a paragraph, I would use a div element.
Concerning the 'glitch text' displaying lower than the button text, this is likely due to the font indeed. I changed it to font-family: 'sans-serif'; and it looks fine to me.
Finally, please note that it is illegal to wrap a button inside anchor tags. You have to put your anchor tags (i.e. your 'link') inside the button tags.
div {
font-family: 'sans-serif';
display: flex;
justify-content: center;
}
button,
button::after {
width: 380px;
height: 86px;
font-size: 36px;
background: linear-gradient(45deg, transparent 5%, #fff 5%);
border: 0;
color: #000;
letter-spacing: 3px;
line-height: 80px;
box-shadow: 8px 0px 0px #282828;
outline: transparent;
position: relative;
}
button::after {
--slice-0: inset(50% 50% 50% 50%);
--slice-1: inset(80% -6px 0 0);
--slice-2: inset(50% -6px 30% 0);
--slice-3: inset(10% -6px 85% 0);
--slice-4: inset(40% -6px 43% 0);
--slice-5: inset(80% -6px 5% 0);
content: 'ENTER';
display: block;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(45deg, transparent 3%, #FF5E1A 3%, #7b00ff 5%, #FF5E1A 5%);
text-shadow: -3px -3px 0px #7b00ff, 3px 3px 0px #FF5E1A;
clip-path: var(--slice-0);
}
button:hover::after {
animation: 1s glitch;
animation-timing-function: steps(2, end);
}
#keyframes glitch {
0% {
clip-path: var(--slice-1);
transform: translate(-20px, -10px);
}
10% {
clip-path: var(--slice-3);
transform: translate(10px, 10px);
}
20% {
clip-path: var(--slice-1);
transform: translate(-10px, 10px);
}
30% {
clip-path: var(--slice-3);
transform: translate(0px, 5px);
}
40% {
clip-path: var(--slice-2);
transform: translate(-5px, 0px);
}
50% {
clip-path: var(--slice-3);
transform: translate(5px, 0px);
}
60% {
clip-path: var(--slice-4);
transform: translate(5px, 10px);
}
70% {
clip-path: var(--slice-2);
transform: translate(-10px, 10px);
}
80% {
clip-path: var(--slice-5);
transform: translate(20px, -10px);
}
90% {
clip-path: var(--slice-1);
transform: translate(-10px, 0px);
}
100% {
clip-path: var(--slice-1);
transform: translate(0);
}
}
<div><button class="button">Enter</button></div>

How to align a DIV element at the center of the remaining free space with Bootstrap v5.1

I'm a completely novice with front-end developing but I'm trying to build my website to showcase my Blockchain's projects.
Right now, I am trying to align the text "Technology is my Passion" at the vertical-center of the remaining free space.
How do I achieve this with bootstrap v5.1?
Is it possible to achieve a generalized answer as the image below?
CODE SNIPPET
/*--- basic styling ---*/
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
font-family: Hack, monospace !important;
background-color: #0f0f0f !important;
}
.owner {
color: #F4364C;
font-size: 1.2vw;
}
/*--- glitch effect ---*/
.glitch {
color: #F4364C;
position: relative;
font-size: 4vw !important;
}
.glitch::before {
color: #F4364C;
position: absolute;
content: attr(data-text);
top: 0vh;
left: 0.3vw;
width: 100%;
height: 100%;
text-shadow: -1px 0 #FFD700;
background: #0f0f0f;
overflow: hidden;
animation: glitch-anim-1 2s infinite linear alternate-reverse;
}
.glitch::after {
color: #F4364C;
position: absolute;
content: attr(data-text);
top: 0vh;
right: 0.3vw;
width: 100%;
height: 100%;
text-shadow: -1px 0 #C0C0C0;
background: #0f0f0f;
overflow: hidden;
animation: glitch-anim-2 2s infinite linear alternate-reverse;
}
#-webkit-keyframes glitch-anim-1 {
0% {
-webkit-clip-path: inset(37% 0 1% 0);
clip-path: inset(37% 0 1% 0);
}
5% {
-webkit-clip-path: inset(46% 0 40% 0);
clip-path: inset(46% 0 40% 0);
}
10% {
-webkit-clip-path: inset(99% 0 1% 0);
clip-path: inset(99% 0 1% 0);
}
15% {
-webkit-clip-path: inset(91% 0 6% 0);
clip-path: inset(91% 0 6% 0);
}
20% {
-webkit-clip-path: inset(11% 0 37% 0);
clip-path: inset(11% 0 37% 0);
}
25% {
-webkit-clip-path: inset(97% 0 1% 0);
clip-path: inset(97% 0 1% 0);
}
30% {
-webkit-clip-path: inset(24% 0 56% 0);
clip-path: inset(24% 0 56% 0);
}
35% {
-webkit-clip-path: inset(20% 0 30% 0);
clip-path: inset(20% 0 30% 0);
}
40% {
-webkit-clip-path: inset(89% 0 8% 0);
clip-path: inset(89% 0 8% 0);
}
45% {
-webkit-clip-path: inset(36% 0 60% 0);
clip-path: inset(36% 0 60% 0);
}
50% {
-webkit-clip-path: inset(5% 0 62% 0);
clip-path: inset(5% 0 62% 0);
}
55% {
-webkit-clip-path: inset(9% 0 3% 0);
clip-path: inset(9% 0 3% 0);
}
60% {
-webkit-clip-path: inset(50% 0 21% 0);
clip-path: inset(50% 0 21% 0);
}
65% {
-webkit-clip-path: inset(93% 0 4% 0);
clip-path: inset(93% 0 4% 0);
}
70% {
-webkit-clip-path: inset(68% 0 15% 0);
clip-path: inset(68% 0 15% 0);
}
75% {
-webkit-clip-path: inset(47% 0 49% 0);
clip-path: inset(47% 0 49% 0);
}
80% {
-webkit-clip-path: inset(90% 0 3% 0);
clip-path: inset(90% 0 3% 0);
}
85% {
-webkit-clip-path: inset(97% 0 3% 0);
clip-path: inset(97% 0 3% 0);
}
90% {
-webkit-clip-path: inset(45% 0 29% 0);
clip-path: inset(45% 0 29% 0);
}
95% {
-webkit-clip-path: inset(84% 0 10% 0);
clip-path: inset(84% 0 10% 0);
}
100% {
-webkit-clip-path: inset(46% 0 12% 0);
clip-path: inset(46% 0 12% 0);
}
}
#keyframes glitch-anim-1 {
0% {
-webkit-clip-path: inset(37% 0 1% 0);
clip-path: inset(37% 0 1% 0);
}
5% {
-webkit-clip-path: inset(46% 0 40% 0);
clip-path: inset(46% 0 40% 0);
}
10% {
-webkit-clip-path: inset(99% 0 1% 0);
clip-path: inset(99% 0 1% 0);
}
15% {
-webkit-clip-path: inset(91% 0 6% 0);
clip-path: inset(91% 0 6% 0);
}
20% {
-webkit-clip-path: inset(11% 0 37% 0);
clip-path: inset(11% 0 37% 0);
}
25% {
-webkit-clip-path: inset(97% 0 1% 0);
clip-path: inset(97% 0 1% 0);
}
30% {
-webkit-clip-path: inset(24% 0 56% 0);
clip-path: inset(24% 0 56% 0);
}
35% {
-webkit-clip-path: inset(20% 0 30% 0);
clip-path: inset(20% 0 30% 0);
}
40% {
-webkit-clip-path: inset(89% 0 8% 0);
clip-path: inset(89% 0 8% 0);
}
45% {
-webkit-clip-path: inset(36% 0 60% 0);
clip-path: inset(36% 0 60% 0);
}
50% {
-webkit-clip-path: inset(5% 0 62% 0);
clip-path: inset(5% 0 62% 0);
}
55% {
-webkit-clip-path: inset(9% 0 3% 0);
clip-path: inset(9% 0 3% 0);
}
60% {
-webkit-clip-path: inset(50% 0 21% 0);
clip-path: inset(50% 0 21% 0);
}
65% {
-webkit-clip-path: inset(93% 0 4% 0);
clip-path: inset(93% 0 4% 0);
}
70% {
-webkit-clip-path: inset(68% 0 15% 0);
clip-path: inset(68% 0 15% 0);
}
75% {
-webkit-clip-path: inset(47% 0 49% 0);
clip-path: inset(47% 0 49% 0);
}
80% {
-webkit-clip-path: inset(90% 0 3% 0);
clip-path: inset(90% 0 3% 0);
}
85% {
-webkit-clip-path: inset(97% 0 3% 0);
clip-path: inset(97% 0 3% 0);
}
90% {
-webkit-clip-path: inset(45% 0 29% 0);
clip-path: inset(45% 0 29% 0);
}
95% {
-webkit-clip-path: inset(84% 0 10% 0);
clip-path: inset(84% 0 10% 0);
}
100% {
-webkit-clip-path: inset(46% 0 12% 0);
clip-path: inset(46% 0 12% 0);
}
}
#-webkit-keyframes glitch-anim-2 {
0% {
-webkit-clip-path: inset(35% 0 4% 0);
clip-path: inset(35% 0 4% 0);
}
5% {
-webkit-clip-path: inset(84% 0 10% 0);
clip-path: inset(84% 0 10% 0);
}
10% {
-webkit-clip-path: inset(37% 0 13% 0);
clip-path: inset(37% 0 13% 0);
}
15% {
-webkit-clip-path: inset(86% 0 2% 0);
clip-path: inset(86% 0 2% 0);
}
20% {
-webkit-clip-path: inset(37% 0 22% 0);
clip-path: inset(37% 0 22% 0);
}
25% {
-webkit-clip-path: inset(36% 0 4% 0);
clip-path: inset(36% 0 4% 0);
}
30% {
-webkit-clip-path: inset(85% 0 10% 0);
clip-path: inset(85% 0 10% 0);
}
35% {
-webkit-clip-path: inset(40% 0 13% 0);
clip-path: inset(40% 0 13% 0);
}
40% {
-webkit-clip-path: inset(6% 0 69% 0);
clip-path: inset(6% 0 69% 0);
}
45% {
-webkit-clip-path: inset(6% 0 11% 0);
clip-path: inset(6% 0 11% 0);
}
50% {
-webkit-clip-path: inset(93% 0 8% 0);
clip-path: inset(93% 0 8% 0);
}
55% {
-webkit-clip-path: inset(70% 0 9% 0);
clip-path: inset(70% 0 9% 0);
}
60% {
-webkit-clip-path: inset(23% 0 71% 0);
clip-path: inset(23% 0 71% 0);
}
65% {
-webkit-clip-path: inset(93% 0 4% 0);
clip-path: inset(93% 0 4% 0);
}
70% {
-webkit-clip-path: inset(74% 0 8% 0);
clip-path: inset(74% 0 8% 0);
}
75% {
-webkit-clip-path: inset(72% 0 23% 0);
clip-path: inset(72% 0 23% 0);
}
80% {
-webkit-clip-path: inset(71% 0 9% 0);
clip-path: inset(71% 0 9% 0);
}
85% {
-webkit-clip-path: inset(52% 0 3% 0);
clip-path: inset(52% 0 3% 0);
}
90% {
-webkit-clip-path: inset(42% 0 46% 0);
clip-path: inset(42% 0 46% 0);
}
95% {
-webkit-clip-path: inset(93% 0 8% 0);
clip-path: inset(93% 0 8% 0);
}
100% {
-webkit-clip-path: inset(55% 0 4% 0);
clip-path: inset(55% 0 4% 0);
}
}
#keyframes glitch-anim-2 {
0% {
-webkit-clip-path: inset(35% 0 4% 0);
clip-path: inset(35% 0 4% 0);
}
5% {
-webkit-clip-path: inset(84% 0 10% 0);
clip-path: inset(84% 0 10% 0);
}
10% {
-webkit-clip-path: inset(37% 0 13% 0);
clip-path: inset(37% 0 13% 0);
}
15% {
-webkit-clip-path: inset(86% 0 2% 0);
clip-path: inset(86% 0 2% 0);
}
20% {
-webkit-clip-path: inset(37% 0 22% 0);
clip-path: inset(37% 0 22% 0);
}
25% {
-webkit-clip-path: inset(36% 0 4% 0);
clip-path: inset(36% 0 4% 0);
}
30% {
-webkit-clip-path: inset(85% 0 10% 0);
clip-path: inset(85% 0 10% 0);
}
35% {
-webkit-clip-path: inset(40% 0 13% 0);
clip-path: inset(40% 0 13% 0);
}
40% {
-webkit-clip-path: inset(6% 0 69% 0);
clip-path: inset(6% 0 69% 0);
}
45% {
-webkit-clip-path: inset(6% 0 11% 0);
clip-path: inset(6% 0 11% 0);
}
50% {
-webkit-clip-path: inset(93% 0 8% 0);
clip-path: inset(93% 0 8% 0);
}
55% {
-webkit-clip-path: inset(70% 0 9% 0);
clip-path: inset(70% 0 9% 0);
}
60% {
-webkit-clip-path: inset(23% 0 71% 0);
clip-path: inset(23% 0 71% 0);
}
65% {
-webkit-clip-path: inset(93% 0 4% 0);
clip-path: inset(93% 0 4% 0);
}
70% {
-webkit-clip-path: inset(74% 0 8% 0);
clip-path: inset(74% 0 8% 0);
}
75% {
-webkit-clip-path: inset(72% 0 23% 0);
clip-path: inset(72% 0 23% 0);
}
80% {
-webkit-clip-path: inset(71% 0 9% 0);
clip-path: inset(71% 0 9% 0);
}
85% {
-webkit-clip-path: inset(52% 0 3% 0);
clip-path: inset(52% 0 3% 0);
}
90% {
-webkit-clip-path: inset(42% 0 46% 0);
clip-path: inset(42% 0 46% 0);
}
95% {
-webkit-clip-path: inset(93% 0 8% 0);
clip-path: inset(93% 0 8% 0);
}
100% {
-webkit-clip-path: inset(55% 0 4% 0);
clip-path: inset(55% 0 4% 0);
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="author" content="Joshua">
<title>XXX's Website | XXX</title>
<!-- stylesheet -->
<link rel="stylesheet" href="style.css">
<!-- bootstrap cdns -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-uWxY/CJNBR+1zjPWmfnSnVxwRheevXITnMqoEIeG1LJrdI0GlVs/9cVSyPYXdcSF" crossorigin="anonymous">
<!-- hack fonts -->
<link href='//cdn.jsdelivr.net/npm/hack-font#3.3.0/build/web/hack.css' rel='stylesheet'>
</head>
<body>
<div class="d-flex flex-column min-vh-100 min-vw-100">
<!-- owner -->
<div class="container-fluid owner">
<p class="text-left">I'm XXX XXX</p>
</div>
<!-- nav bar -->
<!-- main phrase -->
<div class="container-fluid">
<p class="text-center h1 glitch" data-text="Technology is my Passion">Technology is my Passion</p>
</div>
</div>
</body>
</html>
You just need to apply the class my-auto it sets the margins on the y-axis to auto, thus centering it vertically within the available space.
/*--- basic styling ---*/
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
font-family: Hack, monospace !important;
background-color: #0f0f0f !important;
}
.owner {
color: #F4364C;
font-size: 1.2vw;
}
/*--- glitch effect ---*/
.glitch {
color: #F4364C;
position: relative;
font-size: 4vw !important;
}
.glitch::before {
color: #F4364C;
position: absolute;
content: attr(data-text);
top: 0vh;
left: 0.3vw;
width: 100%;
height: 100%;
text-shadow: -1px 0 #FFD700;
background: #0f0f0f;
overflow: hidden;
animation: glitch-anim-1 2s infinite linear alternate-reverse;
}
.glitch::after {
color: #F4364C;
position: absolute;
content: attr(data-text);
top: 0vh;
right: 0.3vw;
width: 100%;
height: 100%;
text-shadow: -1px 0 #C0C0C0;
background: #0f0f0f;
overflow: hidden;
animation: glitch-anim-2 2s infinite linear alternate-reverse;
}
#-webkit-keyframes glitch-anim-1 {
0% {
-webkit-clip-path: inset(37% 0 1% 0);
clip-path: inset(37% 0 1% 0);
}
5% {
-webkit-clip-path: inset(46% 0 40% 0);
clip-path: inset(46% 0 40% 0);
}
10% {
-webkit-clip-path: inset(99% 0 1% 0);
clip-path: inset(99% 0 1% 0);
}
15% {
-webkit-clip-path: inset(91% 0 6% 0);
clip-path: inset(91% 0 6% 0);
}
20% {
-webkit-clip-path: inset(11% 0 37% 0);
clip-path: inset(11% 0 37% 0);
}
25% {
-webkit-clip-path: inset(97% 0 1% 0);
clip-path: inset(97% 0 1% 0);
}
30% {
-webkit-clip-path: inset(24% 0 56% 0);
clip-path: inset(24% 0 56% 0);
}
35% {
-webkit-clip-path: inset(20% 0 30% 0);
clip-path: inset(20% 0 30% 0);
}
40% {
-webkit-clip-path: inset(89% 0 8% 0);
clip-path: inset(89% 0 8% 0);
}
45% {
-webkit-clip-path: inset(36% 0 60% 0);
clip-path: inset(36% 0 60% 0);
}
50% {
-webkit-clip-path: inset(5% 0 62% 0);
clip-path: inset(5% 0 62% 0);
}
55% {
-webkit-clip-path: inset(9% 0 3% 0);
clip-path: inset(9% 0 3% 0);
}
60% {
-webkit-clip-path: inset(50% 0 21% 0);
clip-path: inset(50% 0 21% 0);
}
65% {
-webkit-clip-path: inset(93% 0 4% 0);
clip-path: inset(93% 0 4% 0);
}
70% {
-webkit-clip-path: inset(68% 0 15% 0);
clip-path: inset(68% 0 15% 0);
}
75% {
-webkit-clip-path: inset(47% 0 49% 0);
clip-path: inset(47% 0 49% 0);
}
80% {
-webkit-clip-path: inset(90% 0 3% 0);
clip-path: inset(90% 0 3% 0);
}
85% {
-webkit-clip-path: inset(97% 0 3% 0);
clip-path: inset(97% 0 3% 0);
}
90% {
-webkit-clip-path: inset(45% 0 29% 0);
clip-path: inset(45% 0 29% 0);
}
95% {
-webkit-clip-path: inset(84% 0 10% 0);
clip-path: inset(84% 0 10% 0);
}
100% {
-webkit-clip-path: inset(46% 0 12% 0);
clip-path: inset(46% 0 12% 0);
}
}
#keyframes glitch-anim-1 {
0% {
-webkit-clip-path: inset(37% 0 1% 0);
clip-path: inset(37% 0 1% 0);
}
5% {
-webkit-clip-path: inset(46% 0 40% 0);
clip-path: inset(46% 0 40% 0);
}
10% {
-webkit-clip-path: inset(99% 0 1% 0);
clip-path: inset(99% 0 1% 0);
}
15% {
-webkit-clip-path: inset(91% 0 6% 0);
clip-path: inset(91% 0 6% 0);
}
20% {
-webkit-clip-path: inset(11% 0 37% 0);
clip-path: inset(11% 0 37% 0);
}
25% {
-webkit-clip-path: inset(97% 0 1% 0);
clip-path: inset(97% 0 1% 0);
}
30% {
-webkit-clip-path: inset(24% 0 56% 0);
clip-path: inset(24% 0 56% 0);
}
35% {
-webkit-clip-path: inset(20% 0 30% 0);
clip-path: inset(20% 0 30% 0);
}
40% {
-webkit-clip-path: inset(89% 0 8% 0);
clip-path: inset(89% 0 8% 0);
}
45% {
-webkit-clip-path: inset(36% 0 60% 0);
clip-path: inset(36% 0 60% 0);
}
50% {
-webkit-clip-path: inset(5% 0 62% 0);
clip-path: inset(5% 0 62% 0);
}
55% {
-webkit-clip-path: inset(9% 0 3% 0);
clip-path: inset(9% 0 3% 0);
}
60% {
-webkit-clip-path: inset(50% 0 21% 0);
clip-path: inset(50% 0 21% 0);
}
65% {
-webkit-clip-path: inset(93% 0 4% 0);
clip-path: inset(93% 0 4% 0);
}
70% {
-webkit-clip-path: inset(68% 0 15% 0);
clip-path: inset(68% 0 15% 0);
}
75% {
-webkit-clip-path: inset(47% 0 49% 0);
clip-path: inset(47% 0 49% 0);
}
80% {
-webkit-clip-path: inset(90% 0 3% 0);
clip-path: inset(90% 0 3% 0);
}
85% {
-webkit-clip-path: inset(97% 0 3% 0);
clip-path: inset(97% 0 3% 0);
}
90% {
-webkit-clip-path: inset(45% 0 29% 0);
clip-path: inset(45% 0 29% 0);
}
95% {
-webkit-clip-path: inset(84% 0 10% 0);
clip-path: inset(84% 0 10% 0);
}
100% {
-webkit-clip-path: inset(46% 0 12% 0);
clip-path: inset(46% 0 12% 0);
}
}
#-webkit-keyframes glitch-anim-2 {
0% {
-webkit-clip-path: inset(35% 0 4% 0);
clip-path: inset(35% 0 4% 0);
}
5% {
-webkit-clip-path: inset(84% 0 10% 0);
clip-path: inset(84% 0 10% 0);
}
10% {
-webkit-clip-path: inset(37% 0 13% 0);
clip-path: inset(37% 0 13% 0);
}
15% {
-webkit-clip-path: inset(86% 0 2% 0);
clip-path: inset(86% 0 2% 0);
}
20% {
-webkit-clip-path: inset(37% 0 22% 0);
clip-path: inset(37% 0 22% 0);
}
25% {
-webkit-clip-path: inset(36% 0 4% 0);
clip-path: inset(36% 0 4% 0);
}
30% {
-webkit-clip-path: inset(85% 0 10% 0);
clip-path: inset(85% 0 10% 0);
}
35% {
-webkit-clip-path: inset(40% 0 13% 0);
clip-path: inset(40% 0 13% 0);
}
40% {
-webkit-clip-path: inset(6% 0 69% 0);
clip-path: inset(6% 0 69% 0);
}
45% {
-webkit-clip-path: inset(6% 0 11% 0);
clip-path: inset(6% 0 11% 0);
}
50% {
-webkit-clip-path: inset(93% 0 8% 0);
clip-path: inset(93% 0 8% 0);
}
55% {
-webkit-clip-path: inset(70% 0 9% 0);
clip-path: inset(70% 0 9% 0);
}
60% {
-webkit-clip-path: inset(23% 0 71% 0);
clip-path: inset(23% 0 71% 0);
}
65% {
-webkit-clip-path: inset(93% 0 4% 0);
clip-path: inset(93% 0 4% 0);
}
70% {
-webkit-clip-path: inset(74% 0 8% 0);
clip-path: inset(74% 0 8% 0);
}
75% {
-webkit-clip-path: inset(72% 0 23% 0);
clip-path: inset(72% 0 23% 0);
}
80% {
-webkit-clip-path: inset(71% 0 9% 0);
clip-path: inset(71% 0 9% 0);
}
85% {
-webkit-clip-path: inset(52% 0 3% 0);
clip-path: inset(52% 0 3% 0);
}
90% {
-webkit-clip-path: inset(42% 0 46% 0);
clip-path: inset(42% 0 46% 0);
}
95% {
-webkit-clip-path: inset(93% 0 8% 0);
clip-path: inset(93% 0 8% 0);
}
100% {
-webkit-clip-path: inset(55% 0 4% 0);
clip-path: inset(55% 0 4% 0);
}
}
#keyframes glitch-anim-2 {
0% {
-webkit-clip-path: inset(35% 0 4% 0);
clip-path: inset(35% 0 4% 0);
}
5% {
-webkit-clip-path: inset(84% 0 10% 0);
clip-path: inset(84% 0 10% 0);
}
10% {
-webkit-clip-path: inset(37% 0 13% 0);
clip-path: inset(37% 0 13% 0);
}
15% {
-webkit-clip-path: inset(86% 0 2% 0);
clip-path: inset(86% 0 2% 0);
}
20% {
-webkit-clip-path: inset(37% 0 22% 0);
clip-path: inset(37% 0 22% 0);
}
25% {
-webkit-clip-path: inset(36% 0 4% 0);
clip-path: inset(36% 0 4% 0);
}
30% {
-webkit-clip-path: inset(85% 0 10% 0);
clip-path: inset(85% 0 10% 0);
}
35% {
-webkit-clip-path: inset(40% 0 13% 0);
clip-path: inset(40% 0 13% 0);
}
40% {
-webkit-clip-path: inset(6% 0 69% 0);
clip-path: inset(6% 0 69% 0);
}
45% {
-webkit-clip-path: inset(6% 0 11% 0);
clip-path: inset(6% 0 11% 0);
}
50% {
-webkit-clip-path: inset(93% 0 8% 0);
clip-path: inset(93% 0 8% 0);
}
55% {
-webkit-clip-path: inset(70% 0 9% 0);
clip-path: inset(70% 0 9% 0);
}
60% {
-webkit-clip-path: inset(23% 0 71% 0);
clip-path: inset(23% 0 71% 0);
}
65% {
-webkit-clip-path: inset(93% 0 4% 0);
clip-path: inset(93% 0 4% 0);
}
70% {
-webkit-clip-path: inset(74% 0 8% 0);
clip-path: inset(74% 0 8% 0);
}
75% {
-webkit-clip-path: inset(72% 0 23% 0);
clip-path: inset(72% 0 23% 0);
}
80% {
-webkit-clip-path: inset(71% 0 9% 0);
clip-path: inset(71% 0 9% 0);
}
85% {
-webkit-clip-path: inset(52% 0 3% 0);
clip-path: inset(52% 0 3% 0);
}
90% {
-webkit-clip-path: inset(42% 0 46% 0);
clip-path: inset(42% 0 46% 0);
}
95% {
-webkit-clip-path: inset(93% 0 8% 0);
clip-path: inset(93% 0 8% 0);
}
100% {
-webkit-clip-path: inset(55% 0 4% 0);
clip-path: inset(55% 0 4% 0);
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="author" content="Joshua">
<title>XXX's Website | XXX</title>
<!-- stylesheet -->
<link rel="stylesheet" href="style.css">
<!-- bootstrap cdns -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-uWxY/CJNBR+1zjPWmfnSnVxwRheevXITnMqoEIeG1LJrdI0GlVs/9cVSyPYXdcSF" crossorigin="anonymous">
<!-- hack fonts -->
<link href='//cdn.jsdelivr.net/npm/hack-font#3.3.0/build/web/hack.css' rel='stylesheet'>
</head>
<body>
<div class="d-flex flex-column min-vh-100 min-vw-100">
<!-- owner -->
<div class="container-fluid owner">
<p class="text-left">I'm XXX XXX</p>
</div>
<!-- nav bar -->
<!-- main phrase -->
<div class="container-fluid my-auto">
<p class="text-center h1 glitch" data-text="Technology is my Passion">Technology is my Passion</p>
</div>
</div>
</body>
</html>

CSS Background Gradient has nast line cut through it.

I've got this great website with a full screen gradient background. But it has this nasty line through it at the end of the cycle.. What am I doing wrong?
https://codepen.io/jonathansafa/pen/pWjvoO
.background{position:absolute;top:0px;right:0px;bottom:0px;left:0px; z-index: -1;}
.awesomeBG {
background: linear-gradient(to left, #165730, #185a9d, #165730, #185a9d);
background-size: 600% 100%;
animation: AwesomeBG 10s ease infinite;
overflow: hidden;
}
#keyframes AwesomeBG {
0% { background-position:0 0 }
5% { background-position:8% 0 }
13% { background-position:15% 0 }
19% { background-position:23% 0 }
25% { background-position:30% 0 }
31% { background-position:38% 0 }
38% { background-position:45% 0 }
44% { background-position:53% 0 }
50% { background-position:60% 0 }
56% { background-position:68% 0 }
63% { background-position:75% 0 }
69% { background-position:83% 0 }
75% { background-position:90% 0 }
81% { background-position:98% 0 }
88% { background-position:105% 0 }
94% { background-position:113% 0 }
100% { background-position:120% 0 }
}
It's because your gradient starts and ends with different colors (starts with #165730 and ends with #185a9d). If you want to get smooth transition without that line, you need to start and to finish your gradient with the same colors. Here is the working fiddle: https://jsfiddle.net/7dvovgr7/
And the snippet:
.background{position:absolute;top:0px;right:0px;bottom:0px;left:0px; z-index: -1;}
.awesomeBG {
background: linear-gradient(to left, #165730, #185a9d, #165730, #185a9d, #165730);
background-size: 600% 100%;
animation: AwesomeBG 10s ease infinite;
overflow: hidden;
}
#keyframes AwesomeBG {
0% { background-position:0 0 }
5% { background-position:8% 0 }
13% { background-position:15% 0 }
19% { background-position:23% 0 }
25% { background-position:30% 0 }
31% { background-position:38% 0 }
38% { background-position:45% 0 }
44% { background-position:53% 0 }
50% { background-position:60% 0 }
56% { background-position:68% 0 }
63% { background-position:75% 0 }
69% { background-position:83% 0 }
75% { background-position:90% 0 }
81% { background-position:98% 0 }
88% { background-position:105% 0 }
94% { background-position:113% 0 }
100% { background-position:120% 0 }
}
<body>
<div class="background awesomeBG"></div>
</body>
There is nothing wrong.
It seems you may have just found bug on codepen.
See for yourself.
.background{
display: flex;
position:absolute;top:0px;right:0px;bottom:0px;left:0px; z-index: -1;}
.awesomeBG {
background: linear-gradient(to left, #165730, #185a9d, #165730, #185a9d, #165730); /*make sure you start and end with the same color*/
background-size: 600% 100%;
animation: AwesomeBG 10s ease infinite;
overflow: hidden;
}
#keyframes AwesomeBG {
0% { background-position:0 0 }
5% { background-position:8% 0 }
13% { background-position:15% 0 }
19% { background-position:23% 0 }
25% { background-position:30% 0 }
31% { background-position:38% 0 }
38% { background-position:45% 0 }
44% { background-position:53% 0 }
50% { background-position:60% 0 }
56% { background-position:68% 0 }
63% { background-position:75% 0 }
69% { background-position:83% 0 }
75% { background-position:90% 0 }
81% { background-position:98% 0 }
88% { background-position:105% 0 }
94% { background-position:113% 0 }
100% { background-position:120% 0 }
}
<body>
<div class="background awesomeBG"></div>
</body>