I want to set the h2 text on the animation. But i cant able to do that -_-.
here is the live link http://leander.web.dnodes.net/
source code: https://github.com/LeleEdits/website-new
change css to
.h2-parent {
position: absolute;
top: 0;
left: 0;
height: 100%;
max-width: 600px;
width: 600px;
padding-left: 10px;
padding-right: 10px;
z-index: 10;
}
h2
{
position: relative;
width: 100%;
top: 40%;
transform: translateY(-50%);
font-size: 5vw;
color: rgba(255,255,255,0.5);
text-transform: uppercase;
}
.abs-h2
{
position: absolute;
top: 0;
left: 0;
width: 0;
height: 100%;
color: #5865f2;
-webkit-text-stroke: 0vw rgb(51, 51, 51);
border-right: 2px solid #5865f2;
overflow: hidden;
animation: animate-t 6s linear infinite;
}
.abs-h2 h2
{
position: relative;
width: 600px;
top: 40%;
left:10px;
transform: translateY(-50%);
font-size: 5vw;
color: #5865f2;
text-transform: uppercase;
}
and change html to
<div class="h2-parent">
<h2 data-text="Improve your Server...">Improve your Server...</h2>
<div class="abs-h2">
<h2 data-text="Improve your Server...">Improve your Server...</h2>
</div>
</div>
demo in js<>fiddle
Related
I'm trying to make this in HTML/CSS
Image design in Figma of what I am trying to make
And currently It looks like this
Current way it looks
I am not sure why it is formatting like that and to clarify I haven't made the other 2 cards yet because I was trying to get the first 2 right.
Here is the HTMl code for it (don't mind the class names please)
<div class="v10_8">
<div class="v10_9"></div>
<div class="v10_15">
<div class="v10_14"><span class="v10_10">CAREY</span><span class="v10_11">1</span></div>
<span class="v10_12">On 56 Points</span>
</div>
</div>
<div class="v10_16">
<div class="v10_17"></div>
<div class="v10_18">
<div class="v10_19"><span class="v10_20">STANWAY</span><span class="v10_21">2</span></div>
<div class="v10_40"><span class="v10_22">On 40 Points</span><span class="v10_39">16 points behind Carey</span></div>
</div>
</div>
</div>
And here is the CSS code for it:
width: 262px;
height: 617px;
background: url("../images/v10_23.png");
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
margin: 65px;
opacity: 1;
position: relative;
top: 0px;
left: 0px;
overflow: hidden;
}
.v10_8 {
width: 262px;
height: 276px;
background: rgba(255,255,255,1);
opacity: 1;
position: relative;
top: 0px;
left: 0px;
border-top-left-radius: 44px;
border-top-right-radius: 44px;
border-bottom-left-radius: 44px;
border-bottom-right-radius: 44px;
box-shadow: -10.746728897094727px 9.851167678833008px 60px rgba(0, 0, 0, 0.09000000357627869);
overflow: hidden;
}
.v10_9 {
width: 267px;
height: 96px;
background: rgba(248,228,125,1);
opacity: 1;
position: absolute;
top: 180px;
left: 0px;
overflow: hidden;
}
.v10_15 {
width: 135px;
height: 210px;
background: url("../images/v10_15.png");
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
margin: 44px;
opacity: 1;
position: absolute;
top: 29px;
left: 65px;
overflow: hidden;
}
.v10_14 {
width: 94px;
height: 138px;
background: url("../images/v10_14.png");
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
margin: 17px;
opacity: 1;
position: absolute;
top: 0px;
left: 21px;
overflow: hidden;
}
.v10_10 {
width: 94px;
color: rgba(21,21,21,1);
position: relative;
top: 0px;
left: 0px;
font-family: Folito;
font-weight: Medium;
font-size: 29px;
opacity: 1;
text-align: left;
}
.v10_11 {
width: 30px;
color: rgba(21,21,21,1);
position: absolute;
top: 52px;
left: 32px;
font-family: Folito;
font-weight: Bold;
font-size: 71px;
opacity: 1;
text-align: left;
}
.v10_12 {
width: 135px;
color: rgba(21,21,21,1);
position: absolute;
top: 183px;
left: 0px;
font-family: Folito;
font-weight: Medium;
font-size: 22px;
opacity: 1;
text-align: left;
}
.v10_16 {
width: 262px;
height: 276px;
background: rgba(255,255,255,1);
opacity: 1;
position: absolute;
top: 341px;
left: 1px;
border-top-left-radius: 44px;
border-top-right-radius: 44px;
border-bottom-left-radius: 44px;
border-bottom-right-radius: 44px;
box-shadow: -10.746728897094727px 9.849809646606445px 60px rgba(0, 0, 0, 0.09000000357627869);
overflow: hidden;
}
.v10_17 {
width: 267px;
height: 96px;
background: rgba(119,221,119,1);
opacity: 1;
position: absolute;
top: 180px;
left: 0px;
overflow: hidden;
}
.v10_18 {
width: 167px;
height: 241px;
background: url("../images/v10_18.png");
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
margin: 44px;
opacity: 1;
position: absolute;
top: 16px;
left: 50px;
overflow: hidden;
}
.v10_19 {
width: 135px;
height: 138px;
background: url("../images/v10_19.png");
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
margin: 17px;
opacity: 1;
position: absolute;
top: 0px;
left: 16px;
overflow: hidden;
}
.v10_20 {
width: 135px;
color: rgba(21,21,21,1);
position: absolute;
top: 0px;
left: 0px;
font-family: Folito;
font-weight: Medium;
font-size: 29px;
opacity: 1;
text-align: left;
}
.v10_21 {
width: 42px;
color: rgba(21,21,21,1);
position: absolute;
top: 52px;
left: 46px;
font-family: Folito;
font-weight: Bold;
font-size: 71px;
opacity: 1;
text-align: left;
}
.v10_40 {
width: 167px;
height: 57px;
background: url("../images/v10_40.png");
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
margin: 11px;
opacity: 1;
position: absolute;
top: 183px;
left: 0px;
overflow: hidden;
}
.v10_22 {
width: 137px;
color: rgba(21,21,21,1);
position: absolute;
top: 0px;
left: 15px;
font-family: Folito;
font-weight: Medium;
font-size: 22px;
opacity: 1;
text-align: left;
}
.v10_39 {
width: 167px;
color: rgba(21,21,21,1);
position: absolute;
top: 38px;
left: 0px;
font-family: Folito;
font-weight: Medium;
font-size: 16px;
opacity: 1;
text-align: left;
}
I understand the design may look slightly hard to code but I will try.
I would appreciate it if someone can help me thanks.
Two problems here...
FIRST ONE: The first code of the css you provided is incomplete.
FIRST ONE:
As I looked through your code, I realised you interchanged the positioning of the elements. Use the absolute position on the parent element and relative on the contents of the parent element. If you are a bit confused about the second issue, kindly correct the first mistake and prompt me. I'll help you out.
For this design, you must have a box that contains three columns and have two contents in the left column and the contents in the other columns are in the center.
You can achieve this in minimum div this is example for your single card you can make further changes in it.
.box1_1 {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 262px;
height: 276px;
background: gray;
opacity: 1;
border-radius: 44px;
box-shadow: -10.746728897094727px 9.851167678833008px 60px rgba(0, 0, 0, 0.09000000357627869);
overflow: hidden;
position: relative;
}
.box1_3 {
padding-top: 20%;
font-size: 25px;
font-weight: bold;
text-align: center;
background: red;
height: 100%;
width: 100%;
position: absolute;
top: 10;
}
.box1_2{
font-size: 25px;
font-weight: bold;
text-align: center;
background: yellow;
height: 35%;
width: 100%;
position: absolute;
bottom: 0%;
box-shadow: -10.746728897094727px 9.851167678833008px 60px rgba(0, 0, 0, 0.09000000357627869); /* Add the same box-shadow as the parent container */
}
<div class="box1_1">
<div class="box1_3">
<p>CAREY</p>
<p>1</p>
</div>
<div class="box1_2">
<p>On 56 Points</p>
</div>
</div>
I have an input with a pseudo element that I'm trying to animate on hover.. I wanted the white line on the input to infinitely scroll to the right out of view and come back in on the left etc.. Is this possible?
.buttonWrap {
position: relative;
}
.buttonWrap:before {
content: '';
width: 20px;
border-bottom: solid 2px #fff;
position: absolute;
top: 50%;
right: .5rem;
transform: translateY(-50%);
}
.buttonWrap:hover::before {
animation: J 1s ease 0s infinite normal none;
}
.uiBtn.redBtn {
background: #1a1a1a;
text-transform: uppercase;
text-align: left;
color: #fff;
min-width: 16.25rem;
font-size: .6875rem;
cursor: pointer;
letter-spacing: 1px;
line-height: 1rem;
width: auto;
margin-top: 2rem;
font-weight: 600;
padding:10px;
}
<span class="buttonWrap">
<input type="submit" class="uiBtn redBtn" value="Submit">
</span>
An example using transform property (I've slow down the duration just to check the fluidity)
.buttonWrap {
position: relative;
}
.buttonWrap:before {
content: '';
width: 20px;
border-bottom: solid 2px #fff;
position: absolute;
top: calc(50% - 1px);
right: .5rem;
}
.buttonWrap:hover::before {
animation: J 5s linear 0s infinite;
}
.uiBtn.redBtn {
background: #1a1a1a;
text-transform: uppercase;
text-align: left;
color: #fff;
min-width: 16.25rem;
font-size: .6875rem;
cursor: pointer;
letter-spacing: 1px;
line-height: 1rem;
width: auto;
margin-top: 2rem;
font-weight: 600;
padding:10px;
}
#keyframes J {
0% { transform: translateX(0); right: .5rem; }
10% { transform: translateX(calc(100% + .5rem)); right: .5rem; }
10.01% { transform: translateX(-100%); right: 100%; }
93% { transform: translateX(-100%); right: .5rem; }
}
<span class="buttonWrap">
<input type="submit" class="uiBtn redBtn" value="Submit">
</span>
FYI; here's what ended up working for me! .. animation happens when you hover over the button..
.underline::after {
content: "";
height: 2px;
display: inline-block;
position: absolute;
left: 0;
width: 30px;
top:50%;
background: #fff;
transition: all;
}
.underline {
position: absolute;
right: .5rem;
top: 50%;
width: 30px;
}
.underlined-animated:hover .underline::after {
animation: underline-animated 1s infinite;
width: auto;
animation-delay: -.5s;
}
.underlined-animated {
position: relative;
}
#keyframes underline-animated {
0% {
right: 100%;
}
50% {
right: 0;
left: 0;
}
100% {
right: 0;
left: 100%;
}
}
.uiBtn.redBtn {
background: #1a1a1a;
text-transform: uppercase;
text-align: left;
color: #fff;
min-width: 16.25rem;
font-size: .6875rem;
cursor: pointer;
letter-spacing: 1px;
line-height: 1rem;
width: auto;
margin-top: 2rem;
font-weight: 600;
padding:10px;
}
<span class="underlined-animated">
<span class="underline"></span>
<input type="submit" class="uiBtn redBtn" value="Submit">
</span>
I have three images with text over them. I want to have text for first and third images to be floated to the left, and the second one to be floated to the right. I got the first and the third images to work, but I am struggling with the second image. I have been looking around but couldn't find any help. and also, I am new to html & css, so I would appreciate if someone could help.
<style>
.image {
position: relative;
width: 100%;
}
h2{
position: absolute;
top: 200px;
left: 0;
width: 100%;
}
.h2:nth-of-type(2){
position: absolute;
bottom: 200px;
left: 200px;
width: 100%;
}
h2 span {
color: white;
font: bold 24px/45px Helvetica, Sans-Serif;
letter-spacing: -1px;
background: rgb(0, 0, 0); /* fallback color */
background: rgba(0, 0, 0, 0.7);
padding: 10px;
}
.overlay-image {
position: relative;
}
.overlay-image .image {
display: block;
}
.overlay-image .text {
color: #81282A;
font-size: 30px;
line-height: 1.5em;
text-shadow: 2px 2px 2px #000;
text-align: center;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100%;
}
.overlay-image .hover {
position: absolute;
top: 0;
height: 100%;
width: 100%;
opacity: 0;
transition: .5s ease;
}
.overlay-image:hover .hover {
opacity: 1;
}
.overlay-image .normal {
transition: .5s ease;
}
.overlay-image:hover .normal {
opacity: 0;
}
.overlay-image .hover {
background-color: rgba(0,0,0,0.8);
}
.pp{
color: white;
}
#store-container {
position: relative;
width: 100%;
}
#store-image {
opacity: 0.3;
display: block;
width: 100%;
height: auto;
transition: .5s ease;
backface-visibility: hidden;
}
#store-middle {
transition: .5s ease;
opacity: 1;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
text-align: center;
}
#store-text {
background-color: #4CAF50;
color: white;
font-size: 16px;
padding: 16px 32px;
}
.TEXT{
position: relative;
width: 831px;
height: 134px;
left: 180px;
top: 56px;
padding-top: 10px;
margin-bottom: 15%;
font-style: normal;
font-weight: 300;
font-size: 35px;
line-height: 47px;
text-align: center;
color: black;
}
</style>
<div class="image"><img src="//cdn.shopify.com/s/files/1/0254/5067/6317/files/smart_large.jpg?v=1562170226" width="1179" height="480" alt="Alt text" />
<h2><span>Custom Smart Kitchens<br />We build Custom smart kitchens</span></h2>
</div>
<div class="pp">here</div>
<div class="image"><img src="//cdn.shopify.com/s/files/1/0254/5067/6317/files/laptopRepair_large.jpg?v=1561171348" width="1179" height="480" alt="Alt text" />
<h2><span>We have our own designer</span></h2>
</div>
<div class="pp">here</div>
<div class="image"><img src="//cdn.shopify.com/s/files/1/0254/5067/6317/files/electric_car_large.jpeg?v=1562179941" width="1179" height="480" alt="Alt text" />
<h2><span>We come and build it for you</span></h2>
</div>
<div class="pp">here</div>
<div class="TEXT">
<p>For more designs, visit us at the store.<br />
Call us to schedule a free quote</p>
</div>
The easiest way would be to mark the h2 you want to align right diretly in the markup
So change the markup (html) of the second <h2> and add a class <h2 class="right"> and apply the following additional css rules
div.image {
display: inline-block;
width: auto;
}
h2.right {
right: 0px;
left: auto;
width: auto;
}
I just fooled around with HTML/CSS to build me a page with a youtube-video with a button on top of it.
* { box-sizing: border-box; }
.video-background {
background: #000;
position: fixed;
top: 0; right: 0; bottom: 0; left: 0;
z-index: -99;
}
.video-background iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
html, body {
height: 100%;
margin: 0;
}
body {
display: flex;
justify-content: center;
align-items: center;
}
.btn-wrapper {
width: 290px;
height: 110px;
position: relative;
margin: 40px auto 0;
}
.btn-wrapper:hover .btn-inner {
top: -4px;
transform: scale(1, 1);
cursor: pointer;
}
.btn-wrapper__container {
border-bottom: 2px solid #15b5e2;
position: absolute;
width: 100%;
height: 80px;
}
.btn-wrapper__container:before, .btn-wrapper__container:after {
border-bottom: 2px solid #15b5e2;
width: 96%;
left: 2%;
bottom: -8px;
content: "";
position: absolute;
}
.btn-wrapper__container:after {
width: 92%;
left: 4%;
bottom: -14px;
}
.btn-wrapper__container .btn-inner {
width: 104.2%;
height: 100%;
position: absolute;
top: 20px;
left: -2.1%;
border: 2px solid #15b5e2;
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;
font-family: 'Source Code Pro', monospace;
letter-spacing: 1px;
text-transform: uppercase;
font-size: 18px;
background: #10131c;
transform: scale(0.96, 0.96);
transition: all 0.3s;
z-index: 4;
}
.btn-wrapper__container .btn-inner__text {
text-decoration: none;
color: #15b5e2;
}
<div class="video-background">
<iframe src="https://www.youtube.com/embed/TMzouTzim0o?controls=1&showinfo=0&rel=0&autoplay=1&loop=1&playlist=W0LHTWG-UmQ" frameborder="0" allowfullscreen></iframe>
</div>
<div class="btn-wrapper">
<div class="btn-wrapper__container">
<div class="btn-inner">
<a class="btn-inner__text" href="#">Hover Me</a>
</div>
</div>
</div>
While without the button added, the video is shown in background, responsive and fullscreen, with control-elements enabled. If i add the hover-button, I am no longer able to control the video in background (360 video).
How can I enable the controls of the video and still have the button usable?
I am unfortunately not a coding expert, I've puzzled these pieces together of code I found in tutorials.
Remove css property z-index: -99 from class .video-background {...}, that will fix the issue.
* {
box-sizing: border-box;
}
.video-background {
background: #000;
position: fixed;
top: 0; right: 0; bottom: 0; left: 0;
/* z-index: -99; */ /* Remove this line */
}
.video-background iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
html,
body {
height: 100%;
margin: 0;
}
body {
display: flex;
justify-content: center;
align-items: center;
}
.btn-wrapper {
width: 290px;
height: 110px;
position: relative;
margin: 40px auto 0;
}
.btn-wrapper:hover .btn-inner {
top: -4px;
transform: scale(1, 1);
cursor: pointer;
}
.btn-wrapper__container {
border-bottom: 2px solid #15b5e2;
position: absolute;
width: 100%;
height: 80px;
}
.btn-wrapper__container:before,
.btn-wrapper__container:after {
border-bottom: 2px solid #15b5e2;
width: 96%;
left: 2%;
bottom: -8px;
content: "";
position: absolute;
}
.btn-wrapper__container:after {
width: 92%;
left: 4%;
bottom: -14px;
}
.btn-wrapper__container .btn-inner {
width: 104.2%;
height: 100%;
position: absolute;
top: 20px;
left: -2.1%;
border: 2px solid #15b5e2;
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;
font-family: 'Source Code Pro', monospace;
letter-spacing: 1px;
text-transform: uppercase;
font-size: 18px;
background: #10131c;
transform: scale(0.96, 0.96);
transition: all 0.3s;
z-index: 4;
}
.btn-wrapper__container .btn-inner__text {
text-decoration: none;
color: #15b5e2;
}
<div class="video-background">
<iframe src="https://www.youtube.com/embed/TMzouTzim0o?controls=1&showinfo=0&rel=0&autoplay=1&loop=1&playlist=W0LHTWG-UmQ"
frameborder="0" allowfullscreen></iframe>
</div>
<div class="btn-wrapper">
<div class="btn-wrapper__container">
<div class="btn-inner">
<a class="btn-inner__text" href="#">Hover Me</a>
</div>
</div>
</div>
Im having a very annoying problem in Shopify. My banners were working fine but all of a sudden this class called "row" came up and is pushing my banner off to the side on both mobile and desktop. I cant get my banners to work correctly, I went through my entire code to see if I had any errors and I do not, I tried to look for a ".row" that could be messing up everything but its only gridlock .row and that is something I dont feel I should be messing with, as im not sure what it does. Anyhow, thank you for your time!
Any help is greatly appreciated!
Problem
What I see as the issue
CSS
.bannerheadercontainer {
width: 100vw;
position: relative;
top: 0px;
left: calc(-50vw + 50%);
display: table;
padding: 0px;
margin: 0px;
}
.bannercontainer {
position: relative;
width: 100%;
}
.bannercontainer .btnstyle {
font-weight: bold;
position: absolute;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-webkit-appearance: none;
color: white;
font-size: 15px;
font-size: 4vw;
border: none;
border-radius: 0px! important;
height: 16%;
text-align: center;
line-height: 0vw;
cursor: pointer;
}
.bannercontainer .imgstyle {
position: absolute;
}
.bannercontainer .btnstyle span {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}
.bannercontainer .btnstyle span:after {
content: '\00bb';
position: absolute;
opacity: 0;
top: 0;
right: -20px;
transition: 0.5s;
}
.bannercontainer .btnstyle:hover span {
padding-right: 25px;
}
.bannercontainer .btnstyle:hover span:after {
opacity: 1;
right: 0;
}
.bannercontainer .btnstyleDesktop {
position: absolute;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-webkit-appearance: none;
color: white;
font-weight: bold;
font-size: 8px;
font-size: 1.5vw;
border: none;
border-radius: 0px! important;
height: 12%;
text-align: center;
line-height: 0vw;
cursor: pointer;
}
.bannercontainer .btnstyleDesktop span {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}
.bannercontainer .btnstyleDesktop span:after {
content: '\00bb';
position: absolute;
opacity: 0;
top: 0;
right: -20px;
transition: 0.5s;
}
.bannercontainer .btnstyleDesktop:hover span {
padding-right: 25px;
}
.bannercontainer .btnstyleDesktop:hover span:after {
opacity: 1;
right: 0;
}
.bannerimg {
filter: brightness(30%);
}
/*------ CSS MOBILE ONLY -----*/
#media only screen and (max-width: 599px) {
.bannerheadercontainer {
top: -10px;
}
.pagetitle {
font-size: 18px !important;
}
.overlaybanner {
top: -1px;
height: 98%;
}
.index-banner {
height: 300px !important;
background-size: 200% 100%;
background-repeat: no-repeat;
}
.styc-container {
width: 100%;
}
.index-gray-section-style {
background-color: #F9F9F9;
min-height: 390px;
width: 100%;
}
.index-gray-section-connected {
background-color: #F9F9F9;
min-height: 390px;
width: 100%;
}
}
HTML CODE
<!----START BANNER----->
<div id="content-desktop">
<div class="bannerheadercontainer">
<img style="width: 100%;" class="bannerimg" src="https://cdn.shopify.com/s/files/1/0025/8719/7497/files/ecobanner-compressor_2048x2048.png?v=1529095445">
<div class="overlayheaderbanner"></div>
<div class="pagetitle">ECO-FRIENDLY</div>
</div>
</div>
<div id="content-mobile">
<div class="bannerheadercontainer">
<img style="width: 100%;" class="bannerimg" src="https://cdn.shopify.com/s/files/1/0025/8719/7497/files/eco-compressor_large.png?v=1529427950">
<div style="top: 0px; height: 97%;" class="overlayheaderbanner"></div>
<div class="pagetitle">ECO-FRIENDLY</div>
</div>
</div>
<!----END BANNER----->
Change width '100vw to 100%' in your code, it will work
.bannerheadercontainer { width: 100%;}