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]
}
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.
(((THE ISSUE IS IN THE #media PROPERTY)))
so this is my code, I am trying to bring my stats under the main article but no matter how I change the width or height it doesn't affect the container one bit, please can someone tell me where am I doing a mistake or what should I do to make it work. (this might give you the idea of what i am looking for (https://imgur.com/2jTBb7J), also how do i make my images blend mode so that it matches the linked file.
#import url("https://fonts.googleapis.com/css2?family=Inter:wght#400;700&display=swap");
#import url("https://fonts.googleapis.com/css2?family=Lexend+Deca&display=swap");
body {
background-color: hsl(233, 47%, 7%);
height: 100%;
}
.container {
display: flex;
justify-content: center;
align-items: center;
}
.card {
width: 300px;
height: 800px;
background-color: hsl(244, 38%, 16%);
border-radius: 10px;
margin: 70px 30px;
box-shadow: 0 0 10px black;
}
.image_container {
width: 300px;
height: auto;
}
.image {
width: 100%;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
mix-blend-mode: soft-light;
}
.text-container {
align-self: center;
text-align: center;
}
h1,
article {
font-family: "Inter", sans-serif;
padding: 0px 15px;
}
h1 {
padding-top: 10px;
color: white;
font-weight: 700;
}
.insights {
color: hsl(277, 64%, 61%);
}
article {
color: hsla(0, 0%, 100%, 0.75);
}
.stats_container {
align-content: center;
text-align: center;
display: block;
}
.num1 {
color: white;
font-family: "Lexend Deca", sans-serif;
font-weight: 400;
font-size: 35px;
display: block;
padding-top: 25px;
}
.stats_heading {
color: hsla(0, 0%, 100%, 0.6);
font-family: "Lexend Deca", sans-serif;
text-transform: uppercase;
}
#media only screen and (min-width: 1224px) {
.card {
display: flex;
width: 1040px;
height: 450px;
align-self: center;
}
.image_container {
order: 2;
width: 1040px;
height: 450px;
flex-direction: row;
justify-content: flex-end;
align-content: flex-end;
}
.image {
width: 100%;
height: 100%;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
border-top-left-radius: 0px;
}
.text-container {
height: 450px;
border: 1px red solid;
align-self: flex-start;
text-align: flex-start;
}
h1,
article {
text-align: left;
padding-left: 50px;
}
h1 {
padding-top: 40px;
}
article {
padding-top: 5px;
}
.stats_container {
border: 1px yellow solid;
justify-content: flex-start;
text-align: left;
display: inline;
}
.num1 {
color: white;
font-family: "Lexend Deca", sans-serif;
font-weight: 400;
font-size: 22px;
}
.stats_heading {
color: hsla(0, 0%, 100%, 0.6);
font-family: "Lexend Deca", sans-serif;
text-transform: uppercase;
}
}
<DOCTYPE! html>
<html lang="en">
<head>
<link href="firstproject.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
</head>
<body>
<div class="container">
<div class="card">
<div class="image_container">
<img class="image" alt="main.jpg" src="image-header-desktop.jpg">
</div>
<div class="text-container">
<h1>Get <span class="insights">insights</span> that help your buisness grow</h1>
<article>Discover the benfits of data analyitcs and make better decision regarding revenue, customer experience, and overall efficiency.</article>
</div>
<div class="stats_container">
<section class="stats">
<div class="companies"><span class="num1">10k+</span>
<span class="stats_heading">companies</span></div>
<div class="templates"><span class="num1">314</span>
<span class="stats_heading">Templates</span></div>
<div class="queries"><span class="num1">12M+</span>
<span class="stats_heading">queries</span></div>
</section>
</div>
</div>
</div>
</body>
</html>
I hope this is what you trying to achieve. I made some changes in answer, which I were submitted before.
#import url("https://fonts.googleapis.com/css2?family=Inter:wght#400;700&display=swap");
#import url("https://fonts.googleapis.com/css2?family=Lexend+Deca&display=swap");
body {
background-color: hsl(233, 47%, 7%);
height: 100%;
}
.container {
display: flex;
justify-content: center;
align-items: center;
}
.card {
width: 300px;
height: 800px;
background-color: hsl(244, 38%, 16%);
border-radius: 10px;
margin: 70px 30px;
box-shadow: 0 0 10px black;
}
.image_container {
width: 300px;
height: auto;
}
.image {
width: 100%;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
mix-blend-mode: soft-light;
}
.text-container {
align-self: center;
text-align: center;
}
h1,
article {
font-family: "Inter", sans-serif;
padding: 0px 15px;
}
h1 {
padding-top: 10px;
color: white;
font-weight: 700;
}
.insights {
color: hsl(277, 64%, 61%);
}
article {
color: hsla(0, 0%, 100%, 0.75);
}
.stats_container {
align-content: center;
text-align: center;
display: block;
}
.num1 {
color: white;
font-family: "Lexend Deca", sans-serif;
font-weight: 400;
font-size: 35px;
display: block;
padding-top: 25px;
}
.stats_heading {
color: hsla(0, 0%, 100%, 0.6);
font-family: "Lexend Deca", sans-serif;
text-transform: uppercase;
}
#media only screen and (min-width: 1224px) {
.card {
display:flex;
width: 1040px;
height: 450px;
align-self: center;
}
.image_container {
order:2;
border: 1px red solid;
width: 1040px;
height: 450px;
flex-direction: row;
justify-content: flex-end;
align-content: flex-end;
}
.stats{
display:flex;
justify-content:center;
}
.image {
width: 100%;
height: 100%;
mix-blend-mode: soft-light;
}
}
<div class="container">
<div class="card">
<div class="image_container">
<img class="image" alt="main.jpg" src="https://images.indianexpress.com/2020/08/Fujifilm-FB.jpg">
</div>
<div class="text-wrapper">
<div class="text-container">
<h1>Get <span class="insights">insights</span> that help your buisness grow</h1>
<article>Discover the benfits of data analyitcs and make better decision regarding revenue, customer experience, and overall efficiency.</article>
</div>
<div class="stats_container">
<section class="stats">
<div class="companies"><span class="num1">10k+</span>
<span class="stats_heading">companies</span></div>
<div class="templates"><span class="num1">314</span>
<span class="stats_heading">Templates</span></div>
<div class="queries"><span class="num1">12M+</span>
<span class="stats_heading">queries</span></div>
</section>
</div>
</div>
</div>
</div>
Firstly, change your HTML to this
<DOCTYPE! html>
<html lang="en">
<head>
<link href="firstproject.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
</head>
<body>
<div class="container">
<div class="card">
<div class="image_container">
<img class="image" alt="main.jpg" src="https://pbs.twimg.com/profile_images/1406950250158333952/fjMy7l0K_400x400.jpg">
</div>
<div class="text">
<div class="text-container">
<h1>Get <span class="insights">insights</span> that help your buisness grow</h1>
<article>Discover the benfits of data analyitcs and make better decision regarding revenue, customer experience, and overall efficiency.</article>
</div>
<div class="stats_container">
<section class="stats">
<div class="stat-info">
<div class="companies"><span class="num1">10k+</span>
<span class="stats_heading">companies</span></div>
</div>
<div class="stat-info">
<div class="templates"><span class="num1">314</span>
<span class="stats_heading">Templates</span></div>
</div>
<div class="stat-info">
<div class="queries"><span class="num1">12M+</span>
<span class="stats_heading">queries</span></div>
</div>
</section>
</div>
</div>
</div>
</div>
</body>
</html>
Now change your CSS to this:
#import url("https://fonts.googleapis.com/css2?family=Inter:wght#400;700&display=swap");
#import url("https://fonts.googleapis.com/css2?family=Lexend+Deca&display=swap");
body {
background-color: hsl(233, 47%, 7%);
height: 100%;
}
.container {
display: flex;
justify-content: center;
align-items: center;
}
.card {
width: 300px;
height: 800px;
background-color: hsl(244, 38%, 16%);
border-radius: 10px;
margin: 70px 30px;
box-shadow: 0 0 10px black;
}
.image_container {
width: 300px;
height: auto;
}
.image {
width: 100%;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
mix-blend-mode: soft-light;
}
.text-container {
align-self: center;
text-align: center;
}
h1,
article {
font-family: "Inter", sans-serif;
padding: 0px 15px;
}
h1 {
padding-top: 10px;
color: white;
font-weight: 700;
}
.insights {
color: hsl(277, 64%, 61%);
}
article {
color: hsla(0, 0%, 100%, 0.75);
}
.stats_container {
align-content: center;
text-align: center;
display: block;
}
.num1 {
color: white;
font-family: "Lexend Deca", sans-serif;
font-weight: 400;
font-size: 35px;
display: block;
padding-top: 25px;
}
.stats_heading {
color: hsla(0, 0%, 100%, 0.6);
font-family: "Lexend Deca", sans-serif;
text-transform: uppercase;
}
#media only screen and (min-width: 1224px) {
.card {
display: flex;
width: 1040px;
height: 450px;
align-self: center;
}
.image_container {
order: 2;
width: 1040px;
height: 450px;
flex-direction: row;
justify-content: flex-end;
align-content: flex-end;
}
.image {
width: 100%;
height: 100%;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
border-top-left-radius: 0px;
}
.text {
display: flex;
flex-direction: column;
}
.text div {
flex: 1;
}
.text-container {
/* height: 450px; */
/* border: 1px red solid; */
align-self: flex-start;
text-align: flex-start;
}
h1,
article {
text-align: left;
padding-left: 50px;
}
h1 {
padding-top: 40px;
}
article {
padding-top: 5px;
}
.stats_container {
/* border: 1px yellow solid; */
justify-content: flex-start;
text-align: left;
display: flex;
}
.stats {
display: flex;
padding-left: 30px;
}
.stat-info {
margin: 20px;
}
.num1 {
color: white;
font-family: "Lexend Deca", sans-serif;
font-weight: 400;
font-size: 22px;
}
.stats_heading {
color: hsla(0, 0%, 100%, 0.6);
font-family: "Lexend Deca", sans-serif;
text-transform: uppercase;
}
}
#import url("https://fonts.googleapis.com/css2?family=Inter:wght#400;700&display=swap");
#import url("https://fonts.googleapis.com/css2?family=Lexend+Deca&display=swap");
body {
background-color: hsl(233, 47%, 7%);
height: 100%;
}
.container {
display: flex;
justify-content: center;
align-items: center;
}
.card {
width: 300px;
height: 800px;
background-color: hsl(244, 38%, 16%);
border-radius: 10px;
margin: 70px 30px;
box-shadow: 0 0 10px black;
}
.image_container {
width: 300px;
height: auto;
}
.image {
width: 100%;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
mix-blend-mode: soft-light;
}
.text-container {
align-self: center;
text-align: center;
}
h1,
article {
font-family: "Inter", sans-serif;
padding: 0px 15px;
}
h1 {
padding-top: 10px;
color: white;
font-weight: 700;
}
.insights {
color: hsl(277, 64%, 61%);
}
article {
color: hsla(0, 0%, 100%, 0.75);
}
.stats{
align-content: center;
text-align: center;
display: flex;
flex-direction: column;
}
.num1 {
color: white;
font-family: "Lexend Deca", sans-serif;
font-weight: 400;
font-size: 35px;
display: block;
padding-top: 25px;
}
.stats_heading {
color: hsla(0, 0%, 100%, 0.6);
font-family: "Lexend Deca", sans-serif;
text-transform: uppercase;
}
#media only screen and (min-width: 800px) {
.card {
display: flex;
width: 80vw;
height: 450px;
align-self: center;
}
.image_container {
order: 2;
width: 1040px;
height: 450px;
flex-direction: row;
justify-content: flex-end;
align-content: flex-end;
}
.image {
width: 100%;
height: 100%;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
border-top-left-radius: 0px;
}
.text-container {
/* height: 450px; */
border: 1px red solid;
align-self: flex-start;
text-align: flex-start;
}
h1,
article {
text-align: left;
padding-left: 50px;
}
h1 {
padding-top: 40px;
}
article {
padding-top: 5px;
}
.stats {
border: 1px yellow solid;
justify-content: space-around;
text-align: center;
flex-direction: row;
}
.num1 {
color: white;
font-family: "Lexend Deca", sans-serif;
font-weight: 400;
font-size: 22px;
}
.stats_heading {
color: hsla(0, 0%, 100%, 0.6);
font-family: "Lexend Deca", sans-serif;
text-transform: uppercase;
}
}
<div class="container">
<div class="card">
<div class="image_container">
<img class="image" alt="main.jpg" src="image-header-desktop.jpg">
</div>
<div class="wrapper">
<div class="text-container">
<h1>Get <span class="insights">insights</span> that help your buisness grow</h1>
<article>Discover the benfits of data analyitcs and make better decision regarding revenue, customer experience, and overall efficiency.</article>
</div>
<div class="stats_container">
<section class="stats">
<div class="companies"><span class="num1">10k+</span>
<span class="stats_heading">companies</span>
</div>
<div class="templates"><span class="num1">314</span>
<span class="stats_heading">Templates</span>
</div>
<div class="queries"><span class="num1">12M+</span>
<span class="stats_heading">queries</span>
</div>
</section>
</div>
</div>
</div>
</div>
Made some changes to the existing HTML and CSS. You needed a wrapper element. Please modify the CSS as needed.
Putted your text and stats in a single container and applied :
.side-container {
display: flex;
flex-flow: column
}
So that they inner containers(stats & text) can be shown in columns using
flex-flow: column
Also applied some additional flexy to .stats like below :
.stats {
justify-content: space-around;
display: flex;
flex-flow: row;
}
This is for stats to be in row and have space around them
You can use CSS according to need . I used here some only for demo purpose
#import url("https://fonts.googleapis.com/css2?family=Inter:wght#400;700&display=swap");
#import url("https://fonts.googleapis.com/css2?family=Lexend+Deca&display=swap");
body {
background-color: hsl(233, 47%, 7%);
height: 100%;
}
.container {
display: flex;
justify-content: center;
align-items: center;
}
.card {
width: 300px;
height: 800px;
background-color: hsl(244, 38%, 16%);
border-radius: 10px;
margin: 70px 30px;
box-shadow: 0 0 10px black;
}
.image_container {
width: 300px;
height: auto;
}
.image {
width: 100%;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
mix-blend-mode: soft-light;
}
.text-container {
align-self: center;
text-align: center;
}
h1,
article {
font-family: "Inter", sans-serif;
padding: 0px 15px;
}
h1 {
padding-top: 10px;
color: white;
font-weight: 700;
}
.insights {
color: hsl(277, 64%, 61%);
}
article {
color: hsla(0, 0%, 100%, 0.75);
}
.stats_container {
align-content: center;
text-align: center;
display: block;
}
.num1 {
color: white;
font-family: "Lexend Deca", sans-serif;
font-weight: 400;
font-size: 35px;
display: block;
padding-top: 25px;
}
.stats_heading {
color: hsla(0, 0%, 100%, 0.6);
font-family: "Lexend Deca", sans-serif;
text-transform: uppercase;
}
#media only screen and (min-width: 1224px) {
.card {
display: flex;
width: 1040px;
height: 450px;
align-self: center;
}
.image_container {
order: 2;
width: 1040px;
height: 450px;
flex-direction: row;
justify-content: flex-end;
align-content: flex-end;
}
.image {
width: 100%;
height: 100%;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
border-top-left-radius: 0px;
}
.text-container {
height: 450px;
border: 1px red solid;
align-self: flex-start;
text-align: flex-start;
}
h1,
article {
text-align: left;
padding-left: 50px;
}
h1 {
padding-top: 40px;
}
article {
padding-top: 5px;
}
.stats_container {
border: 1px yellow solid;
justify-content: flex-start;
text-align: left;
display: inline;
}
.num1 {
color: white;
font-family: "Lexend Deca", sans-serif;
font-weight: 400;
font-size: 22px;
}
.stats_heading {
color: hsla(0, 0%, 100%, 0.6);
font-family: "Lexend Deca", sans-serif;
text-transform: uppercase;
}
.side-container {
display: flex;
flex-flow: column
}
.stats {
justify-content: space-around;
display: flex;
flex-flow: row;
}
}
<DOCTYPE! html>
<html lang="en">
<head>
<link href="firstproject.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
</head>
<body>
<div class="container">
<div class="card">
<div class="image_container">
<img class="image" alt="main.jpg" src="https://jooinn.com/images/dramatic-landscape-7.jpg">
</div>
<div class="side-container">
<div class="text-container">
<h1>Get <span class="insights">insights</span> that help your buisness grow</h1>
<article>Discover the benfits of data analyitcs and make better decision regarding revenue, customer experience, and overall efficiency.</article>
</div>
<div class="stats_container">
<section class="stats">
<div class="companies"><span class="num1">10k+</span>
<span class="stats_heading">companies</span></div>
<div class="templates"><span class="num1">314</span>
<span class="stats_heading">Templates</span></div>
<div class="queries"><span class="num1">12M+</span>
<span class="stats_heading">queries</span></div>
</section>
</div>
</div>
</div>
</div>
</body>
</html>
I have the following component in my application
.call-support {
display: flex;
justify-content: center;
padding: 20px 0 20px 0;
}
.container-support {
display: flex;
align-items: center;
}
.support-text {
text-align: center;
margin-left: 10px;
}
.title-text {
font-family: "RalewayRegular";
font-weight: bold;
font-size: 16px;
}
.subtitle-text {
font-family: "RalewayRegular";
font-weight: normal;
font-size: 16px;
}
.customer-service-request {
display: flex;
flex-direction: column;
align-items: center;
padding: 10% 0 20% 0;
}
.request-text {
display: flex;
}
.number {
font-size: 18px;
color: #D53865;
font-weight: bold;
background-color: #f9f4f1;
width: 340px;
height: 130px;
position: relative;
display: flex;
justify-content: center;
align-items: center;
}
.number:before {
content: "";
position: absolute;
top: 0;
right: 0;
border-top: 65px solid #666B74;
border-left: 65px solid #f9f4f1;
width: 0;
border-bottom: 65px solid #666B74;
}
.subtitle-number {
position: absolute;
font-family: "RalewayRegular";
font-weight: normal;
font-size: 12px;
display: flex;
margin-top: 40px;
}
.number-request {
font-family: "RalewayRegular";
color: #fff;
font-size: 18px;
font-weight: bold;
background-color: #666B74;
height: 40px;
width: 340px;
height: 130px;
display: flex;
justify-content: center;
align-items: center;
}
<div class="call-support">
<div class="container-support">
<div class="request-text">
<p class="number">000 000 000<span class="subtitle-number">(local call)</span></p>
<p class="number-request">Customer Service</p>
</div>
</div>
</div>
It is well laid out with this css in all browsers, except in Internet Explorer where the margin top of "subtitle-number" shows it almost stuck to the margin-bottom of the box it belongs to.
Here I leave a link to a codepen with the design.
https://codepen.io/CharlieJS/pen/dyXyBBe
and an image of how it looks in Internet Explorer
How can I adjust the design to display in all browsers?
Why is the margin-bottom higher in IE?
thank you all for your time and help
This is created by display: flex; in class .subtitle-number. So just remove it and it will work fine.
Try to set this class wit top & left like:
.subtitle-number {
position: absolute;
font-family: "RalewayRegular";
font-weight: normal;
font-size: 12px;
/*display: flex;
margin-top: 40px;*/
top:70%;
left:50%;
transform: translate(-50%, 30%);
}
As position absolute is better set with top, right, bottom, left. It seems to work fine by me on w3schools on IE11.
DEMO
.call-support {
display: flex;
justify-content: center;
padding: 20px 0 20px 0;
}
.container-support {
display: flex;
align-items: center;
}
.support-text {
text-align: center;
margin-left: 10px;
}
.title-text {
font-family: "RalewayRegular";
font-weight: bold;
font-size: 16px;
}
.subtitle-text {
font-family: "RalewayRegular";
font-weight: normal;
font-size: 16px;
}
.customer-service-request {
display: flex;
flex-direction: column;
align-items: center;
padding: 10% 0 20% 0;
}
.request-text {
display: flex;
}
.number {
font-size: 18px;
color: #D53865;
font-weight: bold;
background-color: #f9f4f1;
width: 340px;
height: 130px;
position: relative;
display: flex;
justify-content: center;
align-items: center;
}
.number:before {
content: "";
position: absolute;
top: 0;
right: 0;
border-top: 65px solid #666B74;
border-left: 65px solid #f9f4f1;
width: 0;
border-bottom: 65px solid #666B74;
}
.subtitle-number {
position: absolute;
font-family: "RalewayRegular";
font-weight: normal;
font-size: 12px;
/*display: flex;
margin-top: 40px;*/
top:70%;
left:50%;
transform: translate(-50%, 30%);
}
.number-request {
font-family: "RalewayRegular";
color: #fff;
font-size: 18px;
font-weight: bold;
background-color: #666B74;
height: 40px;
width: 340px;
height: 130px;
display: flex;
justify-content: center;
align-items: center;
}
<div class="call-support">
<div class="container-support">
<div class="request-text">
<p class="number">000 000 000<span class="subtitle-number">(local call)</span></p>
<p class="number-request">Customer Service</p>
</div>
</div>
</div>
The absolute property is set in this style but the coordinate value is not set. Because of the different calculation methods such as element position parameters in different browsers, the results are not the same in different browsers.
At this time, it is not necessary to use relative positioning, but to have a certain coordinate. Please modify the .subtitle-number style as following:
.subtitle-number {
position: absolute;
font-family: "RalewayRegular";
font-weight: normal;
font-size: 12px;
top: 80px;
left: 145px;
}
Result in IE:
I have an issue with a flexbox not filling up all the way to my navbar, I cannot for the life of me figure it out and a negative margin does absolutely nothing
Here's a screenshot
.hero {
background-image: url("https://unsplash.it/1500?random");
background-size: cover;
background-position: center;
width: 100%;
height: 100%;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
margin-top: -10px;
}
.hero>.center-content {
width: 400px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
margin: auto;
}
.hero>.center-content h1,
.center-content h3 {
color: white;
line-height: 1;
}
.hero>.center-content h1 {
text-transform: uppercase;
font-size: 3em;
margin-bottom: 0;
text-align: center;
}
.hero>.center-content h3 {
margin-bottom: 40px;
font-size: 1.5em;
font-weight: normal;
}
.center-content>.button {
text-transform: uppercase;
color: white;
padding: 20px;
border: 1px solid white;
text-decoration: none;
}
.center-content>.button:hover {
background-color: rgba(255, 255, 255, 0.3);
border-color: rgba(255, 255, 255, 0.7);
color: #006594;
}
<div class="container" id="heroImage">
<div class="hero">
<div class="center-content">
<h1>Lazris</h1>
<h3>Revive Your Web Presence</h3>
Some Action Here
</div>
</div>
</div>
Remove the margin top on your active menu
.nav > .active {
/** margin-top: 10px; Remove **/
}