По какой-то причине я не могу получить текст между тегами привязки на кнопке для отображения.
Ниже приведены мои HTML и CSS коды. CSS является прямой копией здесь с некоторыми изменениями.
Я не могу понять, где я ошибся.
body,
html {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
font: bold 14px/1.4 'Open Sans', arial, sans-serif;
background: #EBF0DC;
}
ul {
margin: 150px auto 0;
padding: 0;
list-style: none;
display: table;
width: 600px;
text-align: center;
}
li {
display: table-cell;
position: relative;
padding: 15px 0;
}
a {
color: rgb(7, 5, 5) !important;
text-transform: uppercase;
text-decoration: none;
letter-spacing: 0.15em;
display: inline-block;
padding: 15px 20px;
position: relative;
}
ul a:after {
background: none repeat scroll 0 0 transparent;
bottom: 0;
content: "";
display: block;
height: 2px;
left: 50%;
position: absolute;
background: rgb(233, 108, 25);
transition: width 0.3s ease 0s, left 0.3s ease 0s;
width: 0;
}
a:hover:after {
width: 100%;
left: 0;
}
@media screen and (max-height: 300px) {
ul {
margin-top: 40px;
}
}
/* Navigation ends here */
h1 {
color: #ff4411;
font-size: 48px;
font-family: 'Signika', sans-serif;
padding-bottom: 10px;
text-align: center;
}
/* Button */
.container {
padding-top: 1em;
margin-top: 1em;
border-top: solid 1px #CCC;
width: 200px;
margin: 20px auto;
}
a.button {
display: block;
position: relative;
float: left;
width: 120px;
padding: 0;
margin: 30px;
font-weight: 600;
text-align: center;
line-height: 50px;
border-radius: 5px;
transition: all 0.2s;
}
/* FLOAT */
.btnFloat:before {
content: 'Float';
display: block;
position: absolute;
top: 0;
left: 0;
width: 120px;
height: 50px;
border-radius: 5px;
transition: all 0.2s;
}
.btnBlueGreen.btnFloat:before {
background: #00AE68;
}
.btnLightBlue.btnFloat:before {
background: #5DC8CD;
}
.btnOrange.btnFloat:before {
background: #FFAA40;
}
.btnFloat:before {
box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0.4);
}
.btnFloat:hover:before {
margin-top: -2px;
margin-left: 0px;
transform: scale(1.1, 1.1);
-ms-transform: scale(1.1, 1.1);
-webkit-transform: scale(1.1, 1.1);
box-shadow: 0px 5px 5px -2px rgba(0, 0, 0, 0.25);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" content="You can get coached on anything. Always free.">
<title>Careless2Naysayers | Life Coaching by Pradeep Kumar P</title>
<link rel="stylesheet" href="./css/style.css">
</head>
<body>
<header>
<nav>
<ul>
<li><a href="#">About</a></li>
<li><a href="#">Portfolio</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</header>
<div>
<h1>CareLess2Naysayers</h1>
</div>
<div class="container">
<a href="#" class="button btnFloat btnBlueGreen">Students</a>
<a href="#" class="button btnFloat btnLightBlue">Teachers</a>
<a href="#" class="button btnFloat btnOrange">Parents</a>
</div>
</body>
</html>
Вот как это отображается. Как вы можете видеть, слово «Float» появляется, а не то, которое я намеревался. 