I'm trying to add a button to my html text editor on a category page in Lightspeed Retail
. I can make the code work in js fiddle
just fine, but when I put the code into the text editor, it doesn't work. When I save it, it ereases everything and gives me a html button that leads nowhere. I'm incredibly new to trying to figure this stuff out, so it's a bit daunting.
I tried to create a seperate css
to reference, but it is above my understanding. I am trying to stick with inline since it seems to work in jsfiddle. If I must do external style sheet
I may require some extra guidance.
(I had to erase from the code to get it to appear properly on here)
.button {
display: inline-block;
border-radius: 4px;
background-color: #c7057d;
border: none;
color: #FFFFFF;
text-align: center;
font-size: 28px;
padding: 20px;
width: 200px;
transition: all 0.5s;
cursor: pointer;
margin: 5px;
}
.button span {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}
.button span:after {
content: '\00bb';
position: absolute;
opacity: 0;
top: 0;
right: -20px;
transition: 0.5s;
}
.button:hover span {
padding-right: 25px;
}
.button:hover span:after {
opacity: 1;
right: 0;
}
</style>
Pink button that when moused over has a sliding effect, that leads to booking page for company.
You can create separate css
file as follows;
.button {
display: inline-block;
border-radius: 4px;
background-color: #c7057d;
border: none;
color: #FFFFFF;
text-align: center;
font-size: 28px;
padding: 20px;
width: 200px;
transition: all 0.5s;
cursor: pointer;
margin: 5px;
}
.button span {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}
.button span:after {
content: '\00bb';
position: absolute;
opacity: 0;
top: 0;
right: -20px;
transition: 0.5s;
}
.button:hover span {
padding-right: 25px;
}
.button:hover span:after {
opacity: 1;
right: 0;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="fittingbutton.css">
</head>
<body>
<a href="https://allegrodanceboutique.simplybook.me/v2/"><button class="button" style="vertical-align:middle"><span>Book Now </span></button></a>
</body>
</html>
Note: you should past the css
code in fittingbutton.css
file and paste the html code in the separate .html
file.
Update: In case the <span>
is being erased, you can use <div>
instead as follows;
.button {
display: inline-block;
border-radius: 4px;
background-color: #c7057d;
border: none;
color: #FFFFFF;
text-align: center;
font-size: 28px;
padding: 20px;
width: 200px;
transition: all 0.5s;
cursor: pointer;
margin: 5px;
}
.button div {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}
.button div:after {
content: '\00bb';
position: absolute;
opacity: 0;
top: 0;
right: -20px;
transition: 0.5s;
}
.button:hover div {
padding-right: 25px;
}
.button:hover div:after {
opacity: 1;
right: 0;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="fittingbutton.css">
</head>
<body>
<a href="https://allegrodanceboutique.simplybook.me/v2/"><button class="button" style="vertical-align:middle"><div>Book Now </div></button></a>
</body>
</html>