Unexpected space between spans - css

I built this button with transform and transition. But there is a tiny problem that I can't figure it out. I have for span to scale them when I want to hover the link. Each span have 25% of a link width. but there is a tiny space between span number 3 and 4.
codepen link
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-family: sans-serif;
}
a {
font-size: 25px;
font-weight: 700;
display: block;
text-decoration: none;
border: 3px solid rgb(84, 7, 136);
color: rgb(84, 7, 136);
padding: 50px 80px;
position: relative;
overflow: hidden;
}
h2 {
text-align: center;
}
body > div {
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.effect11 a span {
position: absolute;
top: 0;
left: 0;
width: 25%;
height: 100%;
background-color: black;
transform: scaleY(0);
transform-origin: top;
transition: all 1s;
z-index: -1;
}
.effect11 a {
transition: all 1s;
}
.effect11 a span:nth-child(1) {
left: 0;
transition-delay: 0.15s;
}
.effect11 a span:nth-child(2) {
left: 25%;
transition-delay: 0.3s;
}
.effect11 a span:nth-child(3) {
left: 50%;
transition-delay: 0.45s;
}
.effect11 a span:nth-child(4) {
left: 75%;
transition-delay: 0.6s;
}
.effect11 a:hover span {
transform: scaleY(1);
}
.effect11 a:hover {
color: white;
}
This is what happening that I don't want to appear (that little space)

Here add flex:1 and It should solve the problem
body > div {
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
flex:1;
}

Related

Fade one element out while fade in background element on hover

I want to fade out a text placed on an image on hover and fade in another from the background.
So far the fade out part is working, but the fade in part not. See "run code snippet".
I want fade out the first text completely but not fully cover the background image which is why the opacity of:
location-wrapper { background-color: rgba(0, 0, 0, 0.6);}
is set to 0.6 and:
.location-wrapper:hover {
background-color: rgb(255, 255, 255);
opacity: 0.7;
}
set to 0.7.
If I set the opacity of the background text to 1, I can see the background text is there, but the transition on hover to blend it in is not working. I guess because the div is in the background and the hover of the first div is triggered and not the hover option of the background?
.location-container {
position: relative;
height: 200px;
width: 100%;
color: white;
}
.location-bg-image {
position: absolute !important;
width: 100%;
height: 100%;
background-color: transparent;
z-index: -1;
}
.location-wrapper {
background-color: rgba(0, 0, 0, 0.6);
text-align: center;
position: absolute;
width: 100%;
height: 100%;
z-index: 10;
opacity: 1;
transition: 2s;
}
.location-wrapper:hover {
background-color: rgb(255, 255, 255);
opacity: 0.7;
}
.location-overlay {
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.location-city {
padding-bottom: 60px;
color: white;
font-size: 25px;
font-weight: 400;
}
.location-text-wrapper {
height: 100%;
padding-top: 40px;
width: 100%;
opacity: 1;
transition: 5s;
display: flex;
flex-direction: column;
-ms-flex-align: center;
align-items: center;
justify-content: center;
}
.location-text-wrapper:hover {
opacity: 1;
}
.location-text {
color: white;
font-size: 18px;
opacity: 0;
transition: 5s
}
.location-text:hover {
opacity: 1;
}
<div class="location-container">
<Image class="location-bg-image" src="https://via.placeholder.com/150/000000/FFFFFF/"/>
<div class="location-wrapper has-bg-image">
<div class="location-overlay">
<div class="location-city">ExampleCity</div>
</div>
</div>
<div class="location-text-wrapper">
<div class="location-text">ExampleBackgroundText</div>
</div>
</div>
You don't need to have a separate .location-text-wrapper. I've changed your HTML a bit in the snippet below. I've inserted .location-text inside .location-overlay, and on .location-wrapper:hover I'm updating the value of opacity for .location-city and .location-text. This will give you the behaviour that you desire.
.location-container {
position: relative;
height: 200px;
width: 100%;
color: white;
}
.location-bg-image {
position: absolute !important;
width: 100%;
height: 100%;
background-color: transparent;
z-index: -1;
}
.location-wrapper {
background-color: rgba(0, 0, 0, 0.6);
text-align: center;
position: absolute;
width: 100%;
height: 100%;
z-index: 10;
opacity: 1;
transition: 2s;
}
.location-wrapper:hover {
background-color: rgb(255, 255, 255);
opacity: 0.7;
}
.location-overlay {
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
opacity: 1
}
.location-city {
padding-bottom: 60px;
color: white;
font-size: 25px;
font-weight: 400;
opacity: 1;
transition: 5s;
}
.location-wrapper:hover .location-city {
opacity: 0;
}
.location-wrapper:hover .location-text {
opacity: 1;
}
.location-text {
color: black;
font-size: 18px;
opacity: 1;
transition: 5s
}
<div class="location-container">
<Image class="location-bg-image" src="https://via.placeholder.com/150/000000/FFFFFF/"/>
<div class="location-wrapper has-bg-image">
<div class="location-overlay">
<div class="location-city">ExampleCity</div>
<div class="location-text">ExampleBackgroundText</div>
</div>
</div>
</div>

z index multiple elements

hey guys I have 3 elements I'm using z-index and position property.
the first one is the main navbar (working fine)
the 2nd is sidenav
the 3rd is a button.
the button must have the position relative.
when I'm scrolling the main navbar is taking over the button which is great !
but the side navbar is not.
I did try to change the z-index on each element.
the mobile navbar is the main navbar which working fine.
.mobile-navbar {
background-color: rgb(0, 0, 0);
position: fixed;
z-index: 1;
width: 100%;
display: flex;
justify-content: space-between;
img {
background-color: rgba(0, 0, 0, 0.274);
}
div {
display: flex;
justify-content: center;
align-items: center;
a {
font-size: 2rem;
color: #fff;
margin: 5px;
text-decoration: none;
span {
background-color: red;
border-radius: 10px;
padding: 0 3px;
}
}
}
}
.side-nav {
position: fixed;
z-index: 0;
width: 100%;
height: 100vh;
transform: translateX(-100%);
transition: 300ms ease-out;
&-active {
position: fixed;
width: 100%;
height: 100vh;
background-color: rgb(12, 6, 39);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
transform: translateX(0);
transition: 300ms ease-out;
button.close-nav {
padding: 5px;
background-color: rgb(14, 12, 12);
color: #fff;
border: none;
font-size: 2rem;
font-weight: 700;
}
.dynamic-links {
height: 30%;
button {
padding: 5px;
font-size: 2rem;
background: rgba(0, 0, 0, 0);
color: #fff;
border: none;
}
.sidenav-link {
color: #fff;
text-decoration: none;
font-size: 2rem;
margin: 0 10px;
}
}
.sidenav-links {
display: flex;
flex-direction: column;
height: 50%;
.sidnav-link {
color: #fff;
margin: 10px 0;
font-size: 2rem;
text-decoration: none;
text-align: center;
}
}
}
}
the button I need to use position relative and taking over the side-navbar:
button {
position: relative;
z-index: 0;
cursor: pointer;
font-size: 1.3rem;
padding: 10px 15px;
border: none;
outline: #06a821;
border-radius: 30px;
color: #fff;
letter-spacing: 0.3rem;
background: linear-gradient(
90deg,
rgba(5, 116, 197, 1) 35%,
rgba(106, 183, 239, 1) 100%
);
transition: ease-in-out 300ms;
&::before {
position: absolute;
border: 1px solid #fff;
left: 5px;
right: 5px;
top: 5px;
bottom: 5px;
border-radius: 30px;
content: "";
}
only had to add the z-index in the active class.
befor :
.side-nav {
position: fixed;
z-index: 0;
width: 100%;
height: 100vh;
transform: translateX(-100%);
transition: 300ms ease-out;
&-active {
position: fixed;
width: 100%;
height: 100vh;
background-color: rgb(12, 6, 39);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
transform: translateX(0);
transition: 300ms ease-out
after:
.side-nav {
position: fixed;
width: 100%;
height: 100vh;
transform: translateX(-100%);
transition: 300ms ease-out;
&-active {
position: fixed;
z-index: 1;
width: 100%;
height: 100vh;
background-color: rgb(12, 6, 39);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
transform: translateX(0);
transition: 300ms ease-out;

Background images not showing on GitHub pages

I know there have been several posts about images not showing up in GitHub Pages, but the solutions don't seem to fix my problem. On my local machine and on Netlify the page works correctly, but on GitHub Pages I'm missing all my images.
All the images give this error:
Failed to load resource: the server responded with a status of 404 ()
This is the link to the Github Page: https://mfagaikema.github.io/BarbershopWebsite/
This is the link to my repo: https://github.com/MFAGaikema/BarbershopWebsite/
What am I missing?
Here is your code and make appropriate changes;
<link rel="stylesheet" href="src/css/style.css">
gives https://mfagaikema.github.io**/BarbershopWebsite/**src/css/style.css
Now css code as following;
linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url(/images/3day-shave-course.jpg)
gives
https://mfagaikema.github.io/images/3day-shave-course.jpg
/BarbershopWebsite/ is missing which is causing the problem
Now add site folder name in css url rule
/BarbershopWebsite/images/3day-shave-course.jpg
console view - I made quick dash in my local console to see what was causing it and this worked as suggested above.
it would work.
UPDATE - Since I am not able to get to github with out creating unnecessary fork here is what you need to change in src/css/style.css file. Just copy paste below code.
* {
padding: 0;
margin: 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
font-family: "Manrope", sans-serif;
}
html,
body {
overflow-x: hidden;
}
/*scrollbar*/
/* width */
::-webkit-scrollbar {
width: 10px;
}
/* Track */
::-webkit-scrollbar-track {
background: #f1f1f1;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: #999;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #555;
}
/*Navigatiemenu top*/
header {
position: relative;
}
header nav {
width: 100vw;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
position: fixed;
z-index: 2;
background-color: rgba(38, 60, 73, 0.9);
}
header ul {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
margin-left: 100px;
}
header ul li {
list-style-type: none;
padding: 0 50px;
-ms-flex-item-align: center;
-ms-grid-row-align: center;
align-self: center;
font-size: 16px;
}
header ul li a {
text-decoration: none;
color: white;
}
header ul li a:hover {
color: chocolate;
}
header ul li #appointment {
padding: 15px 30px;
background-color: saddlebrown;
-webkit-transition: all 0.2s;
transition: all 0.2s;
}
header ul li #appointment:hover {
background-color: chocolate;
color: black;
}
header #logo {
font-size: 50px;
text-decoration: none;
padding: 0px 20px;
margin: 5px;
border: 2px solid white;
color: white;
background-color: #263c49;
font-family: "Economica", sans-serif;
}
/*intro*/
.intro {
background: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0.5))), url(../../images/3day-shave-course.jpg);
background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url(../../images/3day-shave-course.jpg);
background-size: cover;
height: 800px;
text-align: center;
color: white;
text-shadow: 2px 0 0 black, -2px 0 0 black, 0 2px 0 black, 0 -2px 0 black, 1px 1px black, -1px -1px 0 black,
1px -1px 0 black, -1px 1px 0 black;
letter-spacing: 4px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
}
.intro .company-name {
padding: 0 20px;
margin: auto;
border: 5px solid #fff;
-webkit-animation: fade-names 1s linear forwards;
animation: fade-names 1s linear forwards;
-webkit-animation-delay: 0.5s;
animation-delay: 0.5s;
}
.intro h1 {
font-size: 150px;
}
.intro h2 {
margin-top: -20px;
padding-bottom: 20px;
font-size: 50px;
}
.intro h1,
.intro h2 {
font-family: "Economica", sans-serif;
font-weight: 100;
}
#-webkit-keyframes fade-names {
from {
opacity: 0;
-webkit-transform: scale(0.95);
transform: scale(0.95);
}
to {
opacity: 1;
-webkit-transform: scale(1);
transform: scale(1);
}
}
#keyframes fade-names {
from {
opacity: 0;
-webkit-transform: scale(0.95);
transform: scale(0.95);
}
to {
opacity: 1;
-webkit-transform: scale(1);
transform: scale(1);
}
}
/*markup content*/
.content {
margin: 0 300px;
}
.content > div {
padding: 80px 0 10px 0;
}
.content > div > p {
margin-bottom: 20px;
}
.content h2 {
color: #444;
position: relative;
margin-bottom: 20px;
}
.content h2::after {
content: "";
width: 70px;
position: absolute;
left: 0;
bottom: -2px;
border-bottom: #aaa8a8 solid 2px;
}
/*make appointment*/
.make-appointment .shops {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
}
.make-appointment .shops .shop-text {
margin: 5px 0;
}
.make-appointment .shops .emmen-container,
.make-appointment .shops .zwolle-container {
width: 450px;
}
.make-appointment .shops .store-hours {
padding-top: 10px;
}
.make-appointment .shops .hours {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
}
.make-appointment .shops .emmen-btn::after {
background-image: url(../../images/emmen-front.jpg);
}
.make-appointment .shops .zwolle-btn:after {
background-image: url(../../images/Stellar-Bakkes-13.jpg);
}
.make-appointment .shops .emmen-btn,
.make-appointment .shops .zwolle-btn {
height: 310px;
background: #000;
position: relative;
}
.make-appointment .shops .emmen-btn h3,
.make-appointment .shops .zwolle-btn h3 {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
z-index: 1;
color: #fff;
padding: 10px 20px;
background-color: chocolate;
font-weight: 200;
}
.make-appointment .shops .emmen-btn h3:hover,
.make-appointment .shops .zwolle-btn h3:hover {
text-decoration: underline;
}
.make-appointment .shops .emmen-btn::after,
.make-appointment .shops .zwolle-btn::after {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
content: "";
background-size: cover;
background-repeat: no-repeat;
opacity: 0.9;
-webkit-transition: all 0.2s;
transition: all 0.2s;
}
.make-appointment .shops .emmen-btn:hover h3,
.make-appointment .shops .zwolle-btn:hover h3 {
color: #fff;
background-color: saddlebrown;
}
.make-appointment .shops .emmen-btn:hover::after,
.make-appointment .shops .zwolle-btn:hover::after {
opacity: 0.2;
}
/*about*/
.img-container {
display: -ms-grid;
display: grid;
width: 100%;
height: 450px;
gap: 40px;
-ms-grid-columns: 1fr 1fr 1fr;
grid-template-columns: 1fr 1fr 1fr;
-ms-grid-rows: 1fr 1fr;
grid-template-rows: 1fr 1fr;
grid-template-areas: "salon salon materials"
"salon salon blowdry";
}
.img-container div {
background-size: cover;
}
#salon {
-ms-grid-row: 1;
-ms-grid-row-span: 2;
-ms-grid-column: 1;
-ms-grid-column-span: 2;
grid-area: salon;
background-image: url(../../images/emmen-salon.jpg);
}
#materials {
-ms-grid-row: 1;
-ms-grid-column: 3;
grid-area: materials;
background-image: url(../../images/materials-bakkes.jpg);
}
#blowdry {
-ms-grid-row: 2;
-ms-grid-column: 3;
grid-area: blowdry;
background-image: url(../../images/andre-emmen.jpg);
}
.text-container p:first-of-type {
margin-bottom: 10px;
}
/*# sourceMappingURL=style.css.map */
PROBLEM : Relative URL
your images folder is at
https://mfagaikema.github.io/images
while your css file is at
https://mfagaikema.github.io/BarbershopWebsite/src/css
CSS while interpreting URL is making staring slash to compute from root of the domain
i.e.
/images/whatever.jpg
becomes
https://mfagaikema.github.io/images/whatever.jpg
Partial URLs are interpreted relative to the source of the style sheet, not relative to the document.
so I have changed relative path of url starting from where css file is located
i.e. https://mfagaikema.github.io/BarbershopWebsite/src/css
so we need to go two levels up from the location of the css file then from there go to images folder
setp by step illustration
../images/3day-shave-course.jpg
makes computed url to be
https://mfagaikema.github.io/BarbershopWebsite/src/images/3day-shave-course.jpg
../../images/3day-shave-course.jpg
makes computed url to be
https://mfagaikema.github.io/BarbershopWebsite/images/3day-shave-course.jpg
I have made the changes in css just replace it in your style.css file in src folder.
background-image: url(../../images/Stellar-Bakkes-13.jpg);
It will work.

How can I make my page responsive with a scroll instead of having everything go squishy?

I'm trying to make my page automatically go to scroll when the window is at a small height instead of trying to adjust to the height by getting squishy. I've tried different ways of using overflow, but I can't seem to find a way to make it scroll the page as a whole no matter where I put it. The codepen is here: CODEPEN Thank you in advance!
#import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
#import url('https://fonts.googleapis.com/css2?family=Oleo+Script&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
overflow-y: scroll;
}
a {
color: #8524C6;
text-decoration: none;
}
section {
width: 100%;
height: 100vh;
color: #fff;
background: linear-gradient(-45deg, #F5D0E4, #F6D5F2, #EAD5F6, #D9D5F6, #D5E1F6, #D5ECF6);
background-size: 400% 400%;
position: relative;
animation: change 10s ease-in-out infinite;
overflow: hidden;
align-items: center;
justify-content: center;
}
h1 {
display: flex;
align-items: center;
justify-content: center;
color: #000;
font-size: 1.3em;
font-family: 'Oleo Script', cursive, 'Helvetica', sans-serif;
letter-spacing: .07rem;
transform: translateY(15vh);
}
h1 span {
display: flex;
text-align: center;
vertical-align: middle;
}
h1:hover span {
animation: animate .5s infinite;
}
#keyframes animate {
0% {
transform: translateY(0)
}
50% {
transform: translateY(-30px)
}
100% {
transform: translateY(0)
}
}
h1 span:nth-child(1) {
animation-delay: 0s;
}
h1 span:nth-child(2) {
animation-delay: .1s;
}
h1 span:nth-child(3) {
animation-delay: .2s;
}
h2 {
display: flex;
align-items: center;
justify-content: center;
text-align: center;
vertical-align: top;
color: #000;
font-size: .4rem;
font-family: 'Press Start 2P', cursive, serif;
text-transform: uppercase;
transform: translateY(15.5vh)
}
.dancing-hamsters {
display: flex;
position: relative;
margin: auto;
align-content: center;
width: 100%;
height: 1.3rem;
width: 5.1rem;
transform: translateY(18vh);
z-index: 1;
}
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: #d3d3d3;
align-content: center;
position: absolute;
top: 50%;
bottom: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 50%;
height: 50%;
padding: 5px;
padding-right: 3%;
box-shadow: inset 0 0 10px #000;
}
.top-note {
/* display: flex; */
display: none;
font-family: 'Helvetica', sans-serif;
font-size: .65rem;
text-align: center;
justify-content: center;
align-items: center;
color: #000;
transform: translate(4%, -5%);
}
.box {
display: flex;
flex-direction: column;
background-color: #d3d3d3;
text-align: center;
justify-content: center;
align-items: center;
text-align: center;
transform: translateX(50%);
width: 1rem;
height: 1rem;
font-family: 'Press Start 2P', cursive, serif;
font-size: .5rem;
margin: 2rem;
}
img {
display: flex;
width: 85%;
height: 75%;
}
.container img {
cursor: url('https://i.postimg.cc/6338xsj2/oie-nr-M8-Ct-Mr-SPb-H.png'), auto;
}
.box-text {
margin-top: 10%;
cursor: url('https://i.postimg.cc/6338xsj2/oie-nr-M8-Ct-Mr-SPb-H.png'), auto;
}
.nav {
margin: auto;
text-align: center;
transform: translateY(70vh);
font-size: .5rem;
text-transform: uppercase;
line-height: .8rem;
}
.nav a {
color: #000;
font-family: 'Press Start 2P', cursive, serif;
text-shadow: 2px 2px 7px #8524C6;
}
footer {
margin: auto;
width: 100%;
height: 1rem;
font-family: Helvetica, sans-serif;
font-size: .75rem;
background-color: transparent;
border-top: 1px solid #fff;
text-align: center;
padding-top: 1rem;
bottom: 0;
transform: translateY(80vh);
}
#keyframes change {
0% {
background-position: 0 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0 50%;
}
}
/* Media Queries */
#media screen and (min-width: 740px) {
h1 {
font-size: 3em;
transform: translateY(8vh);
word-spacing: 2em;
}
h2 {
font-size: 1rem;
transform: translateY(8vh);
}
.dancing-hamsters {
height: 2rem;
width: 9rem;
transform: translateY(10.5vh);
}
.container {
display: flex;
flex-direction: row;
}
.top-note {
display: none;
}
.box {
width: 15rem;
height: 15rem;
transform: translateX(15%);
font-size: .75rem;
}
.img {
width: 100%;
height: 100%;
}
.nav li {
margin: .5em;
display: inline;
text-align: center;
align-items: center;
justify-content: center;
font-size: .85rem;
}
.nav {
transform: translateY(64vh);
}
footer {
transform: translateY(75vh);
}
}
A quick solution will be to add min-height to the main section element:
section {
width: 100%;
height: 100vh;
min-height: 500px; // I just add 500px for demo
color: #fff;
background: linear-gradient(-45deg, #F5D0E4, #F6D5F2, #EAD5F6, #D9D5F6, #D5E1F6, #D5ECF6);
background-size: 400% 400%;
position: relative;
animation: change 10s ease-in-out infinite;
overflow: hidden;
align-items: center;
justify-content: center;
}
You have specified the height of the section, but with min-height you will guarantee that regardless of the screen height, your content will not get smaller than what you have set.

Fixed Left Menu scrolling not working?

I have made following demo on Codepen. Problem is when the height of viewport is decreased scroll appear which i want but logo is hidden under icon-list which is the unwanted behavior. Everything works properly if viewport height is enough.
<input type="checkbox" id="menu-expander" name="ert">
<div class="main-menu-container">
<div class="logo-area">
<div class="logo"><img src="http://extensiondl.maxthon.com/skinpack/11018970/1375652328/icons/icon_32.png"></div>
</div>
<ul class="sidebar-icon-list">
<li class="sidebar-icon">
<img src="http://www.clipartsfree.net/vector/small/go-home_Clipart_Free.png">
<span>Week</span>
</li>
<li class="sidebar-icon menu-active">
<img src="http://www.clipartsfree.net/vector/small/go-home_Clipart_Free.png">
<span>Projects</span>
</li>
<li class="sidebar-icon" title="Life">
<img src="http://www.clipartsfree.net/vector/small/go-home_Clipart_Free.png">
<span>Life</span>
</li>
<li class="sidebar-icon">
<img src="http://www.clipartsfree.net/vector/small/go-home_Clipart_Free.png">
<span>Analysis</span>
</li>
<li class="sidebar-icon">
<img src="http://www.clipartsfree.net/vector/small/go-home_Clipart_Free.png">
<span>Projects</span>
</li>
</ul>
<div class="sidebar-wt">
<label for="menu-expander"><img src="https://cdn3.iconfinder.com/data/icons/awesome-lineca-vol-1/17/angle-right-128.png"></label>
</div>
<div class="user-area">
<div class="user-pic"></div>
</div>
CSS
input[name="ert"] {
position: absolute;
opacity: 0;
width: 0;
height: 0;
overflow: hidden;
}
/* Main Menu Contaier */
.main-menu-container {
width: 6em;
position: fixed;
top: 0;
left: 0;
height: 100vh;
background-color: hsl(207,6%,12%);
color: #fff;
display: flex;
flex-direction: column;
z-index: 100;
border-right: 1px solid black;
transition: width 0.2s ease-in;
overflow-y: auto;
overflow-x: hidden;
}
input[name="ert"]:checked + .main-menu-container {
width: 12em;
transition: width .3s linear;
}
/* Logo Area */
.logo-area {
height: 6em;
background-color: #fff;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 4em;
width: 4em;
}
.logo img {
height: 4em;
width: 4em;
}
/* Icon List */
.sidebar-icon-list {
display: flex column;
list-style: none;
width: 100%;
padding: 0;
margin: 0;
flex-grow: 1;
}
.sidebar-icon {
color: #eaeaea;
width: 100%;
border-left: 3px solid hsl(207,6%,12%);
height: 3em;
margin: 1em 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
cursor: pointer;
position: relative;
transition: all 0.3s linear;
}
.sidebar-icon:hover {
color: #fff;
border-left: 3px solid #EEFF22;
}
.sidebar-icon img {
color: #fff;
width: 2em;
height: 2em;
}
.sidebar-icon span {
font-size: 0.75em;
opacity: 0;
position: absolute;
transition: all 0.1s linear;
}
input[name="ert"]:checked + .main-menu-container .sidebar-icon-list .sidebar-icon {
flex-direction: row;
justify-content: flex-start;
padding-left: 1em;
transition: all 0.3s linear;
}
input[name="ert"]:checked + .main-menu-container .sidebar-icon-list .sidebar-icon span {
font-size: 0.75em;
opacity: 1;
position: relative;
transition: all 0.3s linear;
margin-left: 1em;
}
.menu-active {
border-left: 3px solid #EEFF22;
color: #EEFF22;
}
/* Sidebar Expander */
.sidebar-wt {
display: flex;
justify-content: flex-end;
}
.sidebar-wt label img {
height: 1.5em;
width: 1.5em;
cursor: pointer;
}
.main-menu-container .sidebar-wt label img {
transition: all 0.3s linear;
}
input[name="ert"]:checked + .main-menu-container .sidebar-wt label img {
transform: rotateZ(180deg);
transition: all 0.3s linear;
}
/* USer Area at Bottom */
.user-area {
height: 4em;
background: #fff;
display: flex;
align-items: center;
justify-content: center;
}
.user-pic {
width: 100%;
height: 5em;
border-bottom: 2px solid #2ca58d;
background-image: url(http://soccer1x2.net/wp-content/uploads/2012/03/leo-messi1.png);
background-size: cover;
}
.main-menu-container .sidebar-wt label img {
transition: all 0.3s linear;
}
input[name="ert"]:checked + .main-menu-container .sidebar-wt label img {
transform: rotateZ(180deg);
transition: all 0.3s linear;
}
It looks like the height of .logo-container is changing, when you decrease the window's height.
If you min-height: 6em; for .logo-area the height will not decrease.

Resources