I am building an on-boarding screen.
It has few cards, you can switch between them using the next and back buttons.
I've been trying to make the next and back buttons work using only :target
So, I've given each card an ID and each button a href="#id".
As far as I can tell, everything is set up for it to work, but it is not working.
/*////////////////////////////////////////////////////////////////////////////*/
/*onboarding canvas*/
/*////////////////////////////////////////////////////////////////////////////*/
#onboarding-canvas {
position: fixed;
top: 0; left: 0;
right: 0; bottom: 0;
width: 100%;
height: 100%;
z-index: 10000000;
overflow-y: overlay;
}
/*==========================================================================*/
/*onboarding intro*/
#onboarding-canvas .onboarding-intro {
color: #fff;
background-color: #4E42C3;
display: table;
vertical-align: middle;
position: fixed;
left: 0; right: 0;
bottom: 0; top: 0;
width: 100%;
height: 100%;
pointer-events: none;
animation-name: onboardingIntro;
animation-fill-mode: forwards;
animation-duration: 1s;
animation-delay: 13s;
}
#keyframes onboardingIntro {
0% {
}
100% {
background-color: transparent;
}
}
#-webkit-keyframes onboardingIntro {
0% {
}
100% {
background-color: transparent;
}
}
#onboarding-canvas .onboarding-intro-stages {
display: table-cell;
vertical-align: middle;
position: relative;
margin: 0 auto;
}
#onboarding-canvas .onboarding-intro-stage {
position: absolute;
margin-top: -40px;
left: 0; right: 0;
opacity: 0;
}
#onboarding-canvas .onboarding-intro-stage p {
font-size: 1.7em;
}
/*onboarding intro animation*/
#onboarding-canvas .onboarding-intro .stage1 {
animation-name: onboardingIntroStage1;
animation-duration: 4s;
animation-delay: 1s;
}
#onboarding-canvas .onboarding-intro .icon-hand-wave {
width: 100%;
font-size: 2em;
margin-bottom: 50px;
}
#keyframes onboardingIntroStage1 {
0% {
}
20% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
opacity: 0;
}
}
#-webkit-keyframes onboardingIntroStage1 {
0% {
}
20% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
opacity: 0;
}
}
#onboarding-canvas .onboarding-intro .stage2 {
animation-name: onboardingIntroStage2;
animation-duration: 4s;
animation-delay: 5s;
}
#keyframes onboardingIntroStage2 {
0% {
}
20% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
opacity: 0;
}
}
#-webkit-keyframes onboardingIntroStage2 {
0% {
}
20% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
opacity: 0;
}
}
#onboarding-canvas .onboarding-intro .stage3 {
animation-name: onboardingIntroStage2;
animation-duration: 4s;
animation-delay: 9s;
}
#keyframes onboardingIntroStage3 {
0% {
}
20% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
opacity: 0;
}
}
#-webkit-keyframes onboardingIntroStage3 {
0% {
}
20% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
opacity: 0;
}
}
/*onboarding fireworks*/
#onboarding-canvas .onboarding-intro .fireworks {
pointer-events: none;
animation-name: onboarding-intro-fireworks;
animation-fill-mode: forwards;
animation-duration: 1s;
animation-delay: 5s;
}
#keyframes onboarding-intro-fireworks {
0% {
}
100% {
opacity: 0;
}
}
#-webkit-keyframes onboarding-intro-fireworks {
0% {
}
100% {
opacity: 0;
}
}
/*==========================================================================*/
/*onboarding card*/
#onboarding-canvas .onboarding-cards {
background-color: rgba(39,47,65,0.95);
padding: 20px 20px 90px 20px;
width: 100%;
height: 100vh;
display: table;
overflow-y: scroll;
-webkit-transition: all .25s ease;
transition: all .25s ease;
}
/*onboarding card wrapper*/
#onboarding-canvas .onboarding-card-wrapper {
display: table-cell;
vertical-align: middle;
margin: 0 auto;
display: none;
}
#onboarding-canvas > div > div:target {
display: table-cell;
}
#onboarding-canvas > div > div:first-of-type {
display: table-cell;
}
/*onboarding card content*/
#onboarding-canvas .onboarding-card {
background-color: #fff;
border-radius: 5px;
text-align: left;
width: 100%;
max-width: 500px;
margin: 0 auto;
position: relative;
-webkit-box-shadow: 0px 0px 50px 0px rgba(39,47,65,0.2);
-moz-box-shadow: 0px 0px 50px 0px rgba(39,47,65,0.2);
box-shadow: 0px 0px 50px 0px rgba(39,47,65,0.2);
}
/*card image*/
#onboarding-canvas .onboarding-card-image {
}
#onboarding-canvas .onboarding-card-image img {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
/*card content*/
#onboarding-canvas .onboarding-card-content {
padding: 30px;
}
#onboarding-canvas .onboarding-card-content .card-title {
font-size: 1.16em;
position: relative;
top: -5px;
margin-bottom: -7px;
}
#onboarding-canvas .onboarding-card-content .card-title span {
color: #4E42C3;
font-weight: bold;
}
/*----------------------------------------------------------------------*/
/*card tips*/
#onboarding-canvas .onboarding-card-tips {
border-top: 1px solid #E6ECF0;
text-align: left;
padding: 30px;
}
#onboarding-canvas .onboarding-card-tips .label {
color: #48556B;
background-color: #fff;
border: 1px solid #E6ECF0;
margin-right: 6px;
}
#onboarding-canvas .onboarding-card-tips {
}
/*----------------------------------------------------------------------*/
/*card features*/
#onboarding-canvas .onboarding-card-features {
}
#onboarding-canvas .onboarding-card-features li {
margin-bottom: 15px;
}
#onboarding-canvas .onboarding-card-features li:last-of-type {
margin-bottom: 0;
}
#onboarding-canvas .onboarding-card-features li i {
color: #4E42C3;
font-size: 1.2em;
}
/*----------------------------------------------------------------------*/
/*card action buttons*/
#onboarding-canvas .onboarding-card-actions {
overflow: hidden;
padding-top: 20px;
width: 100%;
text-align: center;
position: absolute;
left: 0; right: 0;
margin: 0 auto;
}
#onboarding-canvas .onboarding-card-actions .button {
color: #fff;
background-color: transparent;
border: 2px solid #fff;
display: inline-block;
margin: 0 7px;
}
#onboarding-canvas .onboarding-card-actions .button:hover {
background-color: #fff;
color: #272F41;
}
#onboarding-canvas .onboarding-card-actions .next-button {
font-weight: bold;
}
#onboarding-canvas .onboarding-card-actions .back-button {
border: 2px solid transparent;
}
/*------------------------------------------------------------------------*/
#onboarding-canvas .onboarding-card.card1 {
}
<div id="onboarding-canvas">
<div class="onboarding-cards">
<div class="onboarding-card-wrapper" id="onboardingCard1">
<div class="onboarding-card card1">
<div class="onboarding-card-image">
<img src="https://plutio.com/app/onboarding/onboarding-card-1.gif" />
</div>
<div class="onboarding-card-content">
<p class="card-title"><span>Create tasks</span> for whatever needs to get done. Plutio will help keep your tasks list organized so you can stay focused.</p>
</div>
<div class="onboarding-card-tips">
<p><span class="label">Good to know</span> Your tasks are automatically sorted into categories, there is a category for what's due today, tomorrow and next week.</p>
</div>
<div class="onboarding-card-actions">
<a class="button next-button next">Nice, what's next?</a>
</div>
</div>
</div>
<div class="onboarding-card-wrapper" id="onboardingCard2">
<div class="onboarding-card card2">
<div class="onboarding-card-image">
<img src="https://plutio.com/app/onboarding/onboarding-card-2.gif" />
</div>
<div class="onboarding-card-content">
<p class="card-title"><span>Manage your projects</span> in one place. Create and sort their tasks in milestones or progress stages, upload files and replace messy emails with focused discussions.</p>
</div>
<div class="onboarding-card-tips">
<p><span class="label">Good to know</span> You can customize the set of statuses every project moves through during their lifecycle.</p>
</div>
<div class="onboarding-card-actions">
<a class="button back-button back" href="#onboardingCard1">Back</a>
<a class="button next-button next" href="#onboardingCard3">Next</a>
</div>
</div>
</div>
<div class="onboarding-card-wrapper" id="onboardingCard3">
<div class="onboarding-card card3">
<div class="onboarding-card-image">
<img src="https://plutio.com/app/onboarding/onboarding-card-3.gif" />
</div>
<div class="onboarding-card-content">
<p class="card-title"><span>Collaborate with your clients and contributors</span>. Start private conversations or create group channels and get everyone involved.</p>
</div>
<div class="onboarding-card-tips">
<p><span class="label">Good to know</span> When you create a project, a dedicated channel with all the project contributors is automatically created.</p>
</div>
<div class="onboarding-card-actions">
<a class="button back-button back" href="#onboardingCard2">Back</a>
<a class="button next-button next" href="#onboardingCard4">Next</a>
</div>
</div>
</div>
<div class="onboarding-card-wrapper" id="onboardingCard4">
<div class="onboarding-card card4">
<div class="onboarding-card-image">
<img src="https://plutio.com/app/onboarding/onboarding-card-4.gif" />
</div>
<div class="onboarding-card-content">
<p class="card-title"><span>Manage your business contacts</span>. No more sifting through emails and business cards. Plutio brings your clients, contributors and contacts to one place.</p>
</div>
<div class="onboarding-card-tips">
<p><span class="label">Good to know</span> Your clients can only view projects and tasks that are assigned to them.</p>
</div>
<div class="onboarding-card-actions">
<a class="button back-button back" href="#onboardingCard3">Back</a>
<a class="button next-button next" href="#onboardingCard5">Next</a>
</div>
</div>
</div>
<div class="onboarding-card-wrapper" id="onboardingCard5">
<div class="onboarding-card card4">
<div class="onboarding-card-image">
<img src="https://plutio.com/app/onboarding/onboarding-card-5.gif" />
</div>
<div class="onboarding-card-content">
<p class="card-title"><span>{{ customer.first_name }}, say hi to Leo, your very own account manager!</span> Feel free to ask him anything. He can even help set up your account.</p>
</div>
<div class="onboarding-card-actions">
<a class="button back-button back" href="#onboardingCard4">Back</a>
<a class="button next-button complete" href="#onboardingCard6">This is amazing, let's get started!</a>
</div>
</div>
</div>
</div>
<!--
<div class="onboarding-intro">
<div class="onboarding-intro-stages">
<div class="onboarding-intro-stage stage1 content">
<p><i class="icon-hand-wave animation-set"></i> Welcome to Plutio, {{ customer.first_name }}.</p>
</div>
<div class="onboarding-intro-stage stage2 content">
<p>We're setting up your account, it won't take a minute...</p>
</div>
<div class="onboarding-intro-stage stage3 content">
<p>In the meantime, here's a quick introduction into Plutio...</p>
</div>
<div class="fireworks">
<div class="before"></div>
<div class="after"></div>
</div>
</div>
</div>
-->
</div>
You forgot the href in the first link.
<a class="button next-button next">Nice, what's next?</a>
Related
I'm trying to make an animated border for a div. I unhid the overflow of its formatting element so that I could see what the issue was. I'd like to make the center of rotation the center of the larger div.
I know I can make the center of rotation higher by setting the width and height of the before psuedoelement to that of its container, but I want to make it taller because if I set the width and height to its formatting element, it's too small and doesn't cover the edges.
I've tried using CSS positioning, but it isn't working and I have no idea why.
<div class="center">
<div class="wrapper">
<div class="directory module">
<div id="header" class="small_wrapper center">
<div class="module">
<p style="font-size: 22px">Placeholder</p>
</div>
</div>
<div class="directory_bar small_wrapper center"><div class="module">About Me</div></div>
<div class="directory_bar small_wrapper center"><div class="module">PC Builds</div></div>
<div class="directory_bar small_wrapper center"><div class="module">Original Characters</div></div>
<div class="directory_bar small_wrapper center"><div class="module">Games & Loadouts</div></div>
<div class="directory_bar small_wrapper center"><div class="module">Socials</div></div>
</div>
</div>
</div>
#charset "utf-8";
#keyframes rotate {
0% {
transform: rotate(0);
}
50% {
transform: rotate(180deg);
}
100% {
transform: rotate(360deg);
}
}
html {
font-size: 3.0vh;
}
body {
background-color: #2C2C2C;
font-family: Urbanist, sans serif;
color: white;
}
p {
margin: 0;
}
.left, .right, .center {
position: relative;
}
.center {
margin-left: auto;
margin-right: auto;
}
.module {
background-color:#2C2C2C;
text-align: center;
padding: 10px;
border-radius: 18px;
z-index: 1000;
position: relative;
}
.wrapper, .small_wrapper {
position: relative;
width: fit-content;
height: fit-content;
background: blue;
z-index: 1000;
}
.wrapper {
border-radius: 20px;
padding: 4px;
}
.wrapper::before {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: linear-gradient(to right, rgb(255, 0, 0), rgb(145,
255, 0), rgb(189, 1, 180));
animation: rotate;
animation-duration: 3s;
animation-iteration-count: infinite;
animation-timing-function: linear;
content: '';
border-radius: 20px;
height: 1000px;
}
.small_wrapper {
padding: 3px;
}
.directory_bar {
margin-top: 5vh;
}
.directory {
padding: 5vh;
}
.center > .wrapper {
margin-left: 100px;
}
.directory_bar, #header {
border-radius: 8px;
}
.directory_bar > .module, #header > .module {
border-radius: 7px;
}
So as said above, I have (for fun) recreated a website (hologram.io), because I'm new to CSS, and just wanted to see what I can do myself without help... But I can't figure out how I can position the whole first section which is absolute (-> On top of an Image) center, center. So vertical and horizontal, So that on bigger screens it always stays perfectly in the center of the menu... On the other sections which are not absolute, I used display: flex, justify-content: center and align-items center, which works perfectly... On the screenshots I have included, you can see the problem... Also, will include the code. It looks a bit messy, but should be fine haha...
Here you can see the noncentered Absolute item
Here you can see the flex items which are perfectly centered on every screensize and
And here for Refernce is the hologram website...
#font-face {
font-family: Robert Sans;
src: url(RobertSans-Regular.ttf);
}
#navtextonly li {
list-style-type: none;
display: inline;
padding: 15px;
text-align: center;
}
.listitem:hover {
cursor: pointer;
color: #4e6cff;
}
#hologramlogo {
margin-top: 20px;
margin-bottom: 20px;
margin-right: 0px;
padding-right: 0px;
}
nav {
background-color: rgb(255, 255, 255);
}
body {
margin: 0px;
font-family: Robert Sans;
}
#navbarouter {
display: flex;
align-items: center;
justify-content: center;
}
#navtextonly {
white-space: nowrap;
}
#mainmenuwobtnlogo {
margin-right: 100px;
}
ul {
font-size: 16px;
}
#buttonsmenu1 {
background-color: white;
border: 1px solid #4e6cffce;
padding: 12px 23px 12px 23px;
border-radius: 25px;
margin-right: 15px;
-webkit-box-shadow: 2px 2px 15px 1px #999999;
box-shadow: 2px 2px 15px 1px #999999;
}
#buttonsmenu1:hover {
border-color: #111;
cursor: pointer;
}
#buttonsmenu2 {
background-color: #4e6cff;
padding: 12px 23px 12px 23px;
color: white;
border-radius: 25px;
-webkit-box-shadow: 2px 2px 15px 1px #999999;
box-shadow: 2px 2px 15px 1px #999999;
}
#buttonsmenu2:hover {
background-color: #788fff;
color: white;
cursor: pointer;
}
.buttonsmenuouter {
margin-left: 25px;
}
#hamburgernav {
display: none;
}
#backgroundverlauf {
height: 800px;
width: 100%;
background-size: cover;
background-repeat: no-repeat;
}
.mainheading {
font-size: 64px;
white-space: nowrap;
font-weight: 400;
}
#h1top,
#h1bottom {
margin: 0px;
padding: 0px;
}
article {
color: rgb(255, 255, 255);
max-width: 550px;
}
#ellipse {
position: absolute;
top: 0px;
left: 630px;
}
#drohnepng {
position: absolute;
top: -50px;
left: 880px;
height: 80px;
}
#cartpng {
position: absolute;
top: 80px;
left: 585px;
height: 250px;
}
#rollerpng {
position: absolute;
top: 140px;
left: 825px;
height: 440px;
}
#content1 {
position: absolute;
top: 250px;
left: 12%;
}
#outerouter {
max-width: 1300px;
}
#glowh1 {
background: linear-gradient(
-60deg,
#904e95,
#904e95,
#e73c7e,
#ee7752,
#4e6cff,
white
);
background-size: 600%;
-webkit-text-fill-color: transparent;
-webkit-background-clip: text;
animation: animate 10s linear infinite;
}
#keyframes animate {
0% {
background-position: 0%;
}
100% {
background-position: 600%;
}
}
#paragraph {
width: 390px;
color: rgb(199, 199, 199);
font-size: 20px;
margin-bottom: 30px;
}
#emailwithsubmit {
display: flex;
}
.emailfeld {
width: 100%;
padding: 18px 23px 18px 23px;
border-radius: 25px 26px 26px 25px;
border-width: 0px;
border: 1px red solid;
}
#submitbtn {
padding: 18px 35px 18px 35px;
border-radius: 25px 25px 25px 25px;
color: white;
font-weight: 600;
border-width: 0px;
background-image: linear-gradient(90deg, #00a6ff, #7831ca, #fe17c0);
position: relative;
left: -60px;
}
#mainpart2,
#mainpart3 {
display: flex;
align-items: center;
justify-content: center;
margin: 100px 60px 100px 60px;
}
#mainpart2-3outer {
}
#card {
margin-left: 60px;
margin-right: 100px;
height: 280px;
/* -webkit-animation: fadein 3.2s both;
-moz-animation: fadein 3.2s both;
-o-animation: fadein 3.2s both;
animation: fadein 3.2s both; */
animation: float2 6s ease-in-out infinite;
}
#keyframes float2 {
0% {
transform: translatey(0px);
}
50% {
transform: translateX(-10px);
}
100% {
transform: translatey(0px);
}
}
#-webkit-keyframes fadein {
0% {
opacity: 0;
-webkit-transform: translateX(-25px);
}
100% {
opacity: 1;
-webkit-transform: translateX(0);
}
}
#-moz-keyframes fadein {
0% {
opacity: 0;
-moz-transform: translateX(-50px);
}
100% {
opacity: 1;
-moz-transform: translateX(0);
}
}
#-0-keyframes fadein {
0% {
opacity: 0;
-o-transform: translateX(-50px);
}
100% {
opacity: 1;
-o-transform: translateX(0);
}
}
#keyframes fadein {
0% {
opacity: 0;
transform: translateX(-50px);
}
100% {
opacity: 1;
transform: translateX(0);
}
}
#ellipse {
-webkit-animation: fade 5s both;
-moz-animation: fade 5s both;
-o-animation: fade 5s both;
animation: fade 5s both;
}
#-webkit-keyframes fade {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#-moz-keyframes fade {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#-0-keyframes fade {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#keyframes fade {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#cartpng,
#drohnepng,
#rollerpng {
/* -webkit-animation: fadein 3.2s both;
-moz-animation: fadein 3.2s both;
-o-animation: fadein 3.2s both;
animation: fadein 3.2s both;
transform: translatey(0px); */
animation: float 6s ease-in-out infinite;
}
#keyframes float {
0% {
transform: translatey(0px);
}
50% {
transform: translatey(-50px);
}
100% {
transform: translatey(0px);
}
}
#mainh-1,
#mainp-1 {
max-width: 280px;
}
#mainh-2,
#mainp-2 {
max-width: 280px;
}
.main1h,
.main1p,
.main2h,
.main2p {
display: flex;
flex-direction: row;
justify-content: space-between;
}
#mainh-3,
#mainp-3 {
max-width: 280px;
}
#mainh-4,
#mainp-4 {
max-width: 280px;
}
#mainh-1,
#mainh-2,
#mainh-3,
#mainh-4 {
margin: 0px;
padding: 0px;
}
#textmainpart2 {
margin-right: 60px;
}
.main2h1 {
margin-bottom: 40px;
}
.contentmainpart3-1 {
max-width: 475px;
margin-left: 60px;
}
.contentmainpart3-2 {
margin-right: 60px;
}
#beforefootercentered {
text-align: center;
margin-bottom: 75px;
}
.beforefootercolumncontent {
display: flex;
flex-direction: row;
justify-content: center;
gap: 100px;
margin-left: 100px;
margin-right: 100px;
margin-bottom: 50px;
}
.beforefootericons {
height: 66px;
width: 66px;
}
#beforefootercolumncontent1,
#beforefootercolumncontent2,
#beforefootercolumncontent3 {
max-width: 280px;
text-align: center;
}
#list2banner {
display: flex;
flex-direction: row;
margin-top: 20px;
}
#list1bannerouter {
max-width: 725px;
}
.footerbanner {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
background-image: linear-gradient(90deg, #7831ca, #00a5ff);
margin: 0px 190px 0px 190px;
border-radius: 10px;
padding-left: 30px;
padding-top: 25px;
padding-right: 30px;
padding-bottom: 50px;
color: white;
position: relative;
top: 100px;
}
.footerbanner h2 {
font-size: 40px;
font-weight: 400;
margin-bottom: 10px;
}
#list1banner {
margin: 0;
padding: 0;
list-style: none;
display: flex;
}
#list1banner li:before {
content: "✓";
padding-right: 5px;
}
#btn1,
#btn2 {
border-radius: 25px;
padding: 10px 20px 10px 20px;
}
#btn1 {
margin-right: 20px;
background-color: #111;
border-width: 0px;
}
#btn2 {
background-image: transparent;
border: 1px solid white;
}
#pfeil {
margin-left: 5px;
}
#mainfooter {
height: 600px;
background-color: #0a1435;
}
#mainfooterupper {
height: 100px;
background-color: #0a1435;
display: none;
}
.item1 {
margin-right: 20px;
}
#placehold {
position: absolute;
top: 3100px;
left: 50%;
transform: translate(-50%, -50%);
color: rgb(255, 255, 255);
font-size: 70px;
}
#media only screen and (max-width: 1350px) {
html,
body {
overflow-x: hidden;
}
body {
position: relative;
}
#navtextonly {
font-size: 14px;
}
li {
padding-right: 20px;
}
#mainmenuwobtnlogo {
margin-left: 0px;
margin-right: 0px;
}
#navbarouter {
display: flex;
}
#hologramlogo {
margin-top: 20px;
margin-bottom: 20px;
margin-left: 0px;
width: 120px;
}
.buttonsmenuouter {
margin-left: 25px;
font-size: 14px;
margin-right: 0px;
}
#buttonsmenu1,
#buttonsmenu2 {
padding: 9px 17px 9px 17px;
}
#backgroundverlauf {
height: 800px;
width: 100%;
background-size: cover;
background-repeat: no-repeat;
}
}
#media only screen and (max-width: 990px) {
html,
body {
overflow-x: hidden;
}
body {
position: relative;
}
#navtextonly {
display: none;
}
#navbarouter {
margin-left: 20px;
margin-right: 20px;
display: flex;
justify-content: space-between;
}
#hologramlogo {
margin-top: 20px;
margin-bottom: 20px;
margin-left: 20px;
}
.buttonsmenuouter {
margin-left: 0px;
}
#hamburgernav {
margin-top: 20px;
margin-bottom: 20px;
margin-left: 20px;
margin-right: 20px;
display: inline;
}
#backgroundverlauf {
height: 800px;
width: 100%;
background-size: cover;
background-repeat: no-repeat;
}
.mainheading {
font-size: 50px;
}
#paragraph {
font-size: 19px;
}
}
#media only screen and (max-width: 570px) {
.mainheading {
font-size: 30px;
}
#paragraph {
font-size: 16px;
}
#content1 {
position: absolute;
top: 175px;
}
article {
color: rgb(255, 255, 255);
max-width: 500px;
display: flex;
flex-direction: column;
margin-right: 20px;
}
#floatingimages {
display: none;
}
#paragraph {
width: 300px;
color: rgb(199, 199, 199);
font-size: 16px;
margin-bottom: 30px;
}
#backgroundverlauf {
height: 500px;
}
.emailfeld {
width: 80%;
padding-bottom: 20px;
padding: 13px 20px 13px 20px;
border-radius: 25px 26px 26px 25px;
border-width: 0px;
border: 1px red solid;
}
#submitbtn {
width: 87%;
position: absolute;
left: 10px;
top: 280px;
padding-bottom: 20px;
padding: 13px 20px 13px 20px;
border-radius: 25px 26px 26px 25px;
border-width: 0px;
border: 1px red solid;
/*
padding: 13px 30px 13px 30px;
border-radius: 25px 25px 25px 25px;
color: white;
font-weight: 600;
margin-left: 0px;
border-width: 0px;
background-image: linear-gradient(90deg, #00a6ff, #7831ca, #fe17c0);*/
}
#emailwithsubmit {
display: flex;
gap: 13px;
flex-direction: column;
align-items: center;
}
}
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="styles2.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Index2</title>
</head>
<div>
<nav>
<div id="navbarouter">
<img
id="hologramlogo"
src="610f51dabc2bd752a968dfac_Hologram Logo Black Text.svg"
alt="Logo"
width="130px"
/>
<ul id="navtextonly">
<li class="listitem">Cellular IoT</li>
<li class="listitem">Why Hologram</li>
<li class="listitem">Resources</li>
<li class="listitem">Plans</li>
<li class="listitem">Jobs</li>
<li class="listitem">Store</li>
<span class="buttonsmenuouter">
<li id="buttonsmenu1">Contact Sales</li>
<li id="buttonsmenu2">Sign in</li>
</span>
</ul>
<div id="hamburgernavouter">
<img id="hamburgernav" src="hamburgernav.svg" alt="hamburgernav" />
</div>
</div>
</nav>
<div id="outerouterouter">
<img
src="background1.png"
id="backgroundverlauf"
alt="backgroundverlauf"
/>
<div id="outerouter">
<div id="content1">
<article>
<h1 class="mainheading" id="h1top">Internet everywhere.</h1>
<p class="mainheading" id="h1bottom">For every<span id="glowh1">thing</span>.</p>
<p id="paragraph">Spend less time monitoring your IoT deployments and more time innovating. Hologram's cellular platform enables you to connect and manage any device, anywhere in the world.</p>
<div id="emailwithsubmit">
<input type="email" class="emailfeld" autocomplete="email" maxlength="256" name="Email" data-name="Email" placeholder="E-Mail-Adresse" id="email" data-validation="email required email length" required="" data-validation-event="keyup change" data-validation-length="max256">
<input type="submit" value="Get started" data-wait="Please wait..." class="c-button is--gradient w-button disabled" disabled="disabled" id="submitbtn">
</div>
</article>
<div id="floatingimages">
<img class="sideimages" id="ellipse" src="backgroundellipse.png" alt="ellipse">
<img class="sideimages" id="drohnepng" src="drohne.png" alt="drohne">
<img class="sideimages" id="cartpng" src="cart.png" alt="cart">
<img class="sideimages" id="rollerpng" src="roller.png" alt="roller">
</div>
</div>
</div>
</div>
<div id="mainpart2-3outer">
<div id="mainpart2">
<div id="cardcontainer">
<img id ="card" src="card.png" alt="card">
</div>
<div id="textmainpart2">
<h1 class="main2h1"> Testüberschrift: global IoT connectivity platform</h1>
<div class="main1h">
<h2 id="mainh-1">One global SIM card</h2>
<h2 id="mainh-2">Automatic carrier switching</h2>
</div>
<div class="main1p">
<p id="mainp-1">Connect to 470+ networks in 200 countries using a single hardware-agnostic SIM card or eSIM eUICC chip. </p>
<p id="mainp-2">Hologram SIMs automatically switch between local carriers to ensure you have top performance and never lose service.</p>
</div>
<div class="main2h">
<h2 id="mainh-3">Flexible, scalable pricing</h2>
<h2 id="mainh-4">Connectivity tools for your team</h2>
</div>
<div class="main2p">
<p id="mainp-3">No contracts, quotas, or negotiations. Activate, change, or pause plans anytime via our Hologram Dashboard or APIs.</p>
<p id="mainp-4">Collaboratively manage your fleet with ease via our easy-to-use Dashboard or our modern REST API.</p>
</div>
</div>
</div>
<div id="mainpart3">
<div class="contentmainpart3-1">
<img src="hyper.svg" alt="hyper">
<h1>Testüberschrift2: flexibility and coverage with Hyper</h1>
<p>Future-proof your SIMs and scale faster globally with Hyper, Hologram’s eUICC SIMs and platform. Hyper provides over-the-air, updatable access to Hologram’s full portfolio of IoT connectivity partners and profiles.</p>
<p>What is Hyper? --></p>
</div>
<div class="contentmainpart3-2">
<img src="image maincontent3.png" alt="ballwiththingsmainpart3right" height= "570px">
</div>
</div>
</div>
<div id="beforefootercentered">
<h1>Scaling connectivity has never been so easy</h1>
<p>The simplest way to get your IoT deployment connected worldwide.</p>
</div>
<div class="beforefootercolumncontent">
<div id="beforefootercolumncontent1">
<img src="antenne.svg" loading="lazy" alt="cell tower icon" class="beforefootericons">
<h3 class="">No hassles or headaches</h3>
<p class="">Focus on your product and data — not connectivity infrastructure, negotiations, and pricing.</p>
</div>
<div id="beforefootercolumncontent2">
<img src="speedometer.svg" loading="lazy" alt="dashboard icon" class="beforefootericons">
<h3 class="">Ready to grow your business</h3>
<p class="">Manage global deployments from a single connectivity platform with pricing that scales as you do.</p>
</div>
<div id="beforefootercolumncontent3">
<img src="settings.svg" loading="lazy" alt="gear icon" class="beforefootericons">
<h3 class="">All the tools you need</h3>
<p class="">Our Hologram Dashboard, REST API, and supported hardware make integrating connectivity easy.</p>
</div>
</div>
<footer>
<div id="mainfooterupper"></div>
<div class="footerbanner">
<div id="list1bannerouter">
<h2>Try Hologram today.</h2>
<ul id="list1banner">
<li class="item1">Free Sim</li>
<li class="item1">1 MB/mo free</li>
<li>Connect and scale in days</li>
</ul>
</div>
<div id="list2banner">
<div id="btn1">Sign up free<img id="pfeil" src="pfeil.svg"></div>
<div id="btn2">Contact sales <img id="pfeil" src="pfeil.svg"></div>
</div>
</div>
<div id="mainfooter">
<h1 id="placehold">Footer Items Soon</h1>
</div>
</footer>
</main>
</body>
</html>
Use this to your container[absolute] element
.container{
position: absolute;
/* For Vertically center */
top: 50%;
transform: translateY(-50%);
/* For Horizontally center */
left: 50%;
transform: translateX(-50%);
}
If You're using height and width without positioning use this
.container{
--height: 100px;
height: var(--height);
/* Horizontally Center */
margin: auto;
/* Vertically Center */
margin-top: calc(50% - var(--height));
}
I'm trying to create a continuous vertical scroller effect, however having a couple of issues;
The first line appears, without stopping, like the rest of the
line
I can't seem to fade-in or fade-out
For the first point, I've tried adjusting the keyframe at 0%, too many different options and div heights, but haven't got anywhere.
On the second point, i've tried adding from: {opacity: 0.5} and to: {opacity: 0.5}, again to no success.
How do I stop the scrolling effect at the first line, like what happens with the subsequent line and add a fade-in fade-out effect?
JSFiddle: https://jsfiddle.net/ekzvLhmx/
CSS
.tagTextContainer {
text-align: left;
display: inline-flex;
width: 100%;
margin: 5px;
border-bottom: 1px solid #dcdfe5;
}
.tagText {
text-align: left;
color: black;
font-size: 13px;
}
.scrollCont {
font: normal 40px/50px monospace;
float: left;
overflow: hidden;
position: relative;
height: 18px;
top: 0px;
}
.scrollCont .scrollOptions {
font-size: 13px;
display: inline-block;
color: black;
position: relative;
top: 0;
left: 0;
/*animation*/
animation: scroll 10s;
/*animation-iteration-count*/
animation-iteration-count: infinite;
/*animation-delay*/
animation-delay: 1.5s;
}
#keyframes scroll {
0% {
top: 0px;
}
20% {
top: -66px;
}
40% {
top: -116px;
}
60% {
top: -166px;
}
80% {
top: -216px;
}
}
HTML
<div class="tagTextContainer">
<span class="tagText">
Options:
</span>
<div class="scrollCont">
<div class="scrollOptions">
SJDIUNE92323232<br />
FHD_231232_FSD<br />
RUG_12£321231$3<br />
LA21312321_TQ<br />
2132131/232 123
</div>
</div>
</div>
The problem is the first item is a little below what you expect.
I modified your version a little here
<div class="tagTextContainer">
<span class="tagText">
Options:
</span>
<div class="scrollCont">
<div class="scrollOptions">
SJDIUNE92323232<br />
FHD_231232_FSD<br />
RUG_12£321231$3<br />
LA21312321_TQ<br />
2132131/232 123
</div>
</div>
</div>
.tagTextContainer {
text-align: left;
display: inline-flex;
width: 100%;
margin: 5px;
border-bottom: 1px solid #dcdfe5;
}
.tagText {
text-align: left;
color: black;
font-size: 13px;
}
.scrollCont {
font: normal 40px/50px monospace;
float: left;
overflow: hidden;
position: relative;
height: 18px;
top: 0px;
}
.scrollCont .scrollOptions {
font-size: 13px;
display: inline-block;
color: black;
position: relative;
top: 0;
left: 0;
/*animation*/
animation: scroll 10s;
/*animation-iteration-count*/
animation-iteration-count: infinite;
/*animation-delay*/
animation-delay: 1.5s;
}
#keyframes scroll {
16% {
top: -15px;
}
32% {
top: -66px;
}
48% {
top: -116px;
}
64% {
top: -166px;
}
80% {
top: -216px;
}
}
I want this progress bar to animate only from left to right, starting from text. After animation ends from right to left, it starts animating from right to left, from some point. Note, I need to use the flexbox and width for text.
.table-bars .bar-box .text {
height: 100%;
margin: 0 30px 0 200px;
width: 200px;
text-align:right;
}
.bar-box {
margin-bottom:20px;
}
.table-bars div .progress {
background-color: #0071b9;
border-radius: 20px;
border-right: 13px solid rgb(0, 173, 239);
-webkit-animation: progressBar 2s ease-in-out;
-webkit-animation-fill-mode:both;
-moz-animation: progressBar 2s ease-in-out;
-moz-animation-fill-mode:both;
height: 20px;
}
#-webkit-keyframes progressBar {
0% { width: 0; }
100% { width: 100%; }
}
#-moz-keyframes progressBar {
0% { width: 0; }
100% { width: 100%; }
}
.bar-box {
display: flex;
}
<div class="table-bars">
<div class="bar-box">
<div class="text"><span>TEXT</span></div>
<div class="progress"></div>
</div>
<div class="bar-box">
<div class="text"><span>Another TEXT</span></div>
<div class="progress"></div>
</div>
</div>
You need to either add flex-shrink:0 to avoid the shriking of the text because you are setting width:100%
.table-bars .bar-box .text {
height: 100%;
margin: 0 30px 0 200px;
width: 200px;
text-align: right;
flex-shrink:0;
}
.bar-box {
margin-bottom: 20px;
}
.table-bars div .progress {
background-color: #0071b9;
border-radius: 20px;
border-right: 13px solid rgb(0, 173, 239);
animation: progressBar 2s ease-in-out;
animation-fill-mode: both;
height: 20px;
}
#keyframes progressBar {
0% {
width: 0;
}
100% {
width: 100%;
}
}
.bar-box {
display: flex;
}
<div class="table-bars">
<div class="bar-box">
<div class="text"><span>TEXT</span></div>
<div class="progress"></div>
</div>
<div class="bar-box">
<div class="text"><span>Another TEXT</span></div>
<div class="progress"></div>
</div>
</div>
Or animate the flex-grow instead of width:
.table-bars .bar-box .text {
height: 100%;
margin: 0 30px 0 200px;
width: 200px;
text-align: right;
flex-shrink:0;
}
.bar-box {
margin-bottom: 20px;
}
.table-bars div .progress {
background-color: #0071b9;
border-radius: 20px;
border-right: 13px solid rgb(0, 173, 239);
animation: progressBar 2s ease-in-out;
animation-fill-mode: both;
height: 20px;
}
#keyframes progressBar {
0% {
flex-grow: 0;
}
100% {
flex-grow: 1;
}
}
.bar-box {
display: flex;
}
<div class="table-bars">
<div class="bar-box">
<div class="text"><span>TEXT</span></div>
<div class="progress"></div>
</div>
<div class="bar-box">
<div class="text"><span>Another TEXT</span></div>
<div class="progress"></div>
</div>
</div>
Related: Why is a flex item limited to parent size?
I'm trying to get my buttons to have the same width but for some reason, it's not working. What needs to be done in order to make sure that all buttons comply with these desired results?:
All buttons must have the same width
All buttons must NOT use the whole width of the page
have the same width
/*File download button*/
.buttonFileDownload_container {
text-align: center;
margin-bottom: 20px;
}
.buttonFileDownload {
display: inline-block;
position: relative;
padding: 10px 60px;
background-color: transparent;
border: 3px solid black;
color: black;
text-decoration: none!important;
font-size: 1.5em;
line-height: 1.2;
text-align: center;
text-indent: 15px;
}
.buttonFileDownload:before,
.buttonFileDownload:after {
content: ' ';
display: block;
position: absolute;
left: 10px;
top: 52%;
}
/* Download box shape */
.buttonFileDownload:before {
width: 20px;
height: 4px;
border-style: solid;
border-width: 0 4px 4px;
}
/* Download arrow shape */
.buttonFileDownload:after {
width: 0;
height: 0;
margin-left: 6px;
margin-top: -140px;
border-style: solid;
border-width: 8px 8px 0 8px;
border-color: transparent;
border-top-color: inherit;
animation: downloadArrow 2s linear infinite;
animation-play-state: paused;
}
.buttonFileDownload:hover:before {
border-color: black;
}
.buttonFileDownload:hover:after {
border-top-color: black;
animation-play-state: running;
}
/* keyframes for the download icon anim */
#keyframes downloadArrow {
/* 0% and 0.001% keyframes used as a hackish way of having the button frozen on a nice looking frame by default */
0% {
margin-top: -14px;
opacity: 1;
}
0.001% {
margin-top: -30px;
opacity: 0;
}
50% {
opacity: 1;
}
100% {
margin-top: 0;
opacity: 0;
}
}
<p>Hello World</p>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Numbers</u><br/>
Numbers description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Colours</u><br/>
Colours description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Onomatopoeia</u><br/>
Onomatopoeia description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Alphabet</u><br/>
Alphabet description</a>
</div>
All buttons must have the same width
All buttons must NOT use the whole width of the page
The main trick is to add a wrapper in the markup, a new CSS rule and set the buttonFileDownload to display: block.
.buttonFileDownload_wrapper { /* added rule */
display: inline-block;
}
.buttonFileDownload {
display: block; /* changed to block */
...
}
If you also want them centered, set the buttonFileDownload_wrapper's parent to text-align: center (in this case the body)
body {
text-align: center; /* added property */
}
Stack snippet
/*File download button*/
body {
text-align: center; /* added property */
}
.buttonFileDownload_wrapper { /* added rule */
display: inline-block;
}
.buttonFileDownload_container {
text-align: center;
margin-bottom: 20px;
}
.buttonFileDownload {
display: block; /* changed to block */
position: relative;
padding: 10px 60px;
background-color: transparent;
border: 3px solid black;
color: black;
text-decoration: none!important;
font-size: 1.5em;
line-height: 1.2;
text-align: center;
text-indent: 15px;
}
.buttonFileDownload:before,
.buttonFileDownload:after {
content: ' ';
display: block;
position: absolute;
left: 10px;
top: 52%;
}
/* Download box shape */
.buttonFileDownload:before {
width: 20px;
height: 4px;
border-style: solid;
border-width: 0 4px 4px;
}
/* Download arrow shape */
.buttonFileDownload:after {
width: 0;
height: 0;
margin-left: 6px;
margin-top: -140px;
border-style: solid;
border-width: 8px 8px 0 8px;
border-color: transparent;
border-top-color: inherit;
animation: downloadArrow 2s linear infinite;
animation-play-state: paused;
}
.buttonFileDownload:hover:before {
border-color: black;
}
.buttonFileDownload:hover:after {
border-top-color: black;
animation-play-state: running;
}
/* keyframes for the download icon anim */
#keyframes downloadArrow {
/* 0% and 0.001% keyframes used as a hackish way of having the button frozen on a nice looking frame by default */
0% {
margin-top: -14px;
opacity: 1;
}
0.001% {
margin-top: -30px;
opacity: 0;
}
50% {
opacity: 1;
}
100% {
margin-top: 0;
opacity: 0;
}
}
<div class="buttonFileDownload_wrapper">
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Numbers</u><br/>
Numbers description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Colours</u><br/>
Colours description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Onomatopoeia</u><br/>
Onomatopoeia description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Alphabet</u><br/>
Alphabet description</a>
</div>
</div>
"width" is based on content if you don't set the width of the element. So either make all the content the same or set a width on the element.
You need to set the width of the element, otherwise its based on it's content length.
For instance:
/*File download button*/
.buttonFileDownload_container {
text-align: center;
margin-bottom: 20px;
}
.buttonFileDownload {
display: inline-block;
position: relative;
padding: 10px 60px;
background-color: transparent;
border: 3px solid black;
color: black;
text-decoration: none!important;
font-size: 1.5em;
line-height: 1.2;
text-align: center;
text-indent: 15px;
min-width:250px;
}
.buttonFileDownload:before,
.buttonFileDownload:after {
content: ' ';
display: block;
position: absolute;
left: 10px;
top: 52%;
}
/* Download box shape */
.buttonFileDownload:before {
width: 20px;
height: 4px;
border-style: solid;
border-width: 0 4px 4px;
}
/* Download arrow shape */
.buttonFileDownload:after {
width: 0;
height: 0;
margin-left: 6px;
margin-top: -140px;
border-style: solid;
border-width: 8px 8px 0 8px;
border-color: transparent;
border-top-color: inherit;
animation: downloadArrow 2s linear infinite;
animation-play-state: paused;
}
.buttonFileDownload:hover:before {
border-color: black;
}
.buttonFileDownload:hover:after {
border-top-color: black;
animation-play-state: running;
}
/* keyframes for the download icon anim */
#keyframes downloadArrow {
/* 0% and 0.001% keyframes used as a hackish way of having the button frozen on a nice looking frame by default */
0% {
margin-top: -14px;
opacity: 1;
}
0.001% {
margin-top: -30px;
opacity: 0;
}
50% {
opacity: 1;
}
100% {
margin-top: 0;
opacity: 0;
}
}
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Numbers</u><br/>
Numbers description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Colours</u><br/>
Colours description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Onomatopoeia</u><br/>
Onomatopoeia description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Alphabet</u><br/>
Alphabet description</a>
</div>
You should add a width to your container and width 100% on your buttons:
/*File download button*/
.buttonFileDownload_container {
text-align: center;
margin-bottom: 20px;
width: 400px;
}
.buttonFileDownload {
width: 100%;
display: inline-block;
position: relative;
padding: 10px 60px;
background-color: transparent;
border: 3px solid black;
color: black;
text-decoration: none!important;
font-size: 1.5em;
line-height: 1.2;
text-align: center;
text-indent: 15px;
}
.buttonFileDownload:before,
.buttonFileDownload:after {
content: ' ';
display: block;
position: absolute;
left: 10px;
top: 52%;
}
/* Download box shape */
.buttonFileDownload:before {
width: 20px;
height: 4px;
border-style: solid;
border-width: 0 4px 4px;
}
/* Download arrow shape */
.buttonFileDownload:after {
width: 0;
height: 0;
margin-left: 6px;
margin-top: -140px;
border-style: solid;
border-width: 8px 8px 0 8px;
border-color: transparent;
border-top-color: inherit;
animation: downloadArrow 2s linear infinite;
animation-play-state: paused;
}
.buttonFileDownload:hover:before {
border-color: black;
}
.buttonFileDownload:hover:after {
border-top-color: black;
animation-play-state: running;
}
/* keyframes for the download icon anim */
#keyframes downloadArrow {
/* 0% and 0.001% keyframes used as a hackish way of having the button frozen on a nice looking frame by default */
0% {
margin-top: -14px;
opacity: 1;
}
0.001% {
margin-top: -30px;
opacity: 0;
}
50% {
opacity: 1;
}
100% {
margin-top: 0;
opacity: 0;
}
}
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Numbers</u><br/>
Numbers description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Colours</u><br/>
Colours description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Onomatopoeia</u><br/>
Onomatopoeia description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Alphabet</u><br/>
Alphabet description</a>
</div>
Why don't you only use 1 container with a specific with, lets say 200px and make the buttons width 100%?
.buttonFileDownload_container {
width: 200px;
text-align: center;
margin-bottom: 20px;
}
.buttonFileDownload {
width: 100%;
display: inline-block;
position: relative;
padding: 10px 60px;
background-color: transparent;
border: 3px solid black;
color: black;
text-decoration: none!important;
font-size: 1.5em;
line-height: 1.2;
text-align: center;
text-indent: 15px;
}
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Numbers</u><br/>
Numbers description</a>
<a href="#" class="buttonFileDownload"><u>Colours</u><br/>
Colours description</a>
<a href="#" class="buttonFileDownload"><u>Onomatopoeia</u><br/>
Onomatopoeia description</a>
<a href="#" class="buttonFileDownload"><u>Alphabet</u><br/>
Alphabet description</a>
</div>
/*File download button*/
.buttonFileDownload_container {
text-align: center;
margin-bottom: 20px;
}
.buttonFileDownload {
display: inline-block;
position: relative;
padding: 10px 60px;
background-color: transparent;
border: 3px solid black;
color: black;
text-decoration: none!important;
font-size: 1.5em;
line-height: 1.2;
text-align: center;
text-indent: 15px;
width:260px;
}
.buttonFileDownload:before,
.buttonFileDownload:after {
content: ' ';
display: block;
position: absolute;
left: 10px;
top: 52%;
}
/* Download box shape */
.buttonFileDownload:before {
width: 20px;
height: 4px;
border-style: solid;
border-width: 0 4px 4px;
}
/* Download arrow shape */
.buttonFileDownload:after {
width: 0;
height: 0;
margin-left: 6px;
margin-top: -140px;
border-style: solid;
border-width: 8px 8px 0 8px;
border-color: transparent;
border-top-color: inherit;
animation: downloadArrow 2s linear infinite;
animation-play-state: paused;
}
.buttonFileDownload:hover:before {
border-color: black;
}
.buttonFileDownload:hover:after {
border-top-color: black;
animation-play-state: running;
}
/* keyframes for the download icon anim */
#keyframes downloadArrow {
/* 0% and 0.001% keyframes used as a hackish way of having the button frozen on a nice looking frame by default */
0% {
margin-top: -14px;
opacity: 1;
}
0.001% {
margin-top: -30px;
opacity: 0;
}
50% {
opacity: 1;
}
100% {
margin-top: 0;
opacity: 0;
}
}
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Numbers</u><br/>
Numbers description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Colours</u><br/>
Colours description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Onomatopoeia</u><br/>
Onomatopoeia description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Alphabet</u><br/>
Alphabet description</a>
</div>
Make a container . Set its width to the width you want for each button to have. Make width of all div inside it to 100%
Make width of all a tag inside that div to 100%
Simple
/*File download button*/
#container {
width: 200px;
}
#container > div {
width:100%;
}
#container > div > a {
width:100%;
}
.buttonFileDownload_container {
text-align: center;
margin-bottom: 20px;
}
.buttonFileDownload {
display: inline-block;
position: relative;
padding: 10px 60px;
background-color: transparent;
border: 3px solid black;
color: black;
text-decoration: none!important;
font-size: 1.5em;
line-height: 1.2;
text-align: center;
text-indent: 15px;
}
.buttonFileDownload:before,
.buttonFileDownload:after {
content: ' ';
display: block;
position: absolute;
left: 10px;
top: 52%;
}
/* Download box shape */
.buttonFileDownload:before {
width: 20px;
height: 4px;
border-style: solid;
border-width: 0 4px 4px;
}
/* Download arrow shape */
.buttonFileDownload:after {
width: 0;
height: 0;
margin-left: 6px;
margin-top: -140px;
border-style: solid;
border-width: 8px 8px 0 8px;
border-color: transparent;
border-top-color: inherit;
animation: downloadArrow 2s linear infinite;
animation-play-state: paused;
}
.buttonFileDownload:hover:before {
border-color: black;
}
.buttonFileDownload:hover:after {
border-top-color: black;
animation-play-state: running;
}
/* keyframes for the download icon anim */
#keyframes downloadArrow {
/* 0% and 0.001% keyframes used as a hackish way of having the button frozen on a nice looking frame by default */
0% {
margin-top: -14px;
opacity: 1;
}
0.001% {
margin-top: -30px;
opacity: 0;
}
50% {
opacity: 1;
}
100% {
margin-top: 0;
opacity: 0;
}
}
<div id="container">
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Numbers</u><br/>
Numbers description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Colours</u><br/>
Colours description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Onomatopoeia</u><br/>
Onomatopoeia description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Alphabet</u><br/>
Alphabet description</a>
</div>
<div>