Could you please check and advise why my scroll button doesn't work as expected?
It's my first project, so I believe there may be some mistakes, but have no idea why my scrolling "crashes".
I was expecting it to be only a pink one and have the smooth scroll option on the whole page, but it breaks into two lines. Unfortunately, I can't post the image, but basically, this "second" line is like the line in the standard browser and behind that line, I have my pink one.
{
font-family: 'Poppings', sans-serif;
margin: 0;
padding: 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
outline: none;
border: none;
text-decoration: none;
text-transform: capitalize;
-webkit-transition: all .2s linear;
transition: all .2s linear;
}
html {
font-size: 62.5%;
overflow-x: hidden;
scroll-behavior: smooth;
scroll-padding-top: 9rem;
}
html::-webkit-scrollbar {
width: 0.5rem;
}
html::-webkit-scrollbar-thumb {
background: #d9296f;
}
body {
padding: 0;
margin: 0;
background: #08122f;
overflow-x: hidden;
}
section {
padding: 3rem 9%;
}
.heading{
text-align: center;
margin-bottom: 2rem;
}
.heading span{
color: #d9296f;
font-size: 2rem;
}
.heading h1{
font-size: 4rem;
color: #8f7fa2;
}
.btn {
margin-top: 1rem;
display: inline-block;
padding: 1rem 3rem;
font-size: 1.7rem;
color: #d9296f;
border: 0.2rem solid #d9296f;
border-radius: 5rem;
cursor: pointer;
background: none;
}
.btn:hover {
background: #d9296f;
color: #08122f;
}
/*---header---*/
.header{
position: fixed;
top:0;
left: 0;
right: 0;
z-index: 1100;
background: #08122f;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-boxpack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
padding: 1.5rem 9%;
box-shadow: 0 1px 6px 0 rgba(193, 193, 212, 0.28);
}
.header .navbar a{
font-size: 2rem;
color: #8f7fa2;
display: inline-block;
margin: 0 1rem;
}
.header .navbar a:hover{
color: #d9296f;
}
.logo{
font-size: 2.5rem;
color: #8f7fa2;
font-weight: bolder;
}
.logo span{
color: #d9296f;
}
#menu-btn{
font-size: 2.5rem;
color:#8f7fa2;
cursor: pointer;
display: none;
}
/*--home---*/
.home{
margin: auto;
margin-top: auto;
width: 80%;
display: -webkit-box;
display: -ms-webkit-box;
display: flex;
min-height: 80vh;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
padding-bottom: 5rem;
}
.home .content{
text-align: center;
}
.home .content span{
margin-top: 100px;
font-weight: bolder;
color: transparent;
-webkit-text-stroke: 0.1rem #8f7fa2;
font-size: 4vw;
display: block;
}
.home .content h3{
font-size: 6vw;
color: #8f7fa2;
}
.home .content p{
max-width: 60rem;
margin: 1rem auto;
font-size: 1.4rem;
color: #8f7fa2;
margin-top: 18px;
line-height: 2;
letter-spacing: 1px;
}
/*--about--*/
.about{
display: -webkit-box;
-display: -ms-flexbox;
display: flex;
-webkit-boxalign: center;
-ms-flex-align: center;
align-items: center;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
gap: 4rem;
margin-top: 5rem;
}
.about .img-container{
-webkit-box-flex: 1;
-ms-flex: 1 1 42rem;
flex: 1 1 42rem;
width: 50%;
}
.about .img-container img{
border-radius: 1rem;
width: 40%;
}
.about .content{
-webkit-box-flex: 1;
-ms-flex: 1 1 42rem;
flex: 1 1 42rem;
margin-bottom: 10rem;
}
.about .content span{
color: #d9296f;
font-size: 2rem;
}
.about .content h3{
color: #8f7fa2;
font-size: 4rem;
margin-top: .5rem;
}
.about .content p{
padding: 1rem 0;
font-size: 1.4rem;
color: #8f7fa2;
line-height: 2;
}
/*--Services--*/
.services .box-container{
display: -ms-grid;
display: grid;
-ms-grid-column: (minmax(25rem, 1fr)) [auto-fit];
grid-column: (minmax(25rem, 1fr)) [auto-fit];
grid-template-columns: repeat(auto-fit, minmax(32rem, 1fr));
gap: 1.5rem;
}
.services .box-container .box{
background: #08122f;
border-radius: 1rem;
padding: 1rem;
text-align: center;
box-shadow: #8f7fa2;
}
.services .box-container .box:hover{
transform: scale(1.05);
background: #8f7fa2;
}
.services .box-container .box i{
font-size: 4rem;
color: #d9296f;
margin-bottom: 3scrolrem;
}
.services .box-container .box h3{
font-size: 2rem;
color: #d9296f;[enter image description here][1]
}
Related
As the title suggests I got an insanely weird error code which barely describes the error itself (shown below)
error message I got
I can't really pinpoint to the culprit, but I suspect it has something to do with the webpack or imports in my CSS code. I tried reverting back to before I had this error but it still appeared.
Searching for answers I found none as no one seems to have this specific problem.
http://localhost:8000/commons.css
#import url(https://fonts.googleapis.com/css2?family=Karantina:wght#700&display=swap);
#import url(https://fonts.googleapis.com/css2?family=Heebo:wght#400;800&display=swap);
#import url(https://fonts.googleapis.com/css2?family=M+PLUS+1p:wght#600&display=swap);
#import url(https://fonts.googleapis.com/css2?family=Karantina:wght#700&display=swap);
#import url(https://fonts.googleapis.com/css2?family=Heebo:wght#400;800&display=swap);
#import url(https://fonts.googleapis.com/css2?family=Miriam+Libre:wght#700&display=swap);
html{
margin: 0;
padding: 0;
background-color: whitesmoke;
}
body{
margin: 0;
padding: 0;
}
input{
font-size: 1rem;
}
.hide{
display: none;
}
.layout-module--heading--8VjLO{
display: flex;
justify-content: space-between;
align-items: center;
padding: 2rem 5%;
margin-bottom: 5rem;
background-color: #2F4F4F;
border-bottom: 5px solid #C4F0C4;
border-radius: 0px 0px 15px 15px;
}
.layout-module--menubtn--xDRG0{
border: 0;
padding: 0;
}
.layout-module--menu--P1Nbr{
display: none;
}
.layout-module--menudropdown--81ZJJ{
display: none;
position: absolute;
font-family: 'Karantina', cursive;
font-weight: 700;
text-decoration: none;
color: #D4F0AA;
font-size: 32px;
min-width: 160px;
z-index: 1;
}
.layout-module--menuimg--MXGBY{
display: block!important;
background-color: #2F4F4F;
height: 50px;
width: 50px;
padding: 0;
border: 0;
}
.layout-module--mainlogo--JD3jr{
width: 12.5rem;
height: 12.5rem;
}
#media only screen and (max-width: 992px) {
.layout-module--mainlogo--JD3jr{
display: none!important;
}
.layout-module--menu--P1Nbr{
display: block;
}
.layout-module--heading--8VjLO ul{
display: none;
}
.layout-module--menu--P1Nbr:hover > .layout-module--menudropdown--81ZJJ{
background-color: blue;
}
}
.layout-module--heading--8VjLO ul{
list-style: none;
}
.layout-module--heading--8VjLO ul li{
display: inline-block;
padding: 0 .8rem;
}
.layout-module--navlink--odahv{
font-family: 'Karantina', cursive;
font-weight: 700;
text-decoration: none;
color: #D4F0AA;
font-size: 32px;
}
.layout-module--navlink--odahv::after{
content: "";
background-color: #C4F0C4;
height: 3px;
width: 0%;
display: block;
transition: 0.3s ease-in;
}
.layout-module--navlink--odahv:hover::after, .layout-module--navlink--odahv:active::after{
width: 100%;
}
.index-module--flexcont--E5tVn{
position: relative;
display: flex;
flex-wrap: wrap;
gap: 2em;
margin-left: 10%;
margin-right: 10%;
flex-wrap: wrap;
}
.index-module--flexcont--E5tVn article{
margin: 1em;
flex: 1 1 20rem;
box-shadow: 5px 5px 30px 2px rgba(0,0,0,0.66);
border-bottom: 5px solid #C4F0C4;
border-radius: 0px 0px 25px 25px;
transition-property: all;
transition-duration: 0.3s ;
transition-timing-function: ease;
}
.index-module--under--t50Wv{
width: 100%;
font-size: 1em;
color: black;
text-align: center;
font-family: 'M PLUS 1p', sans-serif;
font-weight: 600;
letter-spacing: 1.5px;
text-overflow: ellipsis;
overflow: hidden;
line-clamp: 2;
-webkit-line-clamp: 2;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.index-module--flexcont--E5tVn article h2{
text-align: center;
margin-top: 12.5px;
margin-bottom: 5px;
font-family: 'Heebo', sans-serif;
font-weight: 800;
padding-left: 10px;
padding-right: 10px;
letter-spacing: 1.5px;
}
.index-module--flexcont--E5tVn article a{
text-decoration: none;
color: black;
}
.index-module--showthumb--jLQ1t{
width: 100%;
height: auto;
}
.index-module--flexcont--E5tVn article:hover, .index-module--flexcont--E5tVn article:active{
cursor: pointer;
-webkit-transform: scale(1.15);
transform: scale(1.15);
/*transform: translate(0, -20px);*/
}
#media only screen and (max-width: 992px){
.index-module--flexcont--E5tVn{
gap: 1em;
margin-left: 5%;
margin-right: 5%;
}
.index-module--flexcont--E5tVn article{
flex: 1 1 10rem;
margin: 0.5rem;
}
.index-module--under--t50Wv{
display: none;
}
/*.under p{
margin: 0.5rem, 0;
}*/
.index-module--flexcont--E5tVn article h2{
min-width: 6ch;
line-break: auto;
}
}
.footer-module--wrapper--iAZv8{
background-color: #2F4F4F;
margin-top: 5rem;
padding: 2rem 5%;
border-top: 5px solid #C4F0C4;
border-radius: 15px 15px 0 0;
display: flex;
justify-content: space-between;
}
.footer-module--wrapper--iAZv8 div{
display: flex;
justify-content: end;
}
.footer-module--wrapper--iAZv8 div p{
font-family: 'Karantina', sans-serif;
font-weight: 700;
font-size: 40px;
color: #D4F0AA;
text-align: right;
}
.footer-module--tglogo--fTM1x{
margin: 1rem;
width: 12.5rem;
height: 12.5rem;
}
.slug-module--title--g3-bA{
font-family: 'Heebo', sans-serif;
font-weight: 800;
font-size: 54px;
text-align: center;
}
.slug-module--label--ZZRK6{
font-family: 'Heebo', sans-serif;
font-weight: 400;
font-size: 36px;
text-align: center;
}
.slug-module--main--4LR6u{
display: flex;
height: 25rem;
justify-content: space-between;
margin: 0 3rem;
}
.slug-module--ads--JOrBO{
display: block;
}
.slug-module--main--4LR6u div{
min-width: 30%;
min-height: 15rem;
}
.slug-module--desc--jV-dL{
font-family: 'Miriam Libre', sans-serif;
font-weight: 700;
text-align: center;
font-size: 2rem;
margin: 5rem;
}
.slug-module--desc--jV-dL li{
list-style: none;
}
#media only screen and (max-width: 992px){
.slug-module--ads--JOrBO{
display: none;
}
.slug-module--main--4LR6u{
justify-content: center;
}
.slug-module--main--4LR6u div{
min-width: 100%;
}
}
I would really appreciate any help with the matter as it is mind-boggling.
Thanks!
I figured it out on my own, I think (Seems to work for now at least). I moved all my imports to HTML after checking they're indeed correct. Deleted all the cookies from the site and restarted the development server. Seems to do the trick for now. Hope this helps anyone cause I struggled with it for a bit there!
I have the following HTML code: https://jsfiddle.net/qdukjf5w/
As you can see it looks pretty good:
Other folks added more things (e.g. header, footer, etc..) and so they included their own css styling which gave the page a beautiful header/footer, but ruined the original HTML body of the page
https://jsfiddle.net/p7o6x5u8/
Is there a way to make the page look like this by limiting the included css styling ONLY to the headers/footers?
css style sheet:
#import url("https://fonts.googleapis.com/css2?family=Montserrat:wght#100;200;300;400;500;600&display=swap");
* {
font-family: 'Montserrat', sans-serif;
margin: 0;
padding: 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
outline: none;
border: none;
text-decoration: none !important;
-webkit-transition: all .2s linear;
transition: all .2s linear;
}
html {
font-size: 62.5%;
overflow-x: hidden;
scroll-behavior: smooth;
scroll-padding-top: 6rem;
}
html::-webkit-scrollbar {
width: 1rem;
}
html::-webkit-scrollbar-track {
background: transparent;
}
html::-webkit-scrollbar-thumb {
background: #512a10;
}
#-webkit-keyframes fadeIn {
0% {
-webkit-transform: translateY(-2rem);
transform: translateY(-2rem);
opacity: 0;
}
}
#keyframes fadeIn {
0% {
-webkit-transform: translateY(-2rem);
transform: translateY(-2rem);
opacity: 0;
}
}
section {
padding: 5rem 1rem;
}
.link-btn {
margin-top: 1rem;
padding: 1rem 3rem;
display: inline-block;
border: 0.1rem solid #512a10;
color: #512a10;
background: none;
cursor: pointer;
font-size: 1.7rem;
}
.link-btn:hover {
background: #512a10;
color: #fff;
}
.demopara {
line-height: 2;
}
.heading {
text-align: center;
margin-bottom: 4rem;
font-size: 3rem;
text-transform: capitalize;
color: #222;
}
.header {
z-index: 1000;
padding: 4rem 0;
}
.header.active {
padding: 2rem 0;
background: #512a10;
}
.header .logo {
font-size: 2.5rem;
color: #fff;
font-weight: bolder;
}
.header .nav a {
font-size: 2rem;
margin-right: 2rem;
color: #fff;
}
.header .nav a:hover {
text-decoration: underline !important;
text-underline-offset: .5rem;
}
.header .icons div {
font-size: 2.5rem;
color: #fff;
margin-left: 2rem;
cursor: pointer;
}
.header #menu-btn {
display: none;
}
.login-form {
position: fixed;
top: 0;
left: 0;
z-index: 1100;
height: 100%;
width: 100%;
background: rgba(0, 0, 0, 0.8);
display: none;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
padding: 2rem;
}
.login-form.active {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
}
.login-form form {
width: 50rem;
padding: 4rem;
background: #fff;
text-align: center;
position: relative;
-webkit-animation: fadeIn .2s linear;
animation: fadeIn .2s linear;
}
.login-form form #close-login-form {
position: absolute;
top: -4rem;
right: 0;
font-size: 3rem;
cursor: pointer;
color: #fff;
}
.login-form form #close-login-form:hover {
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
}
.login-form form .logo {
font-size: 2.5rem;
color: #512a10;
font-weight: bolder;
}
.login-form form h3 {
padding: 1rem 0;
font-size: 2rem;
text-transform: capitalize;
color: #222;
margin-top: 1rem;
}
.login-form form .box {
width: 100%;
padding: 1.2rem 1.4rem;
border: 0.1rem solid #512a10;
font-size: 1.6rem;
margin: 1rem 0;
}
.login-form form .flex {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
gap: .5rem;
margin: 1rem 0;
}
.login-form form .flex label {
font-size: 1.5rem;
line-height: 2;
color: #666;
margin-bottom: 0;
cursor: pointer;
}
.login-form form .flex a {
font-size: 1.5rem;
color: #512a10;
margin-left: auto;
}
.login-form form .flex a:hover {
text-decoration: underline !important;
}
.login-form form .link-btn {
width: 100%;
margin-bottom: 2rem;
}
.login-form form .account {
padding: 1.5rem .5rem;
background: #eee;
font-size: 1.5rem;
line-height: 2;
color: #666;
margin-bottom: 0;
}
.login-form form .account a {
color: #512a10;
}
.login-form form .account a:hover {
text-decoration: underline !important;
}
.home {
background: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.7)), to(rgba(0, 0, 0, 0.7))), url(../images/home-bg.jpg) no-repeat;
background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(../images/home-bg.jpg) no-repeat;
background-size: cover;
background-position: center;
background-attachment: fixed;
}
.home span {
font-size: 2.5rem;
color: #fff;
}
.home h4 {
padding: 1rem 0;
font-size: 6rem;
color: #fff;
}
.home .link-btn {
color: #fff;
border-color: #fff;
}
.about span {
font-size: 2.5rem;
color: #512a10;
}
.about .title {
padding-top: 1rem;
font-size: 3rem;
text-transform: capitalize;
color: #222;
}
.about p {
padding: 1rem 0;
font-size: 1.6rem;
line-height: 2;
color: #666;
margin-bottom: 0;
}
.about .icons-container {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
margin-top: 3rem;
gap: 1.5rem;
}
.about .icons-container .icons {
padding: 2rem;
background: #eee;
text-align: center;
-webkit-box-flex: 1;
-ms-flex: 1 1 14rem;
flex: 1 1 14rem;
}
.about .icons-container .icons i {
font-size: 4rem;
margin-bottom: 1.5rem;
color: #512a10;
}
.about .icons-container .icons h3 {
font-size: 1.5rem;
text-transform: capitalize;
color: #222;
}
.contact .contact-info-container {
display: -ms-grid;
display: grid;
-ms-grid-columns: (minmax(30rem, 1fr))[auto-fit];
grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr));
gap: 2rem;
margin-bottom: 3rem;
}
.contact .contact-info-container .box {
border: 0.1rem solid #512a10;
padding: 3rem 2rem;
border: 0.1rem solid #512a10;
text-align: center;
}
.contact .contact-info-container .box:hover i {
background: #512a10;
color: #fff;
}
.contact .contact-info-container .box i {
height: 6rem;
width: 6rem;
line-height: 6rem;
border: 0.1rem solid #512a10;
color: #512a10;
font-size: 2rem;
margin-bottom: 1rem;
}
.contact .contact-info-container .box h3 {
font-size: 2rem;
text-transform: capitalize;
color: #222;
padding: 1rem 0;
}
.contact .contact-info-container .box p {
font-size: 1.5rem;
line-height: 2;
color: #666;
margin-bottom: 0;
}
.contact form h3 {
font-size: 3rem;
text-transform: capitalize;
color: #222;
padding-bottom: 1rem;
}
.contact form .box {
margin: .7rem 0;
border: 0.1rem solid #512a10;
font-size: 1.6rem;
width: 100%;
padding: 1.2rem 1.4rem;
}
.contact form .box:focus {
background: #512a10;
color: #fff;
}
.contact form .box:focus::-webkit-input-placeholder {
color: #eee;
}
.contact form .box:focus:-ms-input-placeholder {
color: #eee;
}
.contact form .box:focus::-ms-input-placeholder {
color: #eee;
}
.contact form .box:focus::placeholder {
color: #eee;
}
.contact form textarea {
height: 15rem;
resize: none;
}
.footer {
text-align: center;
}
.footer .logo {
font-size: 3rem;
color: #512a10;
font-weight: bolder;
}
.footer .credit {
margin: 2rem 0;
font-size: 2rem;
text-transform: capitalize;
color: #222;
}
.footer .credit span {
text-decoration: underline !important;
}
.footer .share {
margin-top: 3rem;
}
.footer .share a {
height: 5rem;
width: 5rem;
line-height: 5rem;
font-size: 2rem;
border: 0.1rem solid #512a10;
color: #512a10;
margin: 0 .3rem;
}
.footer .share a:hover {
background: #512a10;
color: #fff;
}
#media (max-width: 991px) {
html {
font-size: 55%;
scroll-padding-top: 8rem;
}
.home h3 {
font-size: 4rem;
}
section {
padding: 3rem 0;
}
}
#media (max-width: 768px) {
.login-form form {
padding: 3rem 2rem;
}
.login-form form h3 {
font-size: 1.7rem;
}
.header {
padding: 4rem 2rem;
}
.header.active {
padding: 2rem;
}
.header #menu-btn {
display: inline-block;
}
.header #menu-btn.fa-times {
-webkit-transform: rotate(180deg);
transform: rotate(180deg);
}
.header .nav {
position: absolute;
top: 99%;
left: 0;
right: 0;
background: #fff;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-flow: column;
flex-flow: column;
padding: 1rem 0;
-webkit-clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
}
.header .nav.active {
-webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.header .nav a {
margin: 1rem 2rem;
color: #222;
}
.contact .map {
height: 25rem;
}
}
#media (max-width: 450px) {
html {
font-size: 50%;
}
}
/*# sourceMappingURL=style.css.map */
1- You can use CSS modules which makes all class names and animation names locally scoped by default.
2- You can try to find the conflicting class names and change them so they only apply on the footer/header.
Avoid using generic selectors like element types
div { }
and go for more specific class names and IDs when writing custom CSS.
.form-header-button__red { }
3- You can place one CSS file import after the other so that it's styles are prioritized and can overwrite certain conflicting classes
I am trying to make a list with perfect alignment.
I have entered three items in the list but my list of with grey back ground is not appearing as same alignment as in the below picture.
My box width is changing according to the size of the font. I am providing both image in perfect same alignment and my image with two list item with not same width of grey background.
Below is the my css code:
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
font-size: 22px;
}
body {
min-height: 100vh;
font-family: 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.App {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
width: 100%;
max-width: 500px;
border: 1px solid mediumblue;
margin: auto;
}
header {
width: 100%;
padding: 0 0.25em;
background-color: mediumblue;
color: aliceblue;
display: flex;
justify-content: space-between;
align-items: center;
}
main {
width: 100%;
display: flex;
flex-direction: column;
flex-grow: 1;
justify-content: center;
align-items: center;
overflow-y: auto;
}
footer {
width: 100%;
padding: 0.25em;
background-color: mediumblue;
color: aliceblue;
display: grid;
place-content: center;
}
ul {
width: 100%;
list-style: none;
padding: 0 0.25rem 0.25rem;
}
ul li::before {
content: "\200B";
}
.item {
display: flex;
justify-content: flex-start;
align-items: center;
padding: 0.5rem 0 0.5rem 0.5rem;
margin: 0.25rem 0;
background-color: #eee;
}
.item: first-child {
margin: 0;
}
.item input[type="checkbox"] {
text-align: center;
width: 2.5rem;
width: 48px;
min-width: 48px;
height: 2.5rem;
height: 48px;
min-height: 48px;
cursor: pointer;
margin-right: 0.5rem;
}
.item input[type="checkbox"]:focus + label {
text-decoration: underline;
}
.item > label {
font-size: 0.75rem;
flex-grow: 1;
}
.item svg {
width: 48px;
min-width: 48px;
height: 36px;
font-size: 1rem;
color: steelblue;
cursor: pointer;
}
.item svg:focus,
.item svg:hover {
color: red;
outline: none;
}
Please guide me where I am doing mistake and why my grey background boxes are not same width as the below image.
Helo guys, im getting a weird white space on a border box. I have already try apply the next examples:
.blogPost1 {
grid-column: 1/3;
display: flex;
flex-flow: column;
border-radius: 0.4em;
border: 1px solid #595959;
}
img {
display: block;
padding: 0%;
margin: 0%;
width: 100%;
}
<div class="blogPost1">
<img src="https://via.placeholder.com/150.jpg" alt="">
<h1>Lorem consetetur sadipscing elitr.</h1>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et</p>
</div>
Result:
fully css rules
html{
font-family: 'Poppins', sans-serif;
font-size: 17px;
}
* {
padding: 0;
margin: 0;
}
*, *::before, *::after {
box-sizing: border-box;
}
ul{
list-style: none;
}
body{
margin:0;
}
/* NavBar */
.navbar{
display: flex;
position: absolute;
align-items: center;
justify-content: center;
width: 100%;
flex-wrap: wrap;
color: #595959;
font-weight: 500;
font-size: 0.9em;
}
.firstLogo{
position: relative;
right: 15em;
}
.midleNav1{
position: relative;
display: flex;
align-items: center;
right: 1.6em;
}
.midleNav1 a{
padding: 1em;
text-transform: uppercase;
}
.socialIcons{
position: relative;
left: 15em;
}
.socialIcons a{
padding: 0.1em;
}
/* Hero Section */
.container{
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
min-height: 100vh;
}
.container::before{
content:"";
background-image: url(/images/heroImg.png);
background-size: cover;
position: absolute;
top: 9em;
right: 0px;
bottom: 0px;
left: 0px;
width: 100%;
max-height: 512px;
opacity: 17%;
}
.hero{
position: relative;
display: flex;
flex-wrap: wrap;
/*width: 100%;*/
align-items: center;
justify-content: center;
}
.hero h1{
position: relative;
color: #595959;
width: 13em;
font-size: 2.4em;
left: 1em;
}
.hero h6{
color: #595959;
opacity: 70%;
position: relative;
left: 8.8em;
bottom: 3em;
padding-bottom: 1em;
font-size: 0.7em;
}
.hero button{
position: relative;
font-weight: 600;
right: 2.5em;
padding: 1em 2em;
text-align: center;
background-color: #E76F51;
border: none;
border-radius: 0.3em;
color: white;
font-size: 1em;
box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.479) ;
}
/* GRID SECTION*/
.grid{
position: relative;
bottom: 5em;
display: grid;
grid-template-columns: 50% 50%;
grid-template-rows: 1fr 1fr;
grid-template-areas:
"first second"
"third fourth"
;
}
.first{
display: flex;
flex-wrap: wrap;
grid-area: first;
background-color: #E76F51;
padding: 4em;
align-items: center;
justify-content: center;
}
.first svg{
position: relative;
left: 0.5em;
top: 0.6em;
}
.second{
display: flex;
flex-flow: column;
grid-area: second;
background-color: white;
align-items: center;
justify-content: center;
text-align: center;
color: #595959;
}
.second svg{
width: 5em;
padding-bottom: 1em;
}
.second h1{
padding-bottom: 1em;
font-size: 1.8em;
font-weight: 600;
}
.second h3{
font-size: 1.5em;
width: 18em;
font-weight: 400;
line-height: 1.5em;
}
.third{
display: flex;
flex-flow: column;
grid-area: third;
background-color: white;
align-items: center;
justify-content: center;
text-align: center;
color: #595959;
}
.third svg{
width: 5em;
padding-bottom: 1em;
}
.third h1{
padding-bottom: 1em;
font-size: 1.8em;
font-weight: 600;
}
.third h3{
width: 20em;
font-size: 1.5em;
font-weight: 400;
line-height: 1.5em;
}
.fourth{
display: flex;
flex-wrap: wrap;
grid-area: fourth;
background-color: #2A9D8F;
padding: 4em;
align-items: center;
justify-content: center;
}
.fourth svg{
position: relative;
left: 0.5em;
top: 0.6em;
}
/* Sentence */
.sentence{
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
opacity: 60%;
}
/* BLOG POST */
.blogTitle{
position: relative;
padding-left: 2.5em;
}
.blogBox{
position: relative;
display: grid;
justify-content: center;
grid-template-columns: repeat(4, minmax(12em ,25%));
grid-template-rows: auto;
gap: 1em;
padding: 0 5em 0 5em;
}
.blogPost1{
grid-column: 1/3;
/* display: flex;
flex-flow: column; */
border-radius: 0.4em;
border: 1px solid #595959;
/* outline: 1px solid #595959; */
}
.blogPost2{
/* display: flex;
flex-flow: column; */
border-radius: 0.4em;
border: 1px solid #595959;
}
.blogPost3{
/* display: flex;
flex-flow: column; */
border-radius: 0.4em;
border: 1px solid #595959;
}
.blogPost4{
/* display: flex;
flex-flow: column; */
border-radius: 0.4em;
border: 1px solid #595959;
}
.blogPost5{
/* display: flex;
flex-flow: column; */
border-radius: 0.4em;
border: 1px solid #595959;
}
.blogPost6{
/* display: flex;
flex-flow: column; */
border-radius: 0.4em;
border: 1px solid #595959;
}
.blogPost7{
/* display: flex;
flex-flow: column; */
border-radius: 0.4em;
border: 1px solid #595959;
}
.blogBox h1{
font-size: 1.2rem;
padding: 0.5em;
}
.blogBox p{
font-size: 0.9rem;
padding: 0.5em;
}
img{
margin: 0px;
padding: 0px;
width: 100%;
height: auto;
display: block;
}
the snippet have white space if you did not saw, maybe your lcd have bad resolution.
you could try the css:
box-sizing: border-box;
maybe it has an effect for your case
I'm currently working on a small webpage with a bunch of buttons with links attached to them. The webpage displays perfectly fine on Edge but I'm not sure how to fix it to make it display fine on IE. Currently the buttons and the navbar are way too big and overlapping each other.
.header img {
float: left;
width: 100px;
height: 100px;
}
.header h1 {
position: relative;
top: 18px;
left: 10px;
font-size: 300%;
}
body {
background-color: lightblue;
}
.container {
display: grid;
}
.nav-bar {
display: grid;
grid-template-columns: 16.6% 16.6% 16.6% 16.6% 16.6% 16.6%;
justify-content: space-around;
color: white;
background-color: black;
height: 40px;
align-items: center;
font-size: 20px;
}
.nav-item {
text-align: center;
}
.buttons {
display: grid;
grid-template-columns: 16.6% 16.6% 16.6% 16.6% 16.6% 16.6%;
justify-content: space-around;
}
.button-group {
display: flex;
flex-direction: column;
}
button {
border-radius: 12px;
background-color: gray;
color: white;
border: none;
margin: 5px;
height: 50px;
font-size: 20px;
cursor: pointer;
}
button:hover{
background-color: #4CAF50;
color: white;
}
.generaldocs{
margin-left: 50px;
margin-top: 10px;
}
.technews{
margin-left: 90px;
margin-top: 10px;
}
.nav-item a{
color: white;
text-decoration: none;
}
.header a{
text-decoration: none;
color: black;
}
Try this code, IE and a few old browsers required prefixes to run code correctly.
.header img {
float: left;
width: 100px;
height: 100px;
}
.header h1 {
position: relative;
top: 18px;
left: 10px;
font-size: 300%;
}
body {
background-color: lightblue;
}
.container {
display: grid;
}
.nav-bar {
display: grid;
grid-template-columns: 16.6% 16.6% 16.6% 16.6% 16.6% 16.6%;
-ms-flex-pack: distribute;
justify-content: space-around;
color: white;
background-color: black;
height: 40px;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
font-size: 20px;
}
.nav-item {
text-align: center;
}
.buttons {
display: grid;
grid-template-columns: 16.6% 16.6% 16.6% 16.6% 16.6% 16.6%;
-ms-flex-pack: distribute;
justify-content: space-around;
}
.button-group {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
}
button {
border-radius: 12px;
background-color: gray;
color: white;
border: none;
margin: 5px;
height: 50px;
font-size: 20px;
cursor: pointer;
}
button:hover{
background-color: #4CAF50;
color: white;
}
.generaldocs{
margin-left: 50px;
margin-top: 10px;
}
.technews{
margin-left: 90px;
margin-top: 10px;
}
.nav-item a{
color: white;
text-decoration: none;
}
.header a{
text-decoration: none;
color: black;
}