I am having an issue with trying to figure out why the header on my mobile format isn't showing up.... can anyone see something I can't?? I have been trying for two weeks and I must be missing something. It appears that my larger version is working just fine, but I would appreciate any help I can get with this problem. Thank you.
/* very small mobile styles */
#media only screen and (max-width: 320px) {
html,
body {
margin: 0;
width: auto;
background-color: #682876;
}
.container-header {
display: none;
}
.container-header-mobile {
height: 260px;
width: 100%;
position: relative;
text-align: center;
color: #682876;
background-color: white;
padding: 0;
}
.container-header-mobile img {
max-height: 100px;
min-height: 50px;
width: auto;
}
.container-header-mobile a {
text-decoration: none;
padding: 0 5px;
}
main {
text-align: center;
color: white;
padding: 0;
margin: 0;
}
main img {
max-width: 300px;
height: auto;
padding: 0;
}
figure {
display: inline-block;
position: relative;
overflow: hidden;
margin: 0;
}
figcaption {
position: absolute;
font-family: "Montserrat", sans-serif;
font-size: 1.5em;
font-weight: bold;
background: rgba(104, 40, 118, 0.5);
color: #ffffff;
padding: 20px 20px;
opacity: 0;
bottom: 0;
left: -30%;
-webkit-transition: all 0.6s ease;
-moz-transition: all 0.6s ease;
-o-transition: all 0.6s ease;
}
figure:hover figcaption {
opacity: 1;
left: 0;
}
.cap-bot figcaption {
left: 0;
bottom: -30%;
}
.cap-bot:hover figcaption {
bottom: 0;
}
h1 {
font-family: "Caveat", cursive;
font-weight: lighter;
font-size: 0.75em;
}
p {
font-family: "Montserrat", sans-serif;
font-size: 0.5em;
}
main a {
color: white;
text-decoration: none;
}
.bot-social {
margin: auto;
}
.bot-social img {
border-radius: 18px;
}
footer {
color: white;
text-align: center;
margin: 0;
padding: 10px;
}
footer a {
color: white;
text-decoration: none;
}
}
/* mobile portrait styles */
#media only screen and (max-width: 768px) {
html,
body {
margin: 0;
width: auto;
background-color: #682876;
}
.container-header {
display: none;
}
.container-header-mobile {
height: 260px;
width: 100%;
text-align: center;
position:relative;
color: #682876;
background-color: white;
padding: 0;
}
.container-header-mobile img {
max-height: 100px;
min-height: 50px;
width: auto;
}
.container-header-mobile a {
text-decoration: none;
padding: 0 5px;
}
main {
text-align: center;
color: white;
padding: 15px 2%;
margin: 0;
}
main img {
max-width: 370px;
height: auto;
padding: 5px;
}
figure {
display: inline-block;
position: relative;
overflow: hidden;
margin: 0;
}
figcaption {
position: absolute;
font-family: "Montserrat", sans-serif;
font-size: 1.5em;
background: rgba(104, 40, 118, 0.5);
color: #ffffff;
padding: 20px 20px;
opacity: 0;
bottom: 0;
left: -30%;
-webkit-transition: all 0.6s ease;
-moz-transition: all 0.6s ease;
-o-transition: all 0.6s ease;
}
figure:hover figcaption {
opacity: 1;
left: 0;
}
.cap-bot figcaption {
left: 0;
bottom: -30%;
}
.cap-bot:hover figcaption {
bottom: 0;
}
h1 {
font-family: "Caveat", cursive;
font-weight: lighter;
font-size: 1em;
}
p {
font-family: "Montserrat", sans-serif;
font-size: 0.5em;
}
main a {
color: white;
text-decoration: none;
}
.bot-social {
margin: auto;
}
.bot-social img {
border-radius: 18px;
}
footer {
color: white;
text-align: center;
margin: 0;
padding: 10px;
}
footer a {
color: white;
text-decoration: none;
}
}
/* laptop styles */
#media only screen and (max-width: 1024px) {
html,
body {
margin: 0;
width: auto;
background-color: #682876;
}
.container-header-mobile {
display: none;
}
.container-header {
height: 260px;
width: 100%;
position: relative;
text-align: center;
color: #682876;
background-color: white;
}
.container-header a {
text-decoration: none;
padding: 0 5px;
}
.container-header img {
max-height: 230px;
width: auto;
padding-right: 12%;
}
.bot-social {
display: none;
}
.top-left {
position: absolute;
top: 8px;
left: 16px;
}
.top-right {
position: absolute;
top: 8px;
right: 16px;
}
.top-left img {
padding: 5px;
}
main {
text-align: center;
color: white;
padding: 15px 2%;
margin: 0;
}
main img {
max-width: 370px;
height: auto;
padding: 10px;
}
figure {
display: inline-block;
position: relative;
overflow: hidden;
margin: 0;
}
figcaption {
position: absolute;
font-family: "Montserrat", sans-serif;
font-size: 1.5em;
background: rgba(104, 40, 118, 0.5);
color: #ffffff;
padding: 20px 20px;
opacity: 0;
bottom: 0;
left: -30%;
-webkit-transition: all 0.6s ease;
-moz-transition: all 0.6s ease;
-o-transition: all 0.6s ease;
}
figure:hover figcaption {
opacity: 1;
left: 0;
}
.cap-bot figcaption {
left: 0;
bottom: -30%;
}
.cap-bot:hover figcaption {
bottom: 0;
}
h1 {
font-family: "Caveat", cursive;
font-weight: lighter;
font-size: 2em;
}
p {
font-family: "Montserrat", sans-serif;
font-size: 1em;
}
main a {
color: white;
text-decoration: none;
}
.bot-social {
margin: auto;
}
footer {
color: white;
text-align: center;
margin: 0;
padding: 10px;
}
footer a {
color: white;
text-decoration: none;
}
}
/* large laptop styles */
#media only screen and (max-width: 1362px) {
html,
body {
margin: 0;
width: auto;
background-color: #682876;
}
.container-header-mobile {
display: none;
}
.container-header {
height: 260px;
width: 100%;
position: relative;
text-align: center;
color: #682876;
background-color: white;
}
.container-header a {
text-decoration: none;
padding: 0 5px;
}
.container-header img {
max-height: 230px;
width: auto;
padding-right: 12%;
}
.bot-social {
display: none;
}
.top-left {
position: absolute;
top: 8px;
left: 16px;
}
.top-right {
position: absolute;
top: 8px;
right: 16px;
}
.top-left img {
padding: 5px;
}
main {
text-align: center;
color: white;
padding: 15px 2%;
margin: 0;
}
main img {
width: 236px;
height: auto;
padding: 10px;
}
figure {
display: inline-block;
position: relative;
overflow: hidden;
margin: 0;
}
figcaption {
position: absolute;
font-family: "Montserrat", sans-serif;
font-size: 1.5em;
background: rgba(104, 40, 118, 0.5);
color: #ffffff;
padding: 20px 20px;
opacity: 0;
bottom: 0;
left: -30%;
-webkit-transition: all 0.6s ease;
-moz-transition: all 0.6s ease;
-o-transition: all 0.6s ease;
}
figure:hover figcaption {
opacity: 1;
left: 0;
}
.cap-bot figcaption {
left: 0;
bottom: -30%;
}
.cap-bot:hover figcaption {
bottom: 0;
}
h1 {
font-family: "Caveat", cursive;
font-weight: lighter;
font-size: 2em;
}
p {
font-family: "Montserrat", sans-serif;
font-size: 1em;
}
main a {
color: white;
text-decoration: none;
}
.bot-social {
margin: auto;
}
footer {
color: white;
text-align: center;
margin: 0;
padding: 10px;
}
footer a {
color: white;
text-decoration: none;
}
}
/* desktop styles */
#media only screen and (max-width: 1440px) {
html,
body {
margin: 0;
width: auto;
background-color: #682876;
}
.container-header-mobile {
display: none;
}
.container-header {
height: 260px;
width: 100%;
position: relative;
text-align: center;
color: #682876;
background-color: white;
}
.container-header a {
text-decoration: none;
padding: 0 5px;
}
.container-header img {
max-height: 230px;
width: auto;
padding-right: 12%;
}
.bot-social {
display: none;
}
.top-left {
position: absolute;
top: 8px;
left: 16px;
}
.top-right {
position: absolute;
top: 8px;
right: 16px;
}
.top-left img {
padding: 5px;
}
main {
text-align: center;
color: white;
padding: 15px 2%;
margin: 0;
}
main img {
max-width: 500px;
height: auto;
padding: 10px;
}
figure {
display: inline-block;
position: relative;
overflow: hidden;
margin: 0;
}
figcaption {
position: absolute;
font-family: "Montserrat", sans-serif;
font-size: 1.5em;
background: rgba(104, 40, 118, 0.5);
color: #ffffff;
padding: 20px 20px;
opacity: 0;
bottom: 0;
left: -30%;
-webkit-transition: all 0.6s ease;
-moz-transition: all 0.6s ease;
-o-transition: all 0.6s ease;
}
figure:hover figcaption {
opacity: 1;
left: 0;
}
.cap-bot figcaption {
left: 0;
bottom: -30%;
}
.cap-bot:hover figcaption {
bottom: 0;
}
h1 {
font-family: "Caveat", cursive;
font-weight: lighter;
font-size: 2em;
}
p {
font-family: "Montserrat", sans-serif;
font-size: 1em;
}
main a {
color: white;
text-decoration: none;
}
.bot-social {
margin: auto;
}
footer {
color: white;
text-align: center;
margin: 0;
padding: 10px;
}
footer a {
color: white;
text-decoration: none;
}
}
/* HD styles */
#media only screen and (min-width: 1441px) {
html,
body {
margin: 0;
width: auto;
background-color: #682876;
}
.container-header-mobile {
display: none;
}
.container-header {
height: 260px;
width: 100%;
position: relative;
text-align: center;
color: #682876;
background-color: white;
}
.container-header a {
text-decoration: none;
padding: 0 5px;
}
.container-header img {
max-height: 230px;
width: auto;
padding-right: 12%;
}
.bot-social {
display: none;
}
.top-left {
position: absolute;
top: 8px;
left: 16px;
}
.top-right {
position: absolute;
top: 8px;
right: 16px;
}
.top-left img {
padding: 5px;
}
main {
text-align: center;
color: white;
padding: 15px 2%;
margin: 0;
}
main img {
max-width: 300%;
height: auto;
padding: 10px;
}
figure {
display: inline-block;
position: relative;
overflow: hidden;
margin: 0;
}
figcaption {
position: absolute;
font-family: "Montserrat", sans-serif;
font-size: 1.5em;
background: rgba(104, 40, 118, 0.5);
color: #ffffff;
padding: 20px 20px;
opacity: 0;
bottom: 0;
left: -30%;
-webkit-transition: all 0.6s ease;
-moz-transition: all 0.6s ease;
-o-transition: all 0.6s ease;
}
figure:hover figcaption {
opacity: 1;
left: 0;
}
.cap-bot figcaption {
left: 0;
bottom: -30%;
}
.cap-bot:hover figcaption {
bottom: 0;
}
h1 {
font-family: "Caveat", cursive;
font-weight: lighter;
font-size: 2em;
}
p {
font-family: "Montserrat", sans-serif;
font-size: 1em;
}
main a {
color: white;
text-decoration: none;
}
.bot-social {
margin: auto;
}
footer {
color: white;
text-align: center;
margin: 0;
padding: 10px;
}
footer a {
color: white;
text-decoration: none;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Volume Salon Westlake</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=Caveat|Montserrat" rel="stylesheet">
<link rel="stylesheet" href="normalize.css">
<link rel="stylesheet" href="main.css">
</head>
<body>
<header>
<div class="container-header">
<div class="top-left">
<a href="https://www.facebook.com/volumesalonwestlake/" target="_blank">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1671394/FB-f-Logo__blue_29.png" alt="Facebook">
</a>
<a href="https://www.instagram.com/explore/locations/1732209880415699/volume-salon/" target="_blank">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1671394/glyph-logo_May2016.png" alt="Instagram">
</a>
</div>
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1671394/header.jpg" alt="VS Logo">
<div class="top-right">
<p><b>26101 Center Ridge Rd. Westlake, OH 44145</b></p>
</div>
</div>
<div class="container-header-mobile">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1671394/header.jpg" alt="VS Logo"><br>
<p><b>26101 Center Ridge Rd. Westlake, OH 44145</b></p>
</div>
</header>
<main>
<div>
<h1>Volume Salon, located in Westlake, Ohio is... To view offered services and schedule an appointment with one of our independent sylists, visit the links below:</h1>
</div>
<div>
<figure class="cap-bot">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1671394/nikki.png" alt="Nikki">
<figcaption>Nikki</figcaption>
</figure>
<figure class="cap-bot">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1671394/kevin.png" alt="Kevin">
<figcaption>Kevin</figcaption>
</figure>
<figure class="cap-bot">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1671394/kelley2.png" alt="Kelley">
<figcaption>Kelley</figcaption>
</figure>
<figure class="cap-bot">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1671394/anne-marie.jpg" alt="Anne-Marie">
<figcaption>Anne-Marie</figcaption>
</figure>
</div>
<div class="bot-social">
<a href="https://www.facebook.com/volumesalonwestlake/" target="_blank">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1671394/FB-f-Logo__blue_29.png" alt="Facebook">
</a>
<a href="https://www.instagram.com/explore/locations/1732209880415699/volume-salon/" target="_blank">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1671394/glyph-logo_May2016.png" alt="Instagram">
</a>
</div>
<br><br><br>
</main>
<footer>
<p>© 2018 Volume Salon</p>
<p>Made with ♥ by Valarie Pisarcik</p>
</footer>
</body>
</html>
your header doesn't show up in width fewer than 320px because you set dispaly: none.
.container-header {
display: none;
}
please change it to :
.container-header {
display: block;
}
See if this helps you:
https://codepen.io/panchroma/pen/NBaNXv
Remember that CSS code cascades. If your stylesheet has
.element{
display:block;
}
.....
.element{
display:none;
}
then the display property for .element will be none.
In your CSS code you have
#media only screen and (max-width: 320px) {
.container-header-mobile {
height: 260px;
width: 100%;
position: relative;
text-align: center;
color: #682876;
background-color: white;
padding: 0;
}
}
...
#media only screen and (max-width: 1024px) {
.container-header-mobile {
display: none;
}
}
There are two ways to stop one media query from overriding another.
In my pen I modified your media queries by adding a (min-width) to each of them, eg
#media only screen and (max-width: 320px) {
...
}
#media only screen and (min-width: 321px) and (max-width: 768px) {
...
}
#media only screen and (min-width: 769px) and (max-width: 1024px) {
...
}
the other option is to reverse the order of your media queries, have the desktop viewport first and the mobile viewport last:
#media only screen and (min-width: 1441px) {
...
}
#media only screen and (max-width: 1440px) {
...
}
#media only screen and (max-width: 1362px) {
...
}
Hope this helps!
Related
I'm learning Angular, and i came across this particular problem which i still couldn't fix. I'm using the latest version of Bootstrap on my Angular project but i'm having issues with my styles.css file (which i had already defined before installing Bootstrap). I noticed that some things about my style changed after installing Bootstrap, and i can't fix them no matter how much i edit my styles.css file
Here are some examples:
https://i.stack.imgur.com/ZVOCl.png
https://i.stack.imgur.com/1UpkS.png
I suppose that the bootstrap.min.css file introduced on Bootstrap's installation might be overriding my custom css stylesheet, but i don't really see how.
This is my index.html file:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Selene Chavez -- Portfolio</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<!--Box Icons-->
<link href='https://unpkg.com/boxicons#2.1.4/css/boxicons.min.css' rel='stylesheet'>
<!--Box Icons-->
<!--Bootstrap-->
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"
integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN"
crossorigin="anonymous"></script>
<!--Mis estilos CSS-->
<link rel="stylesheet" href="src/styles.css">
</head>
<body>
<app-root></app-root>
</body>
</html>
This is my .css stylesheet:
/* Google Fonts */
#import url('https://fonts.googleapis.com/css2?family=Poppins:wght#400;500;600;700&display=swap');
* {
font-family: 'Poppins', sans-serif;
margin: 0;
padding: 0;
box-sizing: border-box;
scroll-behavior: smooth;
scroll-padding-top: 2rem;
}
/* Variables */
:root {
--main-color: #F24822;
--body-color: #090a1a;
--container-color: #171b3c;
--heading-color: #222231;
--box-color: #0d0f26;
--bg-color: #fff;
}
body {
color: var(--bg-color);
background: var(--body-color);
}
html::-webkit-scrollbar {
width: 0.5rem;
background: transparent;
}
html::-webkit-scrollbar-thumb {
background: var(--heading-color)
}
img {
width: 100%;
}
section {
padding: 3rem 0 2rem;
}
a {
text-decoration: none;
}
li {
list-style: none;
}
.container {
max-width: 960px;
margin: auto;
width: 100%;
}
/* Header */
header {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 100;
}
.header-active {
background: var(--box-color);
transition: 0.4s;
}
.nav {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px 0;
}
.navbar-logo {
display: inline-block;
vertical-align: middle;
width: 90px;
}
.navbar-logo img {
display: block;
width: 100%;
height: auto;
}
.navbar {
display: flex;
align-items: center;
column-gap: 1.5rem;
}
.nav-link {
font-size: 0.94rem;
padding: 4px 8px;
border-radius: 0.2rem;
color: var(--bg-color);
}
.nav-link:hover {
color: var(--main-color);
background: var(--container-color);
transition: 0.3s all linear;
}
/* Menu Icon */
.menu-icon {
display: none;
flex-direction: column;
align-items: center;
justify-content: center;
row-gap: 5px;
cursor: pointer;
z-index: 200;
transition: 0.3s;
}
.menu-icon div {
display: block;
background: var(--bg-color);
height: 2px;
width: 24px;
transition: 0.3s;
}
.move .line1 {
transform: rotate(-45deg) translate(-5px, 5px);
}
.move .line2 {
opacity: 0;
}
.move .line3 {
transform: rotate(45deg) translate(-5px, -5px);
}
.home {
min-height: 600px;
display: flex;
align-items: center;
justify-content: center;
padding-top: 7rem;
}
.home-content {
position: relative;
max-width: 600px;
width: 100%;
margin: auto;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.home-img {
width: 180px;
height: 180px;
border-radius: 50%;
background-color: #fd7051;
overflow: hidden;
margin-bottom: 2rem;
}
.home-img {
width: 180px;
height: 180px;
object-fit: cover;
object-position: center;
}
.home-text {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
}
.home-text h3 {
position: relative;
display: flex;
align-items: center;
column-gap: 0.5rem;
font-size: 1.1rem;
color: var(--main-color);
}
.home-text h3::before {
content: '';
position: absolute;
top: 50%;
transform: translate(-50%);
left: -15px;
width: 20px;
height: 2px;
background: var(--main-color);
}
.home-text h3::after {
content: '';
position: absolute;
top: 50%;
transform: translate(-50%);
right: -35px;
width: 20px;
height: 2px;
background: var(--main-color);
}
.home-text h2 {
font-size: 3.5rem;
line-height: 4.8rem;
}
.home-text p {
font-size: 0.938rem;
margin-bottom: 1.5rem;
}
.home-text .color {
color: var(--main-color);
}
.social {
display: flex;
align-items: center;
column-gap: 0.5rem;
}
.social .bx {
font-size: 1.3rem;
padding: 10px;
border-radius: 50%;
color: var(--bg-color);
background: var(--container-color);
}
.social .bx:hover {
background: var(--main-color);
transition: 0.3s all linear;
}
/* Heading */
.heading {
font-size: 5rem;
text-transform: uppercase;
color: var(--heading-color);
text-align: center;
margin-bottom: 2rem;
}
.about-content {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1.5rem;
}
.about-data span {
font-size: 1rem;
font-weight: 500;
text-transform: uppercase;
color: var(--main-color);
}
.about-data h2 {
font-size: 2rem;
line-height: 2.6rem;
font-weight: 700;
margin: 1rem 0;
}
.btn {
font-size: 0.97rem;
display: inline-flex;
align-items: center;
column-gap: 0.5rem;
color: var(--bg-color);
background: var(--main-color);
padding: 12px 16px;
border-radius: 0.4rem;
margin-top: 1rem;
}
.btn .bx {
font-size: 1.2rem;
}
.btn:hover {
background: #fd7051;
transition: 0.3s all linear;
}
.about-text p {
font-size: 0.938rem;
letter-spacing: 1px;
text-align: justify;
margin-bottom: 1.5rem;
}
/* Skills */
.skills {
padding: 50px 20px;
}
.skills .content-section {
max-width: 1100px;
margin: auto;
}
.skills .row {
display: flex;
}
.skills .row .col {
width: 50%;
padding: 0 20px;
}
.skills .row .col h3 {
font-size: 28px;
margin-bottom: 25px;
}
.skills .skill>span {
font-weight: bold;
display: block;
margin-bottom: 10px;
}
.skills .skill .skills-bar {
height: 8px;
width: 80%;
background-color: var(--heading-color);
position: relative;
margin-bottom: 30px;
}
.skills .skill .progress {
background-color: var(--main-color);
position: absolute;
top: 0;
left: 0;
height: 8px;
}
.skills .skill .skills-bar span {
position: absolute;
height: 40px;
width: 40px;
background-color: var(--main-color);
border-radius: 50px;
line-height: 40px;
text-align: center;
top: -17px;
right: -15px;
font-size: 14px;
}
.skills .skill .javascript {
width: 0%;
animation: 2s javascript forwards;
}
#keyframes javascript {
0% {
width: 0%;
}
100% {
width: 75%;
}
}
.skills .skill .htmlcss {
width: 0%;
animation: 2s htmlcss forwards;
}
#keyframes htmlcss {
0% {
width: 0%;
}
100% {
width: 89%;
}
}
.skills .skill .python {
width: 0%;
animation: 2s python forwards;
}
#keyframes python {
0% {
width: 0%;
}
100% {
width: 85%;
}
}
.skills .skill .mysql {
width: 0%;
animation: 2s mysql forwards;
}
#keyframes mysql {
0% {
width: 0%;
}
100% {
width: 70%;
}
}
.skills .skill .photoshop {
width: 0%;
animation: 2s photoshop forwards;
}
#keyframes photoshop {
0% {
width: 0%;
}
100% {
width: 90%;
}
}
.skills .skill .comunicacion {
width: 0%;
animation: 2s comunicacion forwards;
}
#keyframes comunicacion {
0% {
width: 0%;
}
100% {
width: 80%;
}
}
.skills .skill .trabajoequipo {
width: 0%;
animation: 2s trabajoequipo forwards;
}
#keyframes trabajoequipo {
0% {
width: 0%;
}
100% {
width: 75%;
}
}
.skills .skill .creatividad {
width: 0%;
animation: 2s creatividad forwards;
}
#keyframes creatividad {
0% {
width: 0%;
}
100% {
width: 65%;
}
}
.skills .skill .autodidacta {
width: 0%;
animation: 2s autodidacta forwards;
}
#keyframes autodidacta {
0% {
width: 0%;
}
100% {
width: 95%;
}
}
.skills .skill .productividad {
width: 0%;
animation: 2s productividad forwards;
}
#keyframes productividad {
0% {
width: 0%;
}
100% {
width: 90%;
}
}
/* Curriculum */
.estudios {
padding: 50px 20px;
}
.estudios .content-section {
max-width: 1100px;
margin: auto;
}
.estudios .row {
display: flex;
justify-content: space-between;
}
.estudios .row .col {
width: 49%;
padding: 0 20px;
}
.estudios .row .col h3 {
font-size: 28px;
margin-bottom: 25px;
}
.estudios .row .left {
border-right: 2px solid var(--container-color);
}
.estudios .row .right {
border-left: 2px solid var(--container-color);
}
.estudios .row .item {
padding: 25px;
margin-bottom: 30px;
background-color: var(--heading-color);
position: relative;
}
.estudios .row .item h4 {
font-size: 20px;
margin-bottom: 10px;
}
.estudios .row .item .institucion {
color: var(--main-color);
font-size: 18px;
font-weight: bold;
display: block;
}
.estudios .row .item .fecha {
display: block;
color: var(--main-color);
margin-bottom: 10px;
}
.estudios .row .item p {
line-height: 24px;
}
.estudios .row .left {
border-right: 2px solid var(--heading-color);
margin-right: 20px;
}
.estudios .row .right {
border-left: 2px solid var(--heading-color);
margin-left: 20px;
}
.estudios .row .item .connectori {
height: 2px;
background-color: var(--main-color);
width: 47px;
position: absolute;
top: 50%;
right: -47px;
z-index: 5;
}
.estudios .row .item .connectori .circlei {
display: block;
height: 10px;
width: 10px;
border-radius: 50%;
background-color: var(--main-color);
float: right;
position: relative;
bottom: 4px;
}
.estudios .row .item .connectord {
height: 2px;
background-color: var(--main-color);
width: 47px;
position: absolute;
top: 50%;
left: -47px;
z-index: 5;
}
.estudios .row .item .connectord .circled {
display: block;
height: 10px;
width: 10px;
border-radius: 50%;
background-color: var(--main-color);
float: left;
position: relative;
bottom: 4px;
}
/* Portfolio */
.portfolio-content {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 2rem;
}
.portfolio-box {
position: relative;
width: 100%;
height: 320px;
border-radius: 1rem;
overflow: hidden;
}
.portfolio-img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
.portfolio-overlay {
position: absolute;
top: -100%;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: rgba(59, 40, 22, 0.7);
}
.portfolio-overlay h2 {
font-size: 1.6rem;
font-weight: 600;
margin-bottom: 10px;
}
.portfolio-overlay .bx {
font-size: 24px;
padding: 10px;
background: var(--main-color);
color: var(--bg-color);
border-radius: 4px;
}
.portfolio-overlay .bx:hover {
background: #fd7051;
transition: 0.3s all linear;
}
.portfolio-box:hover .portfolio-overlay {
top: 0;
transition: 0.3s all ease;
}
/* Contact Form */
.contact-form {
max-width: 600px;
margin: auto;
width: 100%;
display: grid;
row-gap: 1rem;
}
.contact-form input,
.contact-form textarea {
border: none;
outline: none;
font-size: 0.9rem;
padding: 15px;
color: var(--bg-color);
background: var(--box-color);
border-radius: 0.4rem;
}
.contact-form .send-btn {
width: 120px;
font-size: 1rem;
letter-spacing: 1px;
font-weight: 500;
text-transform: uppercase;
padding: 12px;
background: var(--main-color);
cursor: pointer;
}
.contact-form .send-btn:hover {
background: #fd7051;
transition: 0.3s all linear;
}
/* Footer */
.footer {
display: flex;
align-items: center;
flex-direction: column;
row-gap: 1.4rem;
padding: 30px 0;
}
.footer p {
font-size: 0.9rem;
}
/* Scroll Top */
.scroll-top {
position: fixed;
bottom: -100%;
right: 1.5rem;
}
.scroll-top .bx {
padding: 8px;
font-size: 1.3rem;
color: var(--bg-color);
background: var(--box-color);
border-radius: 0.2rem;
}
.scroll-top .bx:hover {
background: var(--container-color);
transition: 0.3s;
}
.scroll-active {
bottom: 2rem;
transition: 0.3s;
}
/* Responsive */
#media (max-width:990px) {
.container {
margin: 0 auto;
width: 90%;
}
}
#media (max-width:892px) {
section {
padding: 2rem 0;
}
.nav {
padding: 12px 0;
}
.heading {
font-size: 4rem;
}
.portfolio-box {
height: 257px;
}
}
#media (max-width:775px) {
.nav {
padding: 10px 0;
}
.logo {
font-size: 1.1rem;
}
.home {
min-height: 500px;
padding-top: 6rem;
}
.home-text h3 {
font-size: 1rem;
}
.home-text h2 {
font-size: 3rem;
line-height: 3.8rem;
}
.home-text p {
font-size: 0.825rem;
}
.skills {
padding: 10px 50px;
}
.skills .row .col h3 {
font-size: 1rem;
}
.estudios .content-section {
max-width: 600px;
margin: auto;
}
.portfolio-box {
height: 245px;
}
.menu-icon {
display: flex;
}
.navbar {
position: absolute;
top: 0;
right: -100%;
width: 300px;
height: 100vh;
background: var(--box-color);
display: flex;
flex-direction: column;
align-items: center;
padding: 50px 20px;
transition: 0.5s all cubic-bezier(0.075, 0.82, 0.165, 1);
}
.open-menu {
right: 0;
transition: 0.5s all cubic-bezier(0.075, 0.82, 0.165, 1);
}
.nav-link {
display: block;
margin: 1rem 0;
}
}
#media (max-width:635px) {
.about-content {
grid-template-columns: 1fr;
}
.about-data span {
font-size: 0.9rem;
}
.about-data h2 {
font-size: 1.7rem;
line-height: 2.3rem;
font-weight: 600;
margin: 0.8rem 0;
}
.about-text p {
font-size: 0.825rem;
margin-bottom: 1.3rem;
}
.estudios .row {
display: block;
}
.estudios .row .col {
width: 90%;
}
.estudios .row .right {
margin-left: 20px;
}
}
#media (max-width:450px) {
.home {
min-height: 485px;
padding-top: 5rem;
}
.home-img {
width: 120px;
height: 120px;
}
.home-img img {
width: 120px;
height: 160px;
}
.home-text h2 {
font-size: 2.1rem;
line-height: 3.2rem;
}
.home-text p br {
display: contents;
}
.heading {
font-size: 3rem;
}
.about-data h2 {
font-size: 1.5rem;
line-height: 2.1rem;
margin: 0.6rem 0;
}
.skills .row {
display: block;
}
.skills .row .col {
width: 100%;
}
.skills .row .col .skills-bar {
width: 100%;
}
.portfolio-content {
grid-template-columns: 1fr;
}
}
#media (max-width:325px) {
.navbar {
width: 100%;
}
.portfolio-box {
height: 190px;
}
}
The routes on my Angular.json file:
"test": {
"builder": "#angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.css"
],
"scripts": [
"node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"
]
}
}
}
}
},
First of all, If you are using Bootstrap npm package , then you shouldn't use cdn bootstrap link in index.html.
In angular.json, you should include both bootstrap css and js , on server object also to use it while creating build.Its now only in test object.
To override your style issue , you can use !important in you style.css where your style is overide by bootstrap classes
https://www.freecodecamp.org/news/how-to-add-bootstrap-css-framework-to-an-angular-application/
I've got a small problem but I cannot seem to find a solution. I have a page which is fetching data from a JSON, but instead of the cards returning in a dynamic grid, the cards are returning one on top of each other. Does anyone know a fix (I feel like I've overlooked something very very simple...)
#import url('https://fonts.googleapis.com/css2?family=Aclonica&family=Audiowide&family=Black+Ops+One&family=Bungee&family=Bungee+Hairline&family=Bungee+Inline&family=Bungee+Outline&family=Bungee+Shade&family=Days+One&family=Michroma&family=Monoton&family=Racing+Sans+One&family=Titillium+Web:ital,wght#0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700&display=swap');
#font-face {
font-family: D2DTitle1;
src: url(fonts/Formula1-Regular_web_0.ttf);
}
#font-face {
font-family: D2DTitle2;
src: url(fonts/Formula1-Bold_web_0.ttf);
}
#font-face {
font-family: D2DTitle3;
src: url(fonts/Formula1-Wide_web_0.ttf);
}
#font-face {
font-family: D2DBody1;
src: url(fonts/TitilliumWeb-ExtraLight.ttf);
}
#font-face {
font-family: D2DBody2;
src: url(fonts/TitilliumWeb-Light.ttf);
}
#font-face {
font-family: D2DBody3;
src: url(fonts/TitilliumWeb-Regular.ttf);
}
#font-face {
font-family: D2DBody4;
src: url(fonts/TitilliumWeb-SemiBold.ttf);
}
#font-face {
font-family: D2DBody5;
src: url(fonts/TitilliumWeb-SuperBold.ttf);
}
#font-face {
font-family: D2DBody6;
src: url(fonts/TitilliumWeb-SuperSuperBlack.ttf);
}
#font-face {
font-family: 'icomoon';
src: url('fonts/icomoon.eot?oymsdl');
src: url('fonts/icomoon.eot?oymsdl#iefix') format('embedded-opentype'),
url('fonts/icomoon.ttf?oymsdl') format('truetype'),
url('fonts/icomoon.woff?oymsdl') format('woff'),
url('fonts/icomoon.svg?oymsdl#icomoon') format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
}
[class^="icon-"], [class*=" icon-"] {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: 'icomoon' !important;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-news:before {
content: "\e900";
}
.icon-flag:before {
content: "\e901";
}
.icon-helmet:before {
content: "\e902";
}
.icon-wheel:before {
content: "\e903";
}
.icon-specials:before {
content: "\e91c";
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: #000000;
color: #ffffff;
box-sizing: border-box;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-family: 'D2DBody2';
min-height: 100vh;
text-align: center;
overflow-x: hidden;
}
body > * {
width: 100%;
}
h1,
h2,
h3,
h7 {
text-transform: uppercase;
text-align: center;
}
h1 {
font-size: 35pt;
color: black;
-webkit-text-stroke-width: 1.3px;
-webkit-text-stroke-color: white;
font-family: 'D2DTitle2', sans-serif;
margin: 1.5rem 0;
}
h2 {
font-size: 18pt;
color: white;
font-family: 'D2DTitle2', sans-serif;
}
h3 {
font-size: 14pt;
color: white;
text-align: center;
font-family: 'D2DTitle2', sans-serif;}
h4 {
font-size: 11pt;
color: white;
text-align: left;
font-family: 'D2DBody1';
}
h5 {
font-size: 8pt;
font-style: italic;
margin-right: 10px;
color: white;
text-align: right;
font-family: 'D2DBody1';
}
h6 {
font-size: 10pt;
color: white;
text-align: center;
font-family: 'D2DBody1';
}
h7 {
font-size: 12pt;
color: white;
text-align: center;
font-family: 'D2DTitle2', sans-serif;}
p {
font-size: 12pt;
margin-bottom: 12pt;
}
.container {
max-width: 90%;
margin: 0 auto;
}
.iframe {
width: 100%;
max-width: 1000px;
margin: 1rem 0;
}
.circuit-map > img {
display: block;
width: 100%;
height: 100%;
}
.circuit-map .circuit-controls {
position: absolute;
overflow: hidden;
display: flex;
transition: 0.3s;
cursor: pointer;
}
.circuit-map .circuit-controls img {
/* Display triggered via JavaScript, once circuit image loads */
display: none;
width: calc(100%);
min-width: calc(100%);
}
.circuit-map .circuit-controls#statsLeft,
.circuit-map .circuit-controls#statsRight {
top: 0;
width: 4%;
height: 90%;
margin: 3% 0;
}
.circuit-map .circuit-controls#statsLeft {
left: 0;
flex-direction: row-reverse;
}
.circuit-map .circuit-controls#statsRight {
right: 0;
}
.circuit-map .circuit-controls#statsLeft:hover,
.circuit-map .circuit-controls#statsRight:hover {
width: 95%;
}
.circuit-map .circuit-controls#statsTop,
.circuit-map .circuit-controls#statsBottom {
left: 0;
height: 6%;
width: 90%;
margin: 0 5%;
}
.circuit-map .circuit-controls#statsTop {
top: 0;
flex-direction: column-reverse;
}
.circuit-map .circuit-controls#statsBottom {
bottom: 0;
flex-direction:column;
}
.circuit-map .circuit-controls#statsTop:hover,
.circuit-map .circuit-controls#statsBottom:hover {
height: 91%;
}
.sector {
display: flex;
flex-wrap: wrap;
justify-content: center;
padding: 2rem 0;
max-width: 1200px;
}
.sector .sector-card {
position: relative;
width: 100%;
max-width: 322px;
min-height: 322px;
background: #000;
cursor: pointer;
overflow: hidden;
margin: 0.5rem;
}
.sector-card .content {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
padding: 5px;
padding-bottom: 40px;
}
.sector-card .face {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
transition: 0.5s;
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
.sector-card:hover .face {
transform: translateY(calc(100% - 35px));
}
.sector-card .face h2 {
font-size: 1.75em;
text-shadow: 0.1em 0.1em black;
}
.sector-card .content p {
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-align: center;
margin-bottom: 0;
}
.sector-card:nth-of-type(1) .content p {
background-color: rgb(255, 0, 0);
}
.sector-card:nth-of-type(2) .content p {
background-color: rgb(0, 179, 228);
}
.sector-card:nth-of-type(3) .content p {
background-color: rgb(254, 213, 42);
}
#about {
top: 1em;
background-color: black;
font-weight: 500;
font-family: 'D2DTitle2';
}
#media screen and (max-width: 915px) {
h1 {
font-size: 25pt;
}
h2 {
font-size: 14pt;
}
p {
font-size: 11pt;
}
}
.countries-container {
margin-top: 2rem;
margin-bottom: 2rem;
width: 100%;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
}
.countries-container .card {
position: relative;
width: 250px;
margin: 0 1rem 1rem 0;
background-color: #4D4D4D;
cursor: pointer;
-webkit-transition: all 0.2s ease-out;
transition: all 0.2s ease-out;
}
.countries-container .card .card-header .card-title {
color: white;
display: absolute;
margin: 0;
text-align: center;
line-height: 1.2;
padding: 0.5rem 0.75rem;
white-space: pre-wrap;
}
.countries-container .card .card-header img {
display: absolute;
height: 167px;
-o-object-fit: cover;
object-fit: cover;
}
.countries-container .card .card-body {
padding: 0.5rem 0.75rem;
}
.countries-container .card .card-body .card-body-item {
margin-bottom: 0.5rem;
}
.countries-container .card .card-body .card-body-item:last-child {
margin-bottom: 0;
}
.countries-container .card .card-body .card-body-item p {
margin: 0;
}
.card-img-caption .card-img-top {
z-index: 0;
}
.linkicons{
width: 30px;
}
.race-container {
position: relative;
text-align: center;
color: white;
height: 150px;
width: 90%;
overflow: hidden;
background-size: cover;
background-position: center;
}
.r-result {
position: absolute;
color: white;
top: 40%;
right: 5%;
font-family: 'D2DTitle2', sans-serif;
font-size: 1.5em;
text-shadow: .1em .1em #4D4D4D;
text-transform: uppercase;
-webkit-text-stroke-width: 1.3px;
-webkit-text-stroke-color: black;
}
.points {
position: absolute;
color: white;
top: 70%;
right: 5%;
font-family: 'D2DTitle2', sans-serif;
font-size: 1.5em;
text-shadow: .1em .1em #4D4D4D;
text-transform: uppercase;
-webkit-text-stroke-width: 1.3px;
-webkit-text-stroke-color: black;
}
.q-result {
position: absolute;
color: white;
top: 10%;
right: 5%;
font-family: 'D2DTitle2', sans-serif;
font-size: 1.5em;
text-shadow: .1em .1em #4D4D4D;
text-transform: uppercase;
-webkit-text-stroke-width: 1.3px;
-webkit-text-stroke-color: black;
}
.round-name {
position: absolute;
color: white;
top: 40%;
left: 5%;
font-family: 'D2DTitle2', sans-serif;
font-size: 1.5em;
text-shadow: .1em .1em #4D4D4D;
text-transform: uppercase;
-webkit-text-stroke-width: 1.3px;
-webkit-text-stroke-color: black;
}
.specials {
position: relative;
text-align: center;
color: white;
width: 90%;
overflow: hidden;
background-size: cover;
background-position: center;
font-family: 'D2DTitle2', sans-serif;
font-size: 30px;
text-transform: uppercase;
}
.grid-container {
display: grid;
grid-template-columns: 25% 25%;
grid-gap: 50%;
font-size: 3em;
}
.countries-container .profile {
position: relative;
width: 275px;
margin: 1em 1em 1em 1em;
background-color: #000000;
cursor: pointer;
-webkit-transition: all 0.2s ease-out;
transition: all 0.2s ease-out;
}
.countries-container .circuit {
position: relative;
width: 275px;
margin: .75em .75em .75em .75em;
background-color: #000000;
cursor: pointer;
-webkit-transition: all 0.2s ease-out;
transition: all 0.2s ease-out;
}
.material-card {
position: relative;
padding-bottom: calc(100% - 16px);
margin-bottom: 1em;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
border: 2px solid #fff;
}
.material-card h2 {
position: absolute;
top: calc(100% - 54px);
left: 0;
width: 100%;
height: 54px;
padding: 10px 16px;
color: #fff;
margin: 0;
z-index: 10;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-ms-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
}
.material-card h2 span {
display: block;
font-size: 0.63em;
}
.material-card h2 strong {
display: block;
font-size: 0.58em;
}
.material-card .mc-description {
position: absolute;
right: .5em;
left: .5em;
bottom: .5em;
overflow: hidden;
opacity: 0;
filter: alpha(opacity=0);
-webkit-transition: all 1.2s;
-moz-transition: all 1.2s;
-ms-transition: all 1.2s;
-o-transition: all 1.2s;
transition: all 1.2s;
text-align: left;
}
.material-card .mc-footer {
height: 0;
overflow: hidden;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-ms-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
}
.material-card .img-container {
overflow: hidden;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 3;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-ms-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
}
.material-card.mc-active .mc-description {
top: 30px;
padding-top: 2em;
padding-bottom: 10px;
overflow-y: scroll;
opacity: 1;
filter: alpha(opacity=100);
color: white;
}
.material-card.Profile h2 {
background-color: #000000;
}
.material-card.Profile.mc-active .mc-content {
background-color: #4d4d4d;
}
.material-card.circuit h2 {
background-color: #000000;
}
.material-card.circuit.mc-active .mc-content {
background-color: #4d4d4d;
}
.material-card.mc-active h2 {
top: 0;
padding: 5px 0px 0px 2.5em;
}
.material-card .mc-content {
position: absolute;
right: 0;
top: 0;
bottom: 0px;
left: 0;
text-align: center;
overflow: hidden;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-ms-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
}
.material-card .mc-btn-action {
position: absolute;
right: 2px;
top: 2px;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
width: 44px;
height: 44px;
text-align: center;
color: #fff;
cursor: pointer;
z-index: 20;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-ms-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
}
.material-card.mc-active .mc-btn-action {
top: calc(100% - 34px);
}
.material-card.mc-active .img-container {
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
width: 54px;
height: 54px;
z-index: 30;
left: 0px;
top: 0px;
}
.material-card.mc-active .mc-description-bottom {
position:flex;
bottom:0em;
right:0;
text-align: left;
}
.no-hover:hover {
background-color: transparent;
}
#myInput {
background-color: #000;
width: 60%;
font-size: 16px;
font-family: "D2DTitle2";
color: #fff;
padding: 12px 20px 12px 20px;
border: 1.5px solid #fff;
margin-bottom: 5px;
}
.standings-column {
float: left;
width: 50%;
padding: 15px;
}
.standings-row:after {
content: "";
display: table;
clear: both;
}
.center {
display: block;
margin-left: auto;
margin-right: auto;
width: 190%;
}
#-webkit-keyframes ticker {
0% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
visibility: visible;
}
100% {
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
}
}
#keyframes ticker {
0% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
visibility: visible;
}
100% {
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
}
}
.ticker-wrap {
position: inline-block;
top: 0;
width: 100%;
overflow: hidden;
height: 4rem;
background-color: rgba(0, 0, 0, 0.9);
padding-left: 100%;
}
.ticker {
display: inline-block;
height: 4rem;
line-height: 4rem;
white-space: nowrap;
padding-right: 100%;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-name: ticker;
animation-name: ticker;
-webkit-animation-duration: 30s;
animation-duration: 30s;
}
.ticker_item {
display: inline-block;
padding: 0 2rem;
font-size: 2rem;
color: white;
}
<!DOCTYPE html>
<html lang="en" dir="ltr">
<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" />
<link rel="stylesheet" href="./style.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
</head>
<body>
<header>
<a href="/index.html">
<img src="/vault/page-assets/Header.svg"></a>
<div id="nav-placeholder"></div>
<script>
$(function(){
$("#nav-placeholder").load("/vault/page-assets/nav.html");
});
</script>
<hr style="height:1px;background-color:white">
<h1>DIV</h1>
</header>
<script>
function myFunction() {
var input, filter, ul, li, a, i, txtValue;
input = document.getElementById('myInput');
filter = input.value.toUpperCase();
ul = document.getElementById("myUL");
li = ul.getElementsByTagName('li');
for (i = 0; i < li.length; i++) {
a = li[i].getElementsByTagName("a")[0];
txtValue = a.textContent || a.innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
li[i].style.display = "";
} else {
li[i].style.display = "none";}}}
</script>
<input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search On Page..">
<ul id="myUL">
<div id="countries" class="countries-container container">
<div id="myData"></div>
</div>
</ul>
<script>
jQuery(document).ready(($) => {
//Create variable to store the JSON
var data = `[
{
"id": 3,
"title": "2022",
"subtitle": "Season",
"answers":[
{ "name": "Driver Profiling", "value": "0" },
{ "name": "Driver Assessment", "value": "1" },
{ "name": "Driver Training", "value": "2" },
{ "name": "Driver Management", "value": "3" },
{ "name": "Driver License check", "value": "4" }
]
},
{
"id": 4,
"title": "2021",
"subtitle": "2021",
"answers":[
{ "name": "1 to 9 Drivers", "value": 0 },
{ "name": "10 to 49 Drivers", "value": 1 },
{ "name": "50 to 249 Drivers", "value": 2 },
{ "name": "250 to 1000 Drivers", "value": 3 },
{ "name": "More than 1000 Drivers", "value": 4 }
]
}
]`;
//Convert the data into JS arrays & objects
let readyData = JSON.parse(data);
// Just for testing
console.log(readyData);
//Use a loop function or for loop with append function inside it
let answers = '';
readyData.map((obj) => {
console.log(obj);
let answers = '';
obj.answers.map((answer) => {
answers = answers +`<p>${answer.name}</p>`;
});
$("#myData").append(`
<li class="li-no-hover"><div class="profile">
<article class="material-card Profile">
<a style="text-decoration: none;" href="/vault/season-archive/1950/index.html">
<h2><span>${obj.title}</span>
<strong>${obj.subtitle}</strong></h2>
<div class="mc-content">
<div class="img-container">
<img src="/vault/season-archive/1950/tile.png" alt="1950 Season" style="width: 100%";></div>
<div class="mc-description" style="text-align: left; line-height: 135%;">
${answers}
</div></div></a>
<a class="mc-btn-action">
<img style="width:60%" src="/page-assets/d2d-icon(left).svg"></a>
</article>
</div></li>
`);
});
});
</script>
<footer>
<div id="footer-placeholder"></div>
<script>
$(function(){
$("#footer-placeholder").load("../../page-assets/footer.html");
});
</script>
<footer>
<script>
$(function() {
$('.material-card > .mc-btn-action').click(function () {
var card = $(this).parent('.material-card');
var icon = $(this).children('i');
icon.addClass('fa-spin-fast');
if (card.hasClass('mc-active')) {
card.removeClass('mc-active');
window.setTimeout(function() {
icon
.removeClass('fa-arrow-left')
.removeClass('fa-spin-fast')
.addClass('fa-bars');
}, 800);
} else {
card.addClass('mc-active');
window.setTimeout(function() {
icon
.removeClass('fa-bars')
.removeClass('fa-spin-fast')
.addClass('fa-arrow-left');
}, 800);
}
});
});
</script>
</body>
</html>
I’m working on my portfolio website and I was wondering how do I make a block of text appeared when I scrolled down the website? So when someone scroll down, say example my About me section to appear on the left.
It depends on what kind of text effecton mouse scroll you are looking for. Here’s a nice little timeline I once used. You can change this to represent what you like:
HTML
<div class="stem-wrapper">
<div class="stem"></div>
<div class="stem-background"></div>
</div>
<header class="section header">
<div class="section-inner">
<div class="master-head">
<h1 class="page-title">Colored Stem</h1>
<p class="page-description">Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water.</p>
<p class="scroll-button" onClick="$('.post-wrapper .post:first-child .stem-overlay .icon').click();">Ready to go for a ride?</p>
</div>
</div> <!-- section-inner -->
</header> <!-- header -->
CSS
/*========== Global ==========*/
/*========== Basics ==========*/
html,
body {
height: 100%;
}
body {
background: #112C30;
margin: 0px;
padding: 0px;
font-family: sans-serif;
font-size: 15px;
line-height: 26px;
color: #B9CFD0;
font-family: 'Roboto Slab', serif;
overflow-x: hidden;
overflow-y: scroll;
}
a {
color: #B9CFD0;
text-decoration: none;
border-bottom: 1px solid #B9CFD0;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: 'Comfortaa', cursive;
}
/*========== Sections ==========*/
.header {
text-align: center;
position: relative;
z-index: 1;
background-image: linear-gradient(to bottom, #6fc7d4 0%, #39ACBD 100%);
}
.header .master-head {
padding: 7% 30px;
}
.header .page-title {
padding: 0 30px 0 30px;
font-size: 60px;
line-height: 1em;
letter-spacing: 10px;
color: #FFF;
}
.header .page-description {
margin: 30px auto;
max-width: 600px;
font-size: 18px;
line-height: 2em;
color: #FFF;
}
.header .scroll-button {
color: #FFF;
font-size: 20px;
padding: 15px 20px 15px 20px;
display: inline-block;
background: #3093A2;
cursor: pointer;
transition-duration: 0.4s;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.header .scroll-button:hover {
background: #246f7b;
}
.header .scroll-button:active {
background: #194c53;
}
.main-content {
margin: 0px auto;
position: relative;
}
.main-content .section-inner,
.main-content .post-wrapper {
*zoom: 1;
}
.main-content .section-inner:before,
.main-content .post-wrapper:before,
.main-content .section-inner:after,
.main-content .post-wrapper:after {
content: "";
display: table;
}
.main-content .section-inner:after,
.main-content .post-wrapper:after {
clear: both;
}
.footer {
background: #112C30;
padding: 150px 0px 300px 0px;
position: relative;
z-index: 1;
}
.footer .good-bye {
text-align: center;
font-size: 18px;
line-height: 36px;
}
.footer .good-bye p {
display: block;
margin: 0px auto 30px auto;
max-width: 300px;
clear: both;
}
.section .section-inner {
margin: 0px auto;
width: 1024px;
}
#media only screen {
.section .section-inner {
width: auto;
max-width: 1024px;
}
}
/*========== Stem ==========*/
.stem-wrapper {
position: fixed;
top: 0px;
bottom: 0px;
left: 50%;
}
.stem-wrapper.color-yellow .stem-background {
background: #E9E566;
}
.stem-wrapper.color-green .stem-background {
background: #35C189;
}
.stem-wrapper.color-white .stem-background {
background: #FFF;
}
.stem-wrapper .stem,
.stem-wrapper .stem-background {
position: absolute;
top: 0px;
left: -30px;
width: 60px;
}
.stem-wrapper .stem {
background: #1e4f56;
height: 100%;
}
.stem-wrapper .stem-background {
background: #39ACBD;
height: 50%;
transition-duration: 0.5s;
}
.stem-padding,
.single-stem-icon {
width: 60px;
height: 60px;
margin: 0px auto;
background: transparent url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/22043/stem-mask.png) repeat-y top center;
}
.single-stem-icon.scroll-to-top {
cursor: pointer;
background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/22043/scroll-to-top-icon.png);
}
/*========== Post wrapper ==========*/
.post-wrapper {
*zoom: 1;
}
.post-wrapper:before,
.post-wrapper:after {
content: "";
display: table;
}
.post-wrapper:after {
clear: both;
}
.post-wrapper .post {
position: relative;
width: 432px;
padding: 0px 0px 60px 0px;
clear: both;
opacity: 1;
-webkit-perspective: 1000px;
perspective: 1000px;
}
.post-wrapper .post.hidden .post-content {
-webkit-transform: translateY(100px) rotateX(30deg);
transform: translateY(100px) rotateX(30deg);
opacity: 0;
}
.post-wrapper .post:hover .post-content,
.post-wrapper .post.active .post-content {
opacity: 1;
}
.post-wrapper .post:hover .post-content .meta,
.post-wrapper .post.active .post-content .meta {
opacity: 1;
-webkit-transform: none;
transform: none;
}
.post-wrapper .post:nth-child(even) {
float: right;
}
.post-wrapper .post:nth-child(odd) {
float: left;
}
.post-wrapper .post:nth-child(even) .stem-overlay {
left: -110px;
}
.post-wrapper .post:nth-child(odd) .stem-overlay {
right: -110px;
}
.post-wrapper .post.music-icon .stem-overlay .icon {
background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/22043/music-icon.png);
}
.post-wrapper .post.bitbucket-icon .stem-overlay .icon {
background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/22043/bitbucket-icon.png);
}
.post-wrapper .post.m-icon .stem-overlay .icon {
background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/22043/m-icon.png);
}
.post-wrapper .post.twitter-icon .stem-overlay .icon {
background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/22043/twitter-icon.png);
}
.post-wrapper .post .stem-overlay {
position: absolute;
top: 0px;
bottom: 0px;
width: 60px;
}
.post-wrapper .post .stem-overlay .icon {
background: transparent no-repeat center center;
height: 60px;
width: 60px;
cursor: pointer;
}
.post-wrapper .post .stem-overlay .stem-mask {
position: absolute;
top: 60px;
bottom: 0px;
left: 0px;
right: 0px;
background: transparent url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/22043/stem-mask.png) repeat-y top center;
}
.post-wrapper .post .post-content {
opacity: .3;
transition-duration: 0.4s;
-webkit-transform: none;
transform: none;
}
.post-wrapper .post .post-content .meta {
color: rgba(255, 255, 255, 0.3);
margin: 0px 0px 15px 0px;
letter-spacing: 1px;
opacity: 0;
transition-duration: 1s;
transition-delay: 0.2s;
-webkit-transform: translateY(-5px);
transform: translateY(-5px);
}
.post-wrapper .post .post-content .post-title {
font-size: 32px;
line-height: 42px;
margin: 0px 0px 15px 0px;
}
/*========== Media queries ==========*/
#media only screen and (max-width: 1080px) {
.main-content,
.main-content .section-inner {
max-width: none;
}
.stem-wrapper {
left: 80px;
}
.stem-padding,
.single-stem-icon {
margin: 0px;
float: left;
margin-left: 50px;
}
.post-wrapper .post,
.post-wrapper .post:nth-child(even),
.post-wrapper .post:nth-child(odd) {
width: auto;
margin-left: 110px;
float: none;
}
.post-wrapper .post .stem-overlay,
.post-wrapper .post:nth-child(even) .stem-overlay,
.post-wrapper .post:nth-child(odd) .stem-overlay {
left: -60px;
right: auto;
}
.post-wrapper .post .post-content {
padding: 0px 50px;
}
}
#media only screen and (max-width: 700px) {
.header .page-title {
font-size: 40px;
}
.post-wrapper .post {
margin-left: 90px !important;
}
.post-wrapper .post .post-content {
padding: 0 25px;
}
.stem-wrapper {
left: 60px;
}
.stem-padding,
.single-stem-icon {
margin-left: 30px;
}
}
.clearfix {
*zoom: 1;
}
.clearfix:before,
.clearfix:after {
content: "";
display: table;
}
.clearfix:after {
clear: both;
}
JavaScript
($) {
$(document).ready(function() {
setupFade();
setupClickToScroll();
setupPostAnimation();
setupScrollToTop();
enableScrollAbortion();
// Trigger window.scroll, this will initiate some of the scripts
$(window).scroll();
});
// Allow user to cancel scroll animation by manually scrolling
function enableScrollAbortion() {
var $viewport = $('html, body');
$viewport.on('scroll mousedown DOMMouseScroll mousewheel keyup', function(e) {
if ( e.which > 0 || e.type === 'mousedown' || e.type === 'mousewheel') {
$viewport.stop();
}
My jekyll sight had been running fine for a while until I add a blog post, which works perfectly locally, but then I get an error via email from GitHub saying
SCSS file Desktop/my-blog/css/style.scss has an error on line 1: File to import not found or unreadable: ../_sass/bootstrap. Load path: /hoosegow/.bundle/ruby/2.4.0/gems/jekyll-theme-primer-0.4.0/_sass.
I went to report this as an issue on the theme I was using, but I noticed that others were having similar build issues with Jekyll. Here's the link to that thread
Also, here is my style.css file, which seems to be causing the error.
---
---
#import '../_sass/bootstrap';
#import '../_sass/syntax-highlighting';
%oswald { font-family: 'Oswald', sans-serif; }
%roboto { font-family: 'Roboto Condensed', sans-serif; }
body {
#extend %roboto;
font-size: 18px;
line-height: 30px;
padding-top: 51px;
-webkit-font-smoothing: antialiased;
}
p {
margin-bottom: 30px;
}
section, header, footer, main, article, nav, aside { position: relative; }
a {
outline: none !important;
text-decoration: none !important;
transition: all 225ms ease;
color: rgb(19, 100, 214);
&:hover { color: #6165FF; }
}
.btn {
text-transform: uppercase;
font-weight: 400;
#extend %oswald;
}
h1, h2, h3, h4, h5, h6 { #extend %oswald; }
::selection {
background: #086AFF;
color: #fff;
}
nav.navbar {
margin: 0;
a {
text-transform: uppercase;
font-size: 16px;
}
.navbar-brand {
text-transform: none;
i {
transition: inherit;
color: rgb(19, 100, 214);
transform: scale(1);
}
&:hover i {
color: rgb(19, 100, 214);
transform: scale(1.35);
}
}
}
.title-group {
text-align: center;
padding: 0 15px;
margin: 50px 0 100px;
p {
max-width: 800px;
margin: 25px auto 0;
}
}
h1.special {
position: relative;
text-align: center;
overflow: hidden;
margin: 4;
text-transform: uppercase;
#extend %oswald;
font-size: 69px;
line-height: 69px;
font-weight: 700;
color: rgb(19, 100, 214);
span {
display: inline-block;
position: relative;
padding: 0 15px;
max-width: 1000px;
&:before, &:after {
content: '';
position: absolute;
display: block;
height: 1px;
background: #e8e8e8;
width: 99999999px;
top: 50%;
transform: translateY(-50%);
}
&:before { left: 100%; }
&:after { right: 100%; }
}
}
.tile {
position: relative;
box-shadow: 0 0.15em 0.35em 0 rgba(0, 0, 0, 0.135);
margin-bottom: 125px;
.inner-guts { padding: 50px; }
h2 {
margin: 0;
font-size: 100px;
font-weight: 400;
letter-spacing: -0.05em;
line-height: 100px;
}
.featurette {
position: relative;
display: block;
overflow: hidden;
margin-bottom: 15px;
width: 100%;
height: 550px;
background-color: #e8e8e8;
.img {
background-size: cover;
background-position: 50% 0;
background-repeat: no-repeat;
position: absolute;
display: block;
top: 0;
left: 0;
width: 100%;
height: 100%;
transition: all 225ms ease;
transform: scale(1);
&:before {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: block;
content: '';
background: #000;
opacity: 0.4;
transition: all 225ms ease;
}
}
iframe {
position: absolute;
display: block;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
&:hover {
.img {
transform: scale(1.2);
&:before {
opacity: 0.2;
}
}
}
}
.excerpt {
font-size: 35px;
font-weight: 300;
line-height: 49px;
color: #484848;
p {
margin: 0;
}
}
.tags {
position: absolute;
left: 0;
top: 100%;
margin-top: 15px;
span {
padding: 1px 5px;
font-size: 12px;
line-height: 1.5;
text-transform: uppercase;
#extend %oswald;
}
}
.read-more {
margin-top: 50px;
width: 100%;
max-width: 175px;
position: relative;
padding-right: 75px;
i {
position: absolute;
right: 15px;
top: 50%;
transform: translateY(-54%);
font-size: 31px;
line-height: 100%;
}
}
}
aside {
font-size: 17px;
color: #525252;
margin: 16px 0;
#extend %oswald;
span {
text-transform: uppercase;
margin: 0 5px;
}
}
.site-footer {
margin-top: 200px;
}
.pagination-wrap {
text-align: center;
}
.topper {
height: 500px;
position: relative;
.img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: block;
background-size: cover;
background-repeat: no-repeat;
background-position: 50%;
}
iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: block;
}
}
pre {
margin: 75px -100px;
}
#media only screen and (max-width : 991px) {
pre {
margin-left: 0;
margin-right: 0;
}
}
#media only screen and (max-width : 480px) {
.tile .featurette, .topper {
height: 300px;
}
h1.special,
.tile h2 {
font-size: 40px;
line-height: 44px;
}
.tile .inner-guts {
padding: 15px 25px;
}
.tile .excerpt {
font-size: 22px;
line-height: 35px;
}
}
Any advice is extremely helpful!
The error is telling you that the file bootstrap.scss can't be imported; either because it isn't in the location specified (the theme /_scss/ directory) or because it isn't called bootstrap.scss. The link you posted seems completely unrelated.
/*general CSS setting for generic devices
this will include all hd devices and above*/
* {
margin: 0;
padding: 0;
}
#watchonly {
display: none;
}
/*animation of the championship logo*/
#champ {
position: absolute;
top: 15%;
right: 20%;
animation-name: champ;
animation-duration: 5s;
animation-timing-function: linear;
animation-delay: 2s;
}
#keyframes champ {
0% {
right: 20%;
top: 15%;
}
25% {
right: 22%;
top: 16%;
}
50% {
right: 20%;
top: 17%;
}
75% {
right: 19%;
top: 16%;
}
100% {
right: 20%;
top: 15%;
transform: rotateY(360deg);
}
}
/*navigation controls*/
nav ul li {
display: inline;
}
nav ul li a, nav ul li a:visited {
color: #006734;
display: block;
float: left;
font-size: 1.25em;
font-weight: bold;
margin: 5px 2px;
padding: 7px 10px 4px;
text-shadow: 0 1px 1px white;
text-transform: uppercase;
}
nav ul li a:hover {
text-decoration: none;
background-color: #009340;
}
nav, main, nav ul li a, .twitter-timeline {
border-radius: 30px;
}
nav {
background: #6fad60;
padding: 0 5px;
position: absolute;
right: 0;
top: 4px;
border: 1px solid #0e1f0c;
box-shadow: 0 1px 1px #0e1f0c;
}
/*switching off the watch only text*/
#watchonly {
display: none;
}
.clear:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
body {
font-size: 15px;
color: #f8f8f8;
background-color: #bcbcbc;
font-family: Arial, Helvetica, sans-serif;
}
/*the default font*/
h1, h2, h3 {
font-family: "Myriad Pro", "Helvetica Neue", Helvetica, Arial, Sans-Serif;
color: #00923f;
text-shadow: 0 1px 1px black;
}
h1 {
font-size: 35px;
padding: 3px;
text-transform: uppercase;
}
h3 {
font-family: forte, "Myriad Pro", "Helvetica Neue", Helvetica, Arial, Sans-Serif;
font-size: 30px;
font-weight: normal;
margin: 2px;
}
img {
width: auto;
height: 100%;
}
p {
line-height: 120%;
padding-bottom: 2px;
}
main .line {
background-color: #15242a;
border-bottom-color: #204656;
margin: 3px;
}
.line {
height: 1px;
background-color: #24404c;
border-bottom: 1px solid #416371;
margin: 2px;
overflow: hidden;
}
footer .line {
margin: 2px;
}
/*Main page size*/
#page {
width: 900px;
margin: 0 auto;
position: relative;
}
main {
background-color: #006634;
margin: 2px;
padding: 20px;
text-shadow: 0 2px 0 #001f10;
margin-top: 20px;
}
footer {
color: #000000;
margin-bottom: 30px;
text-align: center;
font-size: 10px;
}
footer a, footer a:visited {
color: #6fad60;
background-color: #006634;
padding: 2px 4px;
}
footer a:hover {
text-decoration: none;
background-color: #000000;
}
footer a.up {
float: right;
}
/*control of the twitter frame*/
.twitter-timeline {
border: 3px solid #00943f;
float: right;
margin-left: 15px;
overflow: hidden;
}
#twitter-widget-0 {
height: 500px !important;
min-height: 500px !important;
}
a, a:visited {
color: #ffffff;
text-decoration: none;
outline: none;
}
a:hover {
color: black;
text-decoration: underline;
}
a img {
border: none;
}
iframe {
width: 100%;
height: 600px;
}
/*turning off the image and allowing the iframe to show*/
#whensmall {
display: none;
}
/*control of the form*/
form {
padding: 20px;
}
textarea {
height: 300px;
width: 275px;
}
input {
padding-left: 90px;
}
/*control of map iframe*/
.map {
width: 300px;
height: 350px;
}
/*a very simple default for future use on limited screens
ie watches or screens under 300px square*/
#media only screen and (max-width: 300px) {
* {
margin: 0;
padding: 0;
}
/*Main page size*/
#page {
width: 290px;
margin: 0 auto;
position: relative;
}
/*switching off most of the page contect*/
#watchonly {
font-style: oblique;
display: flex;
color: black;
text-shadow: 0 1px 1px white;
}
footer, nav, h1, h2, h3, p, #main, .line, #champ {
display: none;
}
img {
float: left;
float: right;
padding-top: 60px;
max-width: 280px;
max-height: 200px;
}
}
/*Control of elements for small phone screens over 300 wide and below 500px
This has been left to action of the use in portrait also*/
#media only screen and (min-width: 301px) and (max-width: 500px) {
/*switching off the iframe, large champions image and the watch only text*/
#whenbig {
display: none;
}
#whensmall {
display: none;
}
#watchonly {
display: none;
}
/*animation of the championship logo*/
#champ {
position: absolute;
top: 0%;
right: 0%;
height: 55px;
animation-duration: 5s;
animation-name: champ1;
animation-timing-function: ease-in-out;
animation-delay: 2s;
transform: rotateY(360deg);
}
#keyframes champ1 {
0% {
right: 0%;
top: 0%;
}
25% {
right: 2%;
top: 2%;
}
50% {
right: 4%;
top: 1%;
transform: rotateY(160deg);
}
75% {
right: 2%;
top: 2%;
}
100% {
right: 0%;
top: 0%;
}
}
ul {
padding: 0%;
text-align: center;
display: inline;
}
nav ul li a, nav ul li a:visited {
color: #006734;
font-size: 12px;
font-weight: bold;
margin: 0px 0px;
padding: 10px 5px 10px;
text-shadow: 0 1px 1px white;
text-transform: uppercase;
}
/*change of the navigation*/
nav ul li {
display: inline;
}
nav {
position: relative;
}
/*Main page size*/
#page {
width: 295px;
margin: 0 auto;
position: relative;
}
/*map size change*/
.map {
width: 260px;
}
/*switching the twitter so as to leave only a link*/
#twitter-widget-0 {
height: 45px !important;
min-height: 5px !important;
}
.twitter-timeline {
border: 3px solid #00943f;
height: 300px;
overflow: hidden;
width: 200px;
}
/*edit of the font sizes*/
h1 {
font-size: 18px;
text-transform: uppercase;
}
h3 {
font-size: 20px;
font-weight: normal;
margin: 2px;
}
/*edit to control a smaller form*/
form {
padding: 30px;
}
textarea {
height: 300px;
width: 185px;
}
input {
padding-left: 0px;
}
}
/*Control of elements for larger phone screens/small tablets over 500 wide and below 700px
This has been left to action of the use in portrait also*/
#media only screen and (min-width: 501px) and (max-width: 700px) {
/*switching off the iframe, switching on the large champions
image and off the watch only text*/
#whenbig {
display: none;
}
#whensmall {
display: inline;
}
#watchonly {
display: none;
}
/*edit of the font sizes*/
h1 {
font-size: 30px;
text-transform: uppercase;
}
h3 {
font-size: 26px;
}
/*Main page size*/
#page {
width: 490px;
margin: 0 auto;
position: relative;
}
/*change of the navigation*/
nav ul li {
display: block;
}
/*animation of the championship logo*/
#champ {
position: fixed;
top: 36%;
right: 0%;
height: 75px;
animation-name: Champ2;
animation-duration: 5s;
animation-timing-function: linear;
animation-delay: 2s;
}
#keyframes Champ2 {
0% {
right: 00%;
top: 36%;
}
5% {
right: 05%;
top: 29%;
}
10% {
right: 10%;
top: 20%;
}
15% {
right: 15%;
top: 13%;
}
20% {
right: 20%;
top: 07%;
}
25% {
right: 25%;
top: 05%;
}
30% {
right: 30%;
top: 07%;
}
35% {
right: 35%;
top: 13%;
}
40% {
right: 40%;
top: 20%;
}
45% {
right: 45%;
top: 29%;
}
50% {
right: 50%;
top: 36%;
transform: rotateY(360deg);
}
55% {
right: 45%;
top: 43%;
}
60% {
right: 40%;
top: 52%;
}
65% {
right: 35%;
top: 59%;
}
70% {
right: 30%;
top: 65%;
}
75% {
right: 25%;
top: 66%;
}
80% {
right: 20%;
top: 65%;
}
85% {
right: 15%;
top: 59%;
}
90% {
right: 10%;
top: 52%;
}
95% {
right: 05%;
top: 43%;
}
100% {
right: 00%;
top: 36%;
}
}
/*control of the twitter frame size*/
#twitter-widget-0 {
width: 100px !important;
height: 600px !important;
}
/*control of the map iframe size*/
.map {
width: 250px;
height: 300px;
padding-bottom: 40px;
}
/*edit to control a smaller form*/
form {
padding: 20px;
}
textarea {
height: 300px;
width: 185px;
}
input {
padding-left: 0px;
}
}
/*Control of elements for large phone screens/sd tablets over 700 wide and below 900px
This has been left to action of the use in portrait also*/
#media only screen and (min-width: 701px) and (max-width: 900px) {
/*switching off the iframe, switching on the large champions
image and off the watch only text*/
#whenbig {
display: none;
}
#whensmall {
display: inline;
padding: 100px;
}
#watchonly {
display: none;
}
/*Font size control*/
h1 {
font-size: 44px;
text-transform: uppercase;
padding: 0px 0px 0px;
}
h3 {
font-size: 38px;
}
/*Main page size*/
#page {
width: 700px;
margin: 0 auto;
position: relative;
}
/*edit of the navigation bar*/
nav ul li {
display: block;
}
/*Animation of the championship logo*/
#champ {
position: absolute;
top: 10px;
right: 30vw;
animation-name: champ3;
animation-duration: 5s;
animation-timing-function: linear;
animation-delay: 2s;
}
#keyframes champ3 {
0% {
right: 30vw;
top: 10px;
}
10% {
right: 25vw;
top: 25px;
}
18% {
right: 25vw;
top: 40px;
}
24% {
right: 30vw;
top: 55px;
}
32% {
right: 35vw;
top: 70px;
}
40% {
right: 35vw;
top: 85px;
}
48% {
right: 30vw;
top: 100px;
transform: rotateY(360deg);
}
56% {
right: 25vw;
top: 85px;
}
64% {
right: 25vw;
top: 70px;
}
72% {
right: 30vw;
top: 55px;
}
80% {
right: 35vw;
top: 40px;
}
90% {
right: 35vw;
top: 25px;
}
100% {
right: 30vw;
top: 10px;
}
}
/*twitter frame size*/
#twitter-widget-0 {
width: 300px !important;
min-height: 5px !important;
}
/*map iframe size*/
.map {
width: 300px;
height: 300px;
padding-bottom: 40px;
}
/*form size controls*/
form {
padding: 50px;
}
textarea {
height: 300px;
width: 245px;
}
input {
padding-left: 60px;
}
}
I have been trying to validate my website via the w3c validator.
the html5 passes yet the CSS will not.
I receive parse errors (x6) at keyframes.
I have tried various french bracket arrangments as it would appear that the differing ones get picked up incorrectly
I have included my CSS
any help is much appreciated
This is my first attempt at html and css
/*general CSS setting for generic devices
this will include all hd devices and above*/
* {
margin: 0;
padding: 0;
}
#watchonly {
display: none;
}
/*animation of the championship logo*/
#champ {
position: absolute;
top: 15%;
right: 20%;
animation-name: champ;
animation-duration: 5s;
animation-timing-function: linear;
animation-delay: 2s;
}
#keyframes champ {
0% {
right: 20%;
top: 15%;
}
25% {
right: 22%;
top: 16%;
}
50% {
right: 20%;
top: 17%;
}
75% {
right: 19%;
top: 16%;
}
100% {
right: 20%;
top: 15%;
transform: rotateY(360deg);
}
}
/*navigation controls*/
nav ul li {
display: inline;
}
nav ul li a, nav ul li a:visited {
color: #006734;
display: block;
float: left;
font-size: 1.25em;
font-weight: bold;
margin: 5px 2px;
padding: 7px 10px 4px;
text-shadow: 0 1px 1px white;
text-transform: uppercase;
}
nav ul li a:hover {
text-decoration: none;
background-color: #009340;
}
nav, main, nav ul li a, .twitter-timeline {
border-radius: 30px;
}
nav {
background: #6fad60;
padding: 0 5px;
position: absolute;
right: 0;
top: 4px;
border: 1px solid #0e1f0c;
box-shadow: 0 1px 1px #0e1f0c;
}
/*switching off the watch only text*/
#watchonly {
display: none;
}
.clear:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
body {
font-size: 15px;
color: #f8f8f8;
background-color: #bcbcbc;
font-family: Arial, Helvetica, sans-serif;
}
/*the default font*/
h1, h2, h3 {
font-family: "Myriad Pro", "Helvetica Neue", Helvetica, Arial, Sans-Serif;
color: #00923f;
text-shadow: 0 1px 1px black;
}
h1 {
font-size: 35px;
padding: 3px;
text-transform: uppercase;
}
h3 {
font-family: forte, "Myriad Pro", "Helvetica Neue", Helvetica, Arial, Sans-Serif;
font-size: 30px;
font-weight: normal;
margin: 2px;
}
img {
width: auto;
height: 100%;
}
p {
line-height: 120%;
padding-bottom: 2px;
}
main .line {
background-color: #15242a;
border-bottom-color: #204656;
margin: 3px;
}
.line {
height: 1px;
background-color: #24404c;
border-bottom: 1px solid #416371;
margin: 2px;
overflow: hidden;
}
footer .line {
margin: 2px;
}
/*Main page size*/
#page {
width: 900px;
margin: 0 auto;
position: relative;
}
main {
background-color: #006634;
margin: 2px;
padding: 20px;
text-shadow: 0 2px 0 #001f10;
margin-top: 20px;
}
footer {
color: #000000;
margin-bottom: 30px;
text-align: center;
font-size: 10px;
}
footer a, footer a:visited {
color: #6fad60;
background-color: #006634;
padding: 2px 4px;
}
footer a:hover {
text-decoration: none;
background-color: #000000;
}
footer a.up {
float: right;
}
/*control of the twitter frame*/
.twitter-timeline {
border: 3px solid #00943f;
float: right;
margin-left: 15px;
overflow: hidden;
}
#twitter-widget-0 {
height: 500px !important;
min-height: 500px !important;
}
a, a:visited {
color: #ffffff;
text-decoration: none;
outline: none;
}
a:hover {
color: black;
text-decoration: underline;
}
a img {
border: none;
}
iframe {
width: 100%;
height: 600px;
}
/*turning off the image and allowing the iframe to show*/
#whensmall {
display: none;
}
/*control of the form*/
form {
padding: 20px;
}
textarea {
height: 300px;
width: 275px;
}
input {
padding-left: 90px;
}
/*control of map iframe*/
.map {
width: 300px;
height: 350px;
}
/*a very simple default for future use on limited screens
ie watches or screens under 300px square*/
#media only screen and (max-width: 300px) {
* {
margin: 0;
padding: 0;
}
/*Main page size*/
#page {
width: 290px;
margin: 0 auto;
position: relative;
}
/*switching off most of the page contect*/
#watchonly {
font-style: oblique;
display: flex;
color: black;
text-shadow: 0 1px 1px white;
}
footer, nav, h1, h2, h3, p, #main, .line, #champ {
display: none;
}
img {
float: left;
float: right;
padding-top: 60px;
max-width: 280px;
max-height: 200px;
}
}
/*Control of elements for small phone screens over 300 wide and below 500px
This has been left to action of the use in portrait also*/
#media only screen and (min-width: 301px) and (max-width: 500px) {
/*switching off the iframe, large champions image and the watch only text*/
#whenbig {
display: none;
}
#whensmall {
display: none;
}
#watchonly {
display: none;
}
/*animation of the championship logo*/
#champ {
position: absolute;
top: 0%;
right: 0%;
height: 55px;
animation-duration: 5s;
animation-name: champ1;
animation-timing-function: ease-in-out;
animation-delay: 2s;
transform: rotateY(360deg);
}
#keyframes champ1 {
0% {
right: 0%;
top: 0%;
}
25% {
right: 2%;
top: 2%;
}
50% {
right: 4%;
top: 1%;
transform: rotateY(160deg);
}
75% {
right: 2%;
top: 2%;
}
100% {
right: 0%;
top: 0%;
}
}
ul {
padding: 0%;
text-align: center;
display: inline;
}
nav ul li a, nav ul li a:visited {
color: #006734;
font-size: 12px;
font-weight: bold;
margin: 0px 0px;
padding: 10px 5px 10px;
text-shadow: 0 1px 1px white;
text-transform: uppercase;
}
/*change of the navigation*/
nav ul li {
display: inline;
}
nav {
position: relative;
}
/*Main page size*/
#page {
width: 295px;
margin: 0 auto;
position: relative;
}
/*map size change*/
.map {
width: 260px;
}
/*switching the twitter so as to leave only a link*/
#twitter-widget-0 {
height: 45px !important;
min-height: 5px !important;
}
.twitter-timeline {
border: 3px solid #00943f;
height: 300px;
overflow: hidden;
width: 200px;
}
/*edit of the font sizes*/
h1 {
font-size: 18px;
text-transform: uppercase;
}
h3 {
font-size: 20px;
font-weight: normal;
margin: 2px;
}
/*edit to control a smaller form*/
form {
padding: 30px;
}
textarea {
height: 300px;
width: 185px;
}
input {
padding-left: 0px;
}
}
/*Control of elements for larger phone screens/small tablets over 500 wide and below 700px
This has been left to action of the use in portrait also*/
#media only screen and (min-width: 501px) and (max-width: 700px) {
/*switching off the iframe, switching on the large champions
image and off the watch only text*/
#whenbig {
display: none;
}
#whensmall {
display: inline;
}
#watchonly {
display: none;
}
/*edit of the font sizes*/
h1 {
font-size: 30px;
text-transform: uppercase;
}
h3 {
font-size: 26px;
}
/*Main page size*/
#page {
width: 490px;
margin: 0 auto;
position: relative;
}
/*change of the navigation*/
nav ul li {
display: block;
}
/*animation of the championship logo*/
#champ {
position: fixed;
top: 36%;
right: 0%;
height: 75px;
animation-name: Champ2;
animation-duration: 5s;
animation-timing-function: linear;
animation-delay: 2s;
}
#keyframes Champ2 {
0% {
right: 00%;
top: 36%;
}
5% {
right: 05%;
top: 29%;
}
10% {
right: 10%;
top: 20%;
}
15% {
right: 15%;
top: 13%;
}
20% {
right: 20%;
top: 07%;
}
25% {
right: 25%;
top: 05%;
}
30% {
right: 30%;
top: 07%;
}
35% {
right: 35%;
top: 13%;
}
40% {
right: 40%;
top: 20%;
}
45% {
right: 45%;
top: 29%;
}
50% {
right: 50%;
top: 36%;
transform: rotateY(360deg);
}
55% {
right: 45%;
top: 43%;
}
60% {
right: 40%;
top: 52%;
}
65% {
right: 35%;
top: 59%;
}
70% {
right: 30%;
top: 65%;
}
75% {
right: 25%;
top: 66%;
}
80% {
right: 20%;
top: 65%;
}
85% {
right: 15%;
top: 59%;
}
90% {
right: 10%;
top: 52%;
}
95% {
right: 05%;
top: 43%;
}
100% {
right: 00%;
top: 36%;
}
}
/*control of the twitter frame size*/
#twitter-widget-0 {
width: 100px !important;
height: 600px !important;
}
/*control of the map iframe size*/
.map {
width: 250px;
height: 300px;
padding-bottom: 40px;
}
/*edit to control a smaller form*/
form {
padding: 20px;
}
textarea {
height: 300px;
width: 185px;
}
input {
padding-left: 0px;
}
}
/*Control of elements for large phone screens/sd tablets over 700 wide and below 900px
This has been left to action of the use in portrait also*/
#media only screen and (min-width: 701px) and (max-width: 900px) {
/*switching off the iframe, switching on the large champions
image and off the watch only text*/
#whenbig {
display: none;
}
#whensmall {
display: inline;
padding: 100px;
}
#watchonly {
display: none;
}
/*Font size control*/
h1 {
font-size: 44px;
text-transform: uppercase;
padding: 0px 0px 0px;
}
h3 {
font-size: 38px;
}
/*Main page size*/
#page {
width: 700px;
margin: 0 auto;
position: relative;
}
/*edit of the navigation bar*/
nav ul li {
display: block;
}
/*Animation of the championship logo*/
#champ {
position: absolute;
top: 10px;
right: 30vw;
animation-name: champ3;
animation-duration: 5s;
animation-timing-function: linear;
animation-delay: 2s;
}
#keyframes champ3 {
0% {
right: 30vw;
top: 10px;
}
10% {
right: 25vw;
top: 25px;
}
18% {
right: 25vw;
top: 40px;
}
24% {
right: 30vw;
top: 55px;
}
32% {
right: 35vw;
top: 70px;
}
40% {
right: 35vw;
top: 85px;
}
48% {
right: 30vw;
top: 100px;
transform: rotateY(360deg);
}
56% {
right: 25vw;
top: 85px;
}
64% {
right: 25vw;
top: 70px;
}
72% {
right: 30vw;
top: 55px;
}
80% {
right: 35vw;
top: 40px;
}
90% {
right: 35vw;
top: 25px;
}
100% {
right: 30vw;
top: 10px;
}
}
/*twitter frame size*/
#twitter-widget-0 {
width: 300px !important;
min-height: 5px !important;
}
/*map iframe size*/
.map {
width: 300px;
height: 300px;
padding-bottom: 40px;
}
/*form size controls*/
form {
padding: 50px;
}
textarea {
height: 300px;
width: 245px;
}
input {
padding-left: 60px;
}
}
Update
According to https://www.w3.org/TR/CSS2/media.html#at-media-rule at-rules (#...) are invalid inside the #media rules (like the #keyframes rules).
So you might have to define the animations outside of the media queries and just assign them to the elements in the media query.
If you put your css in an editor that can auto-indent it you will see the problems
#media only screen and (min-width: 301px) and (max-width: 500px) {
/*switching off the iframe, large champions image and the watch only text*/
#whenbig {
display: none;
}
#whensmall {
display: none;
}
#watchonly {
display: none;
}
/*animation of the championship logo*/
#champ {
position: absolute;
#keyframes champ1 {
25% {
right: 2%;
top: 2%;
}
50% {
right: 4%;
top: 1%;
75% {
right: 2%;
top: 2%;
}
100% {
right: 0%;
top: 0%;
}
}
ul {
padding: 0%;
nav ul li a,
nav ul li a:visited {
color: #006734;
/*change of the navigation*/
nav ul li {
display: inline;
}
nav {
position: relative;
}
/*Main page size*/
#page {
width: 295px;
/*map size change*/
.map {
width: 260px;
}
/*switching the twitter so as to leave only a link*/
#twitter-widget-0 {
height: 45px !important;
.twitter-timeline {
border: 3px solid #00943f;
/*edit of the font sizes*/
h1 {
As you can see the code is missing some } and thus wrong nesting is happening.
Your #keyframe cannot been inside your block #champ it must been like this:
`
div {
width: 100px;
height: 100px;
background: red;
position :relative;
-webkit-animation: mymove 5s infinite; /* Safari 4.0 - 8.0 */
animation: mymove 5s infinite;
}
/* Safari 4.0 - 8.0 */
#-webkit-keyframes mymove {
0% {top: 0px;}
25% {top: 200px;}
75% {top: 50px}
100% {top: 100px;}
}
/* Standard syntax */
#keyframes mymove {
0% {top: 0px;}
25% {top: 200px;}
75% {top: 50px}
100% {top: 100px;}
}
<!DOCTYPE html>
<html>
<head>
<style>
</style>
</head>
<body>
<p><strong>Note:</strong> The #keyframes rule is not supported in Internet Explorer 9 and earlier versions.</p>
<div></div>
</body>
</html>
`
See. mymove is variable and it's located at the top level as varialbe
These validators are not end-all be-all authorities on valid html and css. If it works, and the browser doesn't throw any errors then you're fine.