I'm trying to experiment on my design since i'm still understanding CSS, i can't understand why my image and text didn't align to each other on my navigation bar, this is what it looks like:
This is my code in HTML:
* {
margin: 0px;
padding: 0px;
box-sizing: border-box;
}
.logo {
color: rgb(21, 168, 144);
text-transform: uppercase;
letter-spacing: 10px;
}
.logo img {
width: 50px;
height: 60px;
/* border: 2px solid black; */
margin: 0 0 0 15px;
float: left;
}
nav {
display: flex;
justify-content: space-around;
align-items: center;
min-height: 8vh;
font-family: "Poppins", sans-serif;
background-color: rgb(245, 245, 245);
}
.nav-links {
display: flex;
justify-content: space-around;
width: 30%;
}
.nav-links li {
list-style: none;
padding: 20px 40px;
}
.nav-links a {
color: black;
text-decoration: none;
letter-spacing: 2px;
font-size: 15px;
}
<div class="logo">
<h4>
<img src="./rsc/Logo.png" alt="" /> Deux
</h4>
<!-- <img src="./rsc/DeuxLogo.png" alt="Deux Logo" class="imgLogo" /> -->
</div>
Please find flex implementation.
Add
h4 {
display: flex;
align-items: center;
}
* {
margin: 0px;
padding: 0px;
box-sizing: border-box;
}
.logo {
color: rgb(21, 168, 144);
text-transform: uppercase;
letter-spacing: 10px;
}
.logo img {
width: 50px;
height: 60px;
/* border: 2px solid black; */
margin: 0 0 0 15px;
/* float: left; */
}
h4 {
display: flex;
align-items: center;
}
<div class="logo">
<h4>
<img
src="https://cdn3.iconfinder.com/data/icons/2018-social-media-logotypes/1000/2018_social_media_popular_app_logo_twitter-512.png"
alt="" />
Deux
</h4>
</div>
You can try setting vertical-align:middle to the <img> to align that
* {
margin: 0px;
padding: 0px;
box-sizing: border-box;
}
.logo {
color: rgb(21, 168, 144);
text-transform: uppercase;
letter-spacing: 10px;
}
.logo img {
width: 50px;
height: 60px;
/* border: 2px solid black; */
margin: 0 0 0 15px;
}
nav {
display: flex;
justify-content: space-around;
align-items: center;
min-height: 8vh;
font-family: "Poppins", sans-serif;
background-color: rgb(245, 245, 245);
}
.nav-links {
display: flex;
justify-content: space-around;
width: 30%;
}
.nav-links li {
list-style: none;
padding: 20px 40px;
}
.nav-links a {
color: black;
text-decoration: none;
letter-spacing: 2px;
font-size: 15px;
}
h4 img {vertical-align:middle;}
<div class="logo">
<h4>
<img src="https://media.flaticon.com/dist/min/img/stickers.png">
Deux
</h4>
</div>
Use flex as shown below
* {
margin: 0px;
padding: 0px;
box-sizing: border-box;
}
.logo {
color: rgb(21, 168, 144);
text-transform: uppercase;
letter-spacing: 10px;
display: flex;
flex-direction: row;
align-items: center;
}
.logo img {
width: 50px;
height: 60px;
}
nav {
display: flex;
justify-content: space-around;
align-items: center;
min-height: 8vh;
font-family: "Poppins", sans-serif;
background-color: rgb(245, 245, 245);
}
.nav-links {
display: flex;
justify-content: space-around;
width: 30%;
}
.nav-links li {
list-style: none;
padding: 20px 40px;
}
.nav-links a {
color: black;
text-decoration: none;
letter-spacing: 2px;
font-size: 15px;
}
<div class="logo">
<h4>
Deux
</h4>
<img src="./rsc/Logo.png" alt="" />
</div>
Related
I'm having trouble with getting my image to align next to a div. I have tried adding float right but that doesn't seem to be working. I have also tried playing around with different padding but it's only cause my wrapper div to not properly fully show as if its being cut off by a black box on the side or completely is out of the frame of the website. Also, for some reason, the image isn't showing up at all.
Html:
<body>
<div class="container">
<nav>
<div class="logo">dev simone</div>
<ul class="navItems">
<li>
<b class="nav1">.</b>home
</li>
<li>
<b class="nav1">.</b>projects
</li>
<li>
<b class="nav1">.</b>about-me
</li>
<li>
<b class="nav1">.</b>contact-me
</li>
</ul>
<div class="links">
<a
href="#"
target="_blank"
tabindex="1"
><i class="icono-linkedIn"></i
></a>
</div>
</nav>
<div class="wrapper">
<div class="cols cols0">
<span class="topline">Hello</span>
<h1>I'm a <span class="multiText">coder</span></h1>
<p>
Lorem ipsum.
</p>
<div class="btns">
<button class="textbtns">Resume</button>
<button class="textbtns">GitHub</button>
</div>
</div>
<div class="cols cols1">
<div class="imgbox">
<img src="#" id="splash" />
<img src="images/port-photo.PNG" alt="creator" />
</div>
</div>
</div>
</div>
</body>
</html>
CSS:
#import url("https://fonts.googleapis.com/css2?family=Montserrat:wght#200&family=Zeyada&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Montserrat", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-touch-callout: none;
-webkit-text-size-adjust: none;
-ms-text-size-adjust: none;
text-size-adjust: none;
color: whitesmoke;
font-weight: bolder;
text-decoration: none;
}
html,
body {
height: 100%;
}
body {
overflow: hidden;
width: 100%;
height: 100%;
background-color: black;
}
.logo {
width: 100%;
min-height: 100vh;
display: flex;
font-family: "zeyada" cursive, sans-serif;
}
nav {
display: flex;
width: 100%;
justify-content: space-around;
height: 80px;
z-index: 111;
background-color: rgb(202, 184, 216);
line-height: 80px;
}
.logo {
display: flex;
font-family: "zeyada" cursive;
font-size: 40px;
font-weight: 800;
color: #382f4d;
letter-spacing: 0.2em;
cursor: pointer;
text-transform: uppercase;
white-space: nowrap;
}
b {
font-size: 100px;
font-weight: 800;
color: rgb(255, 54, 171);
}
.navItems {
display: flex;
justify-content: space-around;
align-items: center;
white-space: nowrap;
}
.navItems li {
list-style: none;
margin: 0 0.75em;
display: flex;
justify-content: space-around;
align-items: center;
margin-right: 2em;
font-size: 10px;
}
.navItems li a {
color: rgb(255, 54, 171);
font-size: 25px;
letter-spacing: 0.3em;
}
.navItems li:hover a {
color: #bffcc6;
}
.links a:hover {
color: rgb(255, 54, 171);
}
.links a {
font-size: 30px;
color: rgb(255, 54, 171);
margin: 25px 10px;
}
.wrapper {
display: flex;
width: 100vh;
height: 100vh;
justify-content: center;
align-items: center;
padding: 0 10%;
overflow: hidden;
transform: translateX(150px);
}
.topline {
display: block;
position: relative;
font-size: 35px;
letter-spacing: 5px;
color: white;
}
.topline::after {
position: absolute;
content: "";
height: 4px;
width: 45px;
bottom: 10px;
background-color: rgb(255, 54, 171);
}
h1 {
display: block;
font-size: 5.5em;
font-weight: 900;
font-weight: 800;
color: rgb(255, 54, 171);
white-space: nowrap;
}
.textbtns {
font-size: 25px;
color: rgb(225, 54, 171);
margin: 25px 10px;
text-decoration: none;
box-sizing: border-box;
justify-content: space-between;
align-items: center;
border: none;
background-color: rgb(0, 0, 0);
border-color: rgb(0, 0, 0);
}
.textbtns:hover {
color: rgb(0, 0, 0);
background-color: rgb(255, 54, 171);
cursor: pointer;
}
.multiText {
color: #bffcc6;
text-transform: capitalize;
}
p {
display: block;
width: 90%;
font-size: 1.2em;
color: antiquewhite;
}
.btns {
width: 100vh;
position: relative;
left: 150px;
justify-content: space-between;
}
button {
outline: #382f4d solid;
border-radius: 2;
border: solid 1px;
cursor: pointer;
font-size: 20px;
font-weight: 400;
box-shadow: 0 6px 7px white;
}
.imgbox {
position: relative;
width: 100%;
height: 100%;
float: right;
}
.imgbox img {
position: relative;
height: 100%;
width: calc(130% - 100px);
top: -100px;
right: 50px;
float: right;
}
CodePen
While developing my website I have came across a problem with my footer and form. My footer seems to be appearing through the form on devices but not on the computer and I'm sure this could be issues with widths of devices? So I kept trying to fix it and still haven't been able to fix it. I'm still learning as I go along and I would be grateful if someone could help me get rolling with my website again. code snippets and images below, kindest regards, Caelan.
body {
background-color: black ;
}
/* Announcment bar */
.alert {
padding: 20px;
background-color: #2a7a85;
color: white;
}
.closebtn {
margin-left: 15px;
color: white;
font-weight: bold;
float: right;
font-size: 22px;
line-height: 20px;
cursor: pointer;
transition: 0.3s;
}
.closebtn:hover {
color: black;
}
body {
margin: 0;
}
/* Navigation bar */
ul.topnav {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: rgb(248, 248, 248);
}
ul.topnav li {
float: left;
}
ul.topnav li a {
display: block;
color: black;
text-align: center;
font-weight: bold;
padding: 25px 32px;
text-decoration: none;
}
ul.topnav li a:hover:not(.active) {
background-color: rgb(55, 81, 165);
}
ul.topnav li a.active {
background-color: #0cc0d8;
}
ul.topnav li.right {
float: right;
}
#media screen and (max-width: 600px) {
ul.topnav li.right,
ul.topnav li {
float: none;
}
}
/* On smaller screens, decrease text size */
#media only screen and (max-width: 300px) {
.text {
font-size: 11px;
}
}
/* Homepage button */
.glow-on-hover {
width: 220px;
height: 35px;
border: none;
outline: none;
color: rgb(0, 0, 0);
font-weight: bold;
font-size: 20px;
background: #111;
cursor: pointer;
position: relative;
z-index: 0;
border-radius: 10px;
}
.glow-on-hover:before {
content: '';
background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
position: absolute;
top: -2px;
left:-2px;
background-size: 400%;
z-index: -1;
filter: blur(5px);
width: calc(100% + 4px);
height: calc(100% + 4px);
animation: glowing 20s linear infinite;
opacity: 0;
transition: opacity .3s ease-in-out;
border-radius: 10px;
}
.glow-on-hover:active {
color: #000
}
.glow-on-hover:active:after {
background: transparent;
}
.glow-on-hover:hover:before {
opacity: 1;
}
.glow-on-hover:after {
z-index: -1;
content: '';
position: absolute;
width: 100%;
height: 100%;
background: rgb(11, 78, 223);
left: 0;
top: 0;
border-radius: 10px;
}
#keyframes glowing {
0% { background-position: 0 0; }
50% { background-position: 400% 0; }
100% { background-position: 0 0; }
}
/* kipplo heading on homepage */
h1 {
font-size: 10vw;
margin: 0;
padding: 0;
font-family: 'Courier New', Courier, monospace;
color: blue;
word-wrap: break-word;
text-align: center;
}
/* for the heading and the button alignment*/
.container {
display: flex;
flex-direction: column;
height: 100vh;
}
.btn-centering {
flex-grow: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
/* product cards*/
h3{
text-align: center;
font-size: 30px;
margin: 0;
padding-top: 10px;
}
a{
text-decoration: none;
}
.gallery{
display: flex;
flex-wrap: wrap;
width: 100%;
justify-content: center;
align-items: center;
margin: 50px 0;
}
.content{
width: 24%;
margin: 15px;
box-sizing: border-box;
float: left;
text-align: center;
border-radius:10px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
padding-top: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
transition: .4s;
background-color: whitesmoke;
}
.content:hover{
box-shadow: 0 0 11px rgb(0, 217, 255);
transform: translate(0px, -8px);
transition: .6s;
}
.productcard-image{
width: 200px;
height: 200px;
text-align: center;
margin: 0 auto;
display: block;
}
p{
text-align: center;
color: #b2bec3;
padding: 0 8px;
}
h6{
font-size: 26px;
text-align: center;
color: #222f3e;
margin: 0;
}
.product-card{
list-style-type: none;
display: flex;
justify-content: center;
align-items: center;
padding: 0px;
}
.productcard-list{
padding: 5px;
}
.fa{
color: #ff9f43;
font-size: 26px;
transition: .4s;
}
.fa:hover{
transform: scale(1.3);
transition: .6s;
}
.productcardbutton{
text-align: center;
font-size: 24px;
color: #fff;
width: 100%;
padding: 15px;
border:0px;
outline: none;
cursor: pointer;
margin-top: 5px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
}
.buy-1{
background-color: #2183a2;
}
.buy-2{
background-color: #3b3e6e;
}
.buy-3{
background-color: #0b0b0b;
}
#media(max-width: 1000px){
.content{
width: 46%;
}
}
#media(max-width: 750px){
.content{
width: 100%;
}
}
/* Footer */
.footer__container {
background-color: #141414;
padding: 5rem 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
#footer__logo {
color: #fff;
display: flex;
align-items: center;
cursor: pointer;
text-decoration: none;
font-size: 2rem;
}
.footer__links {
width: 100%;
max-width: 1000px;
display: flex;
justify-content: center;
}
.footer__link--wrapper {
display: flex;
}
.footer__link--items {
display: flex;
flex-direction: column;
align-items: flex-start;
margin: 16px;
text-align: left;
width: 160px;
box-sizing: border-box;
}
.footer__link--items h2 {
margin-bottom: 16px;
}
.footer__link--items > h2 {
color: #fff;
}
.footer__link--items a {
color: #fff;
text-decoration: none;
margin-bottom: 0.5rem;
}
.footer__link--items a:hover {
color: #e9e9e9;
transition: 0.3s ease-out;
}
/* Social Icons */
.social__icon--link {
color: #fff;
font-size: 24px;
}
.social__media {
max-width: 1000px;
width: 100%;
}
.social__media--wrap {
display: flex;
justify-content: space-between;
align-items: center;
width: 90%;
max-width: 1000px;
margin: 40px auto 0 auto;
}
.website__rights {
color: #fff;
}
#media screen and (max-width: 820px) {
.footer__links {
padding-top: 2rem;
}
#footer__logo {
margin-bottom: 2rem;
}
.website__rights {
padding: 2rem;
}
.footer__link--wrapper {
flex-direction: column;
}
.social__media--wrap {
flex-direction: column;
}
}
#media screen and (max-width: 480px) {
.footer__link--items {
margin: 0;
padding: 10px;
width: 100%;
}
}
/* Text above the form*/
/* Feedback form*/
.form1 {
display: flex;
flex-direction: column;
align-items: center;
width: 500px;
margin: 15vh auto;
margin-bottom: -60vh;
border-radius: 15px;
border: none;
box-shadow: 0 0 15px rgb(24, 143, 190);
}
form {
display: flex;
flex-direction: column;
align-items: center;
width: 90%;
}
input {
width: 100%;
margin: 5px 0;
height: 35px;
font-size: 17px;
text-align: center;
outline: none;
border-radius: 15px;
border: none;
background: rgb(235, 228, 228);
}
textarea {
width: 100%;
margin: 5px 0;
font-size: 17px;
text-align: center;
outline: none;
border-radius: 15px;
border: none;
background: rgb(235, 228, 228);
}
input[type=submit]{
margin: 10px auto;
width: 120px;
background: rgb(24, 143, 190);
color: white;
cursor: pointer;
}
input[type=submit]:hover{
background: rgb(19, 41, 238);
}
#media screen and (max-width:600px) {
.form1{
width: 90%;
}
}
h2 {
color: #00ffd5;
font-size: 30px;
}
p4 {
color: #00ffd5;
font-size: 20px;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="img/icon.png" />
<link rel="stylesheet" href="styles.css" />
<title>Contact Us</title>
</head>
<body>
<!-- Alert bar -->
<div class="container">
<div class="alert">
<span
class="closebtn"
onclick="this.parentElement.style.display='none';"
>×</span>
<center>
<strong>DEALS NOW ON!</strong> Upto 30% discounts this
christmas
</center>
</div>
<!-- Navigation bar -->
<ul class="topnav">
<li><img src="img/logo.png" /></li>
<li>Home</li>
<li>Products</li>
<li><a class="active" href="contactus.html">Contact Us</a></li>
<li class="right">About Us</li>
</ul>
<!-- Form -->
<div class="form1">
<h2>Contact Us!</h2>
<p4>Typical Replies Within 24hrs!</p4>
<br>
<form action="">
<input type="email" name="email" id="email" placeholder="Enter your email">
<input type="text" name="name" id="name" placeholder=" Enter your name">
<textarea name="message" id="message" cols="30" rows="10" placeholder="Enter your message here"></textarea>
<input type="submit" value="Send">
</form>
</div>
</div>
<!-- Footer -->
<div class="footer__container">
<div class="footer__links">
<div class="footer__link--wrapper">
<div class="footer__link--items">
About Us
</div>
<div class="footer__link--items">
Contact Us
</div>
</div>
<div class="footer__link--wrapper">
<div class="footer__link--items">
Youtube
</div>
<div class="footer__link--items">
TikTok
</div>
</div>
</div>
<section class="social__media">
<div class="social__media--wrap">
<div class="footer__logo">
<a href="index.html">
<img src="img/logo2.png" id="footer__logo" ></a>
</div>
<p class="website__rights">© KIPPLO.CO.UK PROTOTYPE 2022. All rights reserved</p>
<div class="social__icons">
</div>
</div>
</section>
</div>
</body>
</html>
I've adjusted the css to remove the height and margin on the containers:
body {
background-color: black;
}
/* Announcment bar */
.alert {
padding: 20px;
background-color: #2a7a85;
color: white;
}
.closebtn {
margin-left: 15px;
color: white;
font-weight: bold;
float: right;
font-size: 22px;
line-height: 20px;
cursor: pointer;
transition: 0.3s;
}
.closebtn:hover {
color: black;
}
body {
margin: 0;
}
/* Navigation bar */
ul.topnav {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: rgb(248, 248, 248);
}
ul.topnav li {
float: left;
}
ul.topnav li a {
display: block;
color: black;
text-align: center;
font-weight: bold;
padding: 25px 32px;
text-decoration: none;
}
ul.topnav li a:hover:not(.active) {
background-color: rgb(55, 81, 165);
}
ul.topnav li a.active {
background-color: #0cc0d8;
}
ul.topnav li.right {
float: right;
}
#media screen and (max-width: 600px) {
ul.topnav li.right,
ul.topnav li {
float: none;
}
}
/* On smaller screens, decrease text size */
#media only screen and (max-width: 300px) {
.text {
font-size: 11px;
}
}
/* Homepage button */
.glow-on-hover {
width: 220px;
height: 35px;
border: none;
outline: none;
color: rgb(0, 0, 0);
font-weight: bold;
font-size: 20px;
background: #111;
cursor: pointer;
position: relative;
z-index: 0;
border-radius: 10px;
}
.glow-on-hover:before {
content: "";
background: linear-gradient(
45deg,
#ff0000,
#ff7300,
#fffb00,
#48ff00,
#00ffd5,
#002bff,
#7a00ff,
#ff00c8,
#ff0000
);
position: absolute;
top: -2px;
left: -2px;
background-size: 400%;
z-index: -1;
filter: blur(5px);
width: calc(100% + 4px);
height: calc(100% + 4px);
animation: glowing 20s linear infinite;
opacity: 0;
transition: opacity 0.3s ease-in-out;
border-radius: 10px;
}
.glow-on-hover:active {
color: #000;
}
.glow-on-hover:active:after {
background: transparent;
}
.glow-on-hover:hover:before {
opacity: 1;
}
.glow-on-hover:after {
z-index: -1;
content: "";
position: absolute;
width: 100%;
height: 100%;
background: rgb(11, 78, 223);
left: 0;
top: 0;
border-radius: 10px;
}
#keyframes glowing {
0% {
background-position: 0 0;
}
50% {
background-position: 400% 0;
}
100% {
background-position: 0 0;
}
}
/* kipplo heading on homepage */
h1 {
font-size: 10vw;
margin: 0;
padding: 0;
font-family: "Courier New", Courier, monospace;
color: blue;
word-wrap: break-word;
text-align: center;
}
/* for the heading and the button alignment*/
.container {
display: flex;
flex-direction: column;
}
.btn-centering {
flex-grow: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
/* product cards*/
h3 {
text-align: center;
font-size: 30px;
margin: 0;
padding-top: 10px;
}
a {
text-decoration: none;
}
.gallery {
display: flex;
flex-wrap: wrap;
width: 100%;
justify-content: center;
align-items: center;
margin: 50px 0;
}
.content {
width: 24%;
margin: 15px;
box-sizing: border-box;
float: left;
text-align: center;
border-radius: 10px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
padding-top: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
transition: 0.4s;
background-color: whitesmoke;
}
.content:hover {
box-shadow: 0 0 11px rgb(0, 217, 255);
transform: translate(0px, -8px);
transition: 0.6s;
}
.productcard-image {
width: 200px;
height: 200px;
text-align: center;
margin: 0 auto;
display: block;
}
p {
text-align: center;
color: #b2bec3;
padding: 0 8px;
}
h6 {
font-size: 26px;
text-align: center;
color: #222f3e;
margin: 0;
}
.product-card {
list-style-type: none;
display: flex;
justify-content: center;
align-items: center;
padding: 0px;
}
.productcard-list {
padding: 5px;
}
.fa {
color: #ff9f43;
font-size: 26px;
transition: 0.4s;
}
.fa:hover {
transform: scale(1.3);
transition: 0.6s;
}
.productcardbutton {
text-align: center;
font-size: 24px;
color: #fff;
width: 100%;
padding: 15px;
border: 0px;
outline: none;
cursor: pointer;
margin-top: 5px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
}
.buy-1 {
background-color: #2183a2;
}
.buy-2 {
background-color: #3b3e6e;
}
.buy-3 {
background-color: #0b0b0b;
}
#media (max-width: 1000px) {
.content {
width: 46%;
}
}
#media (max-width: 750px) {
.content {
width: 100%;
}
}
/* Footer */
.footer__container {
background-color: #141414;
padding: 5rem 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
#footer__logo {
color: #fff;
display: flex;
align-items: center;
cursor: pointer;
text-decoration: none;
font-size: 2rem;
}
.footer__links {
width: 100%;
max-width: 1000px;
display: flex;
justify-content: center;
}
.footer__link--wrapper {
display: flex;
}
.footer__link--items {
display: flex;
flex-direction: column;
align-items: flex-start;
margin: 16px;
text-align: left;
width: 160px;
box-sizing: border-box;
}
.footer__link--items h2 {
margin-bottom: 16px;
}
.footer__link--items > h2 {
color: #fff;
}
.footer__link--items a {
color: #fff;
text-decoration: none;
margin-bottom: 0.5rem;
}
.footer__link--items a:hover {
color: #e9e9e9;
transition: 0.3s ease-out;
}
/* Social Icons */
.social__icon--link {
color: #fff;
font-size: 24px;
}
.social__media {
max-width: 1000px;
width: 100%;
}
.social__media--wrap {
display: flex;
justify-content: space-between;
align-items: center;
width: 90%;
max-width: 1000px;
margin: 40px auto 0 auto;
}
.website__rights {
color: #fff;
}
#media screen and (max-width: 820px) {
.footer__links {
padding-top: 2rem;
}
#footer__logo {
margin-bottom: 2rem;
}
.website__rights {
padding: 2rem;
}
.footer__link--wrapper {
flex-direction: column;
}
.social__media--wrap {
flex-direction: column;
}
}
#media screen and (max-width: 480px) {
.footer__link--items {
margin: 0;
padding: 10px;
width: 100%;
}
}
/* Text above the form*/
/* Feedback form*/
.form1 {
display: flex;
flex-direction: column;
align-items: center;
width: 500px;
margin: 15vh auto;
border-radius: 15px;
border: none;
box-shadow: 0 0 15px rgb(24, 143, 190);
}
form {
display: flex;
flex-direction: column;
align-items: center;
width: 90%;
}
input {
width: 100%;
margin: 5px 0;
height: 35px;
font-size: 17px;
text-align: center;
outline: none;
border-radius: 15px;
border: none;
background: rgb(235, 228, 228);
}
textarea {
width: 100%;
margin: 5px 0;
font-size: 17px;
text-align: center;
outline: none;
border-radius: 15px;
border: none;
background: rgb(235, 228, 228);
}
input[type="submit"] {
margin: 10px auto;
width: 120px;
background: rgb(24, 143, 190);
color: white;
cursor: pointer;
}
input[type="submit"]:hover {
background: rgb(19, 41, 238);
}
#media screen and (max-width: 600px) {
.form1 {
width: 90%;
}
}
h2 {
color: #00ffd5;
font-size: 30px;
}
p4 {
color: #00ffd5;
font-size: 20px;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="img/icon.png" />
<link rel="stylesheet" href="styles.css" />
<title>Contact Us</title>
</head>
<body>
<!-- Alert bar -->
<div class="container">
<div class="alert">
<span
class="closebtn"
onclick="this.parentElement.style.display='none';"
>×</span
>
<center>
<strong>DEALS NOW ON!</strong> Upto 30% discounts this christmas
</center>
</div>
<!-- Navigation bar -->
<ul class="topnav">
<li><img src="img/logo.png" /></li>
<li>Home</li>
<li>Products</li>
<li><a class="active" href="contactus.html">Contact Us</a></li>
<li class="right">About Us</li>
</ul>
<!-- Form -->
<div class="form1">
<h2>Contact Us!</h2>
<p4>Typical Replies Within 24hrs!</p4>
<br />
<form action="">
<input
type="email"
name="email"
id="email"
placeholder="Enter your email"
/>
<input
type="text"
name="name"
id="name"
placeholder=" Enter your name"
/>
<textarea
name="message"
id="message"
cols="30"
rows="10"
placeholder="Enter your message here"
></textarea>
<input type="submit" value="Send" />
</form>
</div>
</div>
<!-- Footer -->
<div class="footer__container">
<div class="footer__links">
<div class="footer__link--wrapper">
<div class="footer__link--items">
About Us
</div>
<div class="footer__link--items">
Contact Us
</div>
</div>
<div class="footer__link--wrapper">
<div class="footer__link--items">
Youtube
</div>
<div class="footer__link--items">
TikTok
</div>
</div>
</div>
<section class="social__media">
<div class="social__media--wrap">
<div class="footer__logo">
<a href="index.html">
<img src="img/logo2.png" id="footer__logo"
/></a>
</div>
<p class="website__rights">
© KIPPLO.CO.UK PROTOTYPE 2022. All rights reserved
</p>
<div class="social__icons"></div>
</div>
</section>
</div>
</body>
</html>
If you reduce browser size, the text of "Discover" and "How it Works" overlap so that it looks like it says "Discover it works" "How".
How do I make it so that instead, the text of these Li items always stay separated? I tried doing flex: nowrap property but it had no effect.
Here is the codepen to show what I mean: https://codepen.io/hiarooo/pen/GRrzapM
Thanks for any help.
HTML
<header>
<div class="container">
<nav>
<div class="left-content">
<div class="header-user">
<img src="HOME/DoLogo.png" alt="logo" width="50px">
<p><span>Do</span></p>
</div>
<div class="header-tablet">
<div class="vl"></div>
<ul>
<li>Discover</li>
<li>How it works</li>
</ul>
</div>
</div>
<div class="right-content">
<div class="search">
<input type="text" placeholder="Search">
<i class="fas fa-search"></i>
</div>
<img id="notifications" src="HOME/Notification.svg" alt="Notification">
<div class="header-user">
<img src="HOME/uploadnav.png" alt="user">
</div>
<img class="mob" src="HOME/uploadnav.png" alt="user">
<img src="HOME/menu.svg" alt="hamburgermenu">
</div>
</nav>
</div>
</header>
CSS:
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
width: 78%;
margin: 0 auto;
}
#media (max-width: 1330px) {
.container {
width: 90%;
margin: 0 auto;
}
}
/* Header */
header {
height: 80px;
border: 1px solid #e6e8ec;
}
nav {
display: flex;
flex-direction: row;
justify-content: space-between;
}
#notifications{
padding-right:20px;
}
.search {
display: inline;
height: 40px;
width: 256px;
border-radius: 8px;
padding: 10px 12px 10px 16px;
border: 2px solid #e6e8ec;
outline: none;
display: flex;
justify-content: space-between;
margin-right: 18px;
margin-left: 20px;
}
.search input {
outline: none;
border: none;
}
.search i {
color: #777e90;
}
.search:hover {
cursor: pointer;
}
.search input::-webkit-input-placeholder {
font-family: "Poppins", sans-serif;
color: #777e90;
font-size: 12px;
}
.button {
background-color: #3772ff;
padding: 12px 16px;
border-radius: 90px;
font-family: "DM Sans", sans-serif;
font-weight: 700;
font-size: 14px;
line-height: 16px;
text-align: center;
color: #fcfcfd;
text-decoration: none;
margin-left: 18px;
margin-right: 10px;
display: inline;
}
.header-user {
border-radius: 90px;
padding: 4px 12px 4px 4px;
border: 2px #e6e8ec solid;
width: 147px;
height: 40px;
display: flex;
justify-content: center;
align-items: center;
}
.header-user p {
padding-left: 6px;
display: inline-block;
font-family: "DM Sans", sans-serif;
font-weight: 700;
font-size: 14px;
line-height: 16px;
}
.header-user span {
color: #45b26b;
padding-left: 2px;
}
.left-content {
display: flex;
height: 80px;
justify-content: center;
align-items: center;
}
.mob {
display: none;
}
.vl {
border-left: 2px #e6e8ec solid;
height: 40px;
margin: 0 32px;
}
.left-content ul {
list-style: none;
}
.left-content ul li {
display: inline;
}
.left-content ul li a {
text-decoration: none;
padding-right: 32px;
font-family: "DM Sans", sans-serif;
font-weight: 700;
font-size: 14px;
line-height: 16px;
color: #777e90;
}
.right-content {
display: flex;
height: 80px;
justify-content: center;
align-items: center;
}
.right-content img {
cursor: pointer;
}
.menu {
display: none;
}
.header-tablet {
display: flex;
justify-content: space-between;
height: 80px;
align-items: center;
}
.topFont{
font-size: 14px;
font-family: "DM Sans", sans-serif;
font-weight: 700;
text-decoration: none;
color: #23262f;
}
.btn-1 {
font-size: 14px;
font-family: "DM Sans", sans-serif;
font-weight: 700;
text-decoration: none;
color: #23262f;
border: 2px solid #e6e8ec;
border-radius: 90px;
display: inline-block;
padding: 12px 16px;
margin-bottom: 0px;
}
.btn-1:hover {
background-color: #3772ff;
color: #fcfcfd;
/*border: none;*/
transition:all .2s ease;
-webkit-transition-delay:all .2s ease;
-moz-transition-delay:all .2s ease;
-ms-transition-delay:all .2s ease;
-o-transition-delay:all .2s ease;
}
/* input */
.round {
max-width: 100%;
height: 48px;
background-color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
border: 3px #f4f4f4 solid;
border-radius: 90px;
margin: 20px 0px;
}
.round i {
color: rgba(0, 0, 0, 0.3);
padding: 10px;
line-height: 80px;
}
.round input {
outline: none;
border: none;
padding-left: 16px;
}
.search-btn {
margin-top: 0px;
margin-bottom: 0px;
padding-left: 12px;
}
.round input::-webkit-input-placeholder {
font-family: "Poppins", sans-serif;
color: #777e90;
font-size: 12px;
}
.search-icon:hover {
cursor: pointer;
color: #3772ff;
}
#media (max-width: 1170px) {
.round {
width: 200px;
}
}
#media (max-width: 960px) {
.round {
width: 200px;
}
}
#media (max-width: 779px) {
.container {
width: 90%;
margin: 0 auto;
}
.header-tablet{
display:none;
}
.search {
display: none;
}
.menu {
display: inline;
}
.button {
display: none;
}
/* header user */
.header-user {
display: none;
}
Change this CSS setting:
.left-content ul li {
display: inline;
}
to
.left-content ul li {
display: inline-block;
}
That way the contents of that li element will form a (inline) block that can only wrap to a new line as a whole.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
width: 78%;
margin: 0 auto;
}
#media (max-width: 1330px) {
.container {
width: 90%;
margin: 0 auto;
}
}
/* Header */
header {
height: 80px;
border: 1px solid #e6e8ec;
}
nav {
display: flex;
flex-direction: row;
justify-content: space-between;
}
#notifications {
padding-right: 20px;
}
.search {
display: inline;
height: 40px;
width: 256px;
border-radius: 8px;
padding: 10px 12px 10px 16px;
border: 2px solid #e6e8ec;
outline: none;
display: flex;
justify-content: space-between;
margin-right: 18px;
margin-left: 20px;
}
.search input {
outline: none;
border: none;
}
.search i {
color: #777e90;
}
.search:hover {
cursor: pointer;
}
.search input::-webkit-input-placeholder {
font-family: "Poppins", sans-serif;
color: #777e90;
font-size: 12px;
}
.button {
background-color: #3772ff;
padding: 12px 16px;
border-radius: 90px;
font-family: "DM Sans", sans-serif;
font-weight: 700;
font-size: 14px;
line-height: 16px;
text-align: center;
color: #fcfcfd;
text-decoration: none;
margin-left: 18px;
margin-right: 10px;
display: inline;
}
.header-user {
border-radius: 90px;
padding: 4px 12px 4px 4px;
border: 2px #e6e8ec solid;
width: 147px;
height: 40px;
display: flex;
justify-content: center;
align-items: center;
}
.header-user p {
padding-left: 6px;
display: inline-block;
font-family: "DM Sans", sans-serif;
font-weight: 700;
font-size: 14px;
line-height: 16px;
}
.header-user span {
color: #45b26b;
padding-left: 2px;
}
.left-content {
display: flex;
height: 80px;
justify-content: center;
align-items: center;
}
.mob {
display: none;
}
.vl {
border-left: 2px #e6e8ec solid;
height: 40px;
margin: 0 32px;
}
.left-content ul {
list-style: none;
}
.left-content ul li {
display: inline-block;
}
.left-content ul li a {
text-decoration: none;
padding-right: 32px;
font-family: "DM Sans", sans-serif;
font-weight: 700;
font-size: 14px;
line-height: 16px;
color: #777e90;
}
.right-content {
display: flex;
height: 80px;
justify-content: center;
align-items: center;
}
.right-content img {
cursor: pointer;
}
.menu {
display: none;
}
.header-tablet {
display: flex;
justify-content: space-between;
height: 80px;
align-items: center;
}
.topFont {
font-size: 14px;
font-family: "DM Sans", sans-serif;
font-weight: 700;
text-decoration: none;
color: #23262f;
}
.btn-1 {
font-size: 14px;
font-family: "DM Sans", sans-serif;
font-weight: 700;
text-decoration: none;
color: #23262f;
border: 2px solid #e6e8ec;
border-radius: 90px;
display: inline-block;
padding: 12px 16px;
margin-bottom: 0px;
}
.btn-1:hover {
background-color: #3772ff;
color: #fcfcfd;
/*border: none;*/
transition: all .2s ease;
-webkit-transition-delay: all .2s ease;
-moz-transition-delay: all .2s ease;
-ms-transition-delay: all .2s ease;
-o-transition-delay: all .2s ease;
}
/* input */
.round {
max-width: 100%;
height: 48px;
background-color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
border: 3px #f4f4f4 solid;
border-radius: 90px;
margin: 20px 0px;
}
.round i {
color: rgba(0, 0, 0, 0.3);
padding: 10px;
line-height: 80px;
}
.round input {
outline: none;
border: none;
padding-left: 16px;
}
.search-btn {
margin-top: 0px;
margin-bottom: 0px;
padding-left: 12px;
}
.round input::-webkit-input-placeholder {
font-family: "Poppins", sans-serif;
color: #777e90;
font-size: 12px;
}
.search-icon:hover {
cursor: pointer;
color: #3772ff;
}
#media (max-width: 1170px) {
.round {
width: 200px;
}
}
#media (max-width: 960px) {
.round {
width: 200px;
}
}
#media (max-width: 779px) {
.container {
width: 90%;
margin: 0 auto;
}
.header-tablet {
display: none;
}
.search {
display: none;
}
.menu {
display: inline;
}
.button {
display: none;
}
/* header user */
.header-user {
display: none;
}
<header>
<div class="container">
<nav>
<div class="left-content">
<div class="header-user">
<img src="HOME/DoLogo.png" alt="logo" width="50px">
<p><span>Do</span></p>
</div>
<div class="header-tablet">
<div class="vl"></div>
<ul>
<li>Discover</li>
<li>How it works</li>
</ul>
</div>
</div>
<div class="right-content">
<div class="search">
<input type="text" placeholder="Search">
<i class="fas fa-search"></i>
</div>
<img id="notifications" src="HOME/Notification.svg" alt="Notification">
<div class="header-user">
<img src="HOME/uploadnav.png" alt="user">
</div>
<img class="mob" src="HOME/uploadnav.png" alt="user">
<img src="HOME/menu.svg" alt="hamburgermenu">
</div>
</nav>
</div>
</header>
I can't seem to solve what was previously not a problem:
My navbar is fullwidth and mobile-y even above the breaking point
My grid boxes are not responsive on mobile even though I have set it to 1fr column and (6, fr) row.
https://codepen.io/arian-wardak/pen/QWKyzdj
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset="utf-8">
<title>Services - Quantum Marketing</title>
<link rel="stylesheet" type="text/css" href="css/quantum.css">
<link rel="stylesheet" type="text/css" href="css/reset.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<main>
<nav>
<ul>
<li>Home</li>
<li><a class="active" href="services.html">Services</a></li>
<li>Contact</li>
<li>Account</li>
<li>Cite</li>
</ul>
</nav>
<div class="grid-services">
<div class="grid-item item-1">
<img src=img/coding.png alt="Coding Icon" width="64" height="51">
<h4>Web Development</h4>
<div class="button">Choose</div>
</div>
<div class="grid-item item-2">
<img src=img/search.png alt="Search Icon with a Dollar Sign" width="64" height="64">
<h4>Search Engine Optimization</h4>
<div class="button">Choose</div>
</div>
<div class="grid-item item-3">
<img src=img/copywriting.png alt="Notepad and Pencil Icon" width=64 height=57>
<h4>Copywriting</h4>
<div class="button">Choose</div>
</div>
<div class="grid-item item-4">
<img src=img/email.png alt="Email Icon" width=64 height=64>
<h4>Email Marketing</h4>
<div class="button">Choose</div>
</div>
<div class="grid-item item-5">
<img src=img/social.png alt="Social Media Icon" width=64 height=45>
<h4>Social Media Marketing</h4>
<div class="button">Choose</div>
</div>
<div class="grid-item item-6">
<img src=img/retargeting.png alt="Bullseye Icon" width=64 height=64>
<h4>Retargeting</h4>
<div class="button">Choose</div>
</div>
</div>
</main>
<footer>
Copyright © 2020 Ariana Wardak. All Rights Reserved. | Privacy Policy Disclaimer | Designed by Ariana
</footer>
</body>
</html>
* {
box-sizing:border-box;
margin: 0;
font-family: 'Montserrat', sans-serif;
padding: 0;
outline: none;
}
body {
background-color: dimgray;
color: black;
}
main {
grid-area: main;
text-align:center;
overflow: hidden;
white-space: normal;
}
h1 {
padding: 20px;
color: white;
text-align: center;
}
h3 {
color: white;
text-align: center;
}
h4 {
padding: 30px;
color: white;
text-align: center;
}
.content {
margin: 0;
padding: 0;
background-color: white;
color: black;
}
.content img {
height: auto;
padding-right: 20px;
margin: 0;
}
nav {
overflow: hidden;
background-color: deepskyblue;
font-size: smaller;
}
ul {
display:block;
text-decoration: none;
text-align: center;
list-style: none;
float: right;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-decoration: none;
font-weight: bold;
text-transform: uppercase;
padding: 15px;
}
li a:hover {
background-color: deepskyblue;
}
li a.active {
background-color: navy;
}
.hero {
text-align: center;
background-color: navy;
padding: 200px 0;
}
.faq {
padding: 50px;
}
.accordion {
width: 90%;
max-width: 1000px;
margin: 2rem auto;
min-height: 300px;
}
.accordion-item {
background-color: #fff;
color: #111;
margin: 1rem 0;
border-radius: 0.5rem;
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.25);
}
.accordion-item-header {
padding: 0.5rem 3rem 0.5rem 1rem;
min-height: 3.5rem;
line-height: 1.25rem;
font-weight: bold;
display: flex;
align-items: center;
position: relative;
cursor: pointer;
}
.accordion-item-header::after {
content: "\002B";
font-size: 2rem;
position: absolute;
right: 1rem;
}
.accordion-item-header.active::after {
content: "\2212";
}
.accordion-item-body {
max-height: 0;
overflow: hidden;
transition: max-height 0.2s ease-out;
}
.accordion-item-body-content {
padding: 1rem;
line-height: 1.5rem;
text-align: left;
border-top: 1px solid;
border-image: linear-gradient(to right, transparent, #34495e, transparent) 1;
}
.grid-services {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: 300px 300px;
padding: 20px;
height: 100vh;
grid-gap: 20px;
}
.grid-item {
background-color: navy;
padding: 20px;
}
button,
.button,
.button-services,
.button-contact {
background-color: deepskyblue;
display: inline-block;
padding:10px 25px;
margin: 15px 20px;
font-weight: bold;
border-radius: 5px;
color: white;
text-decoration: none;
}
button:hover,
.button:hover,
.button-services:hover,
.button-contact:hover {
background-color: dimgray;
color: deepskyblue;
cursor: pointer;
transition: all 0.1s ease;
}
.faq {
padding: 50px;
}
.accordion {
width: 90%;
max-width: 1000px;
margin: 2rem auto;
min-height: 300px;
}
.accordion-item {
background-color: #fff;
color: #111;
margin: 1rem 0;
border-radius: 0.5rem;
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.25);
}
.accordion-item-header {
padding: 0.5rem 3rem 0.5rem 1rem;
min-height: 3.5rem;
line-height: 1.25rem;
font-weight: bold;
display: flex;
align-items: center;
position: relative;
cursor: pointer;
}
.accordion-item-header::after {
content: "\002B";
font-size: 2rem;
position: absolute;
right: 1rem;
}
.accordion-item-header.active::after {
content: "\2212";
}
.accordion-item-body {
max-height: 0;
overflow: hidden;
transition: max-height 0.2s ease-out;
}
.accordion-item-body-content {
padding: 1rem;
line-height: 1.5rem;
text-align: left;
border-top: 1px solid;
border-image: linear-gradient(to right, transparent, #34495e, transparent) 1;
}
.contact {
max-width: 700px;
margin: auto;
}
.form {
max-width: 700px;
text-align: center;
margin: 20px auto;
display: grid;
grid-template-columns: 1fr 1em 2fr;
grid-gap: 0.3em 0.6em;
grid-auto-flow: dense;
align-items: center;
}
input, label {
display: block;
}
textarea {
resize: vertical;
max-height: 300px;
}
.profile {
background-color: white;
padding: 20px;
margin: auto;
color: black;
max-width: 800px;
text-align: center;
}
.profile h4 {
color: black;
}
.citations {
background-color: white;
padding: 20px;
margin: auto;
color: black;
max-width: 800px;
text-align: center;
}
.wrapper{
position: relative;
width: 500px;
background-color: navy;
margin: auto;
}
.profile_card{
height: 400px;
background: navy;
padding: 50px 25px;
position: relative;
z-index: 1;
padding: 20px;
}
.profile_card{
color: #fff;
text-align: center;
}
.profile_card .profile_img img{
width: 80px;
border-radius: 50%;
display: block;
margin: 0 auto;
}
.profile_card .profile_img .name{
font-size: 24px;
font-weight: 500;
margin: 15px 0 5px;
}
.profile_card .profile_img .place{
font-size: 14px;
font-weight: 300;
}
.profile_card .place .icon{
margin-right: 10px;
}
.profile_icons{
display: flex;
margin: 30px 0;
justify-content: center;
}
.profile_icons .profile_item{
margin-right: 15px;
}
.profile_icons .profile_item:last-child{
margin-right: 0;
}
.profile_icons .icon,
.profile_icons .number{
font-size: 24px;
}
.profile_icons .title{
font-size: 12px;
text-transform: uppercase;
margin: 10px 0;
}
.profile_btn{
background-color: deepskyblue;
padding: 10px;
border-radius: 25px;
width: 200px;
margin: 0 auto;
color: white;
cursor: pointer;
}
.profile_btn:hover{
background: #ffc208;
}
.settings_btn{
width: 50px;
height: 52px;
position: absolute;
bottom: 20px;
left: 225px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.settings_btn{
right: 0;
box-shadow: inset 2px -2px 3px ##00bfff;
}
.settings_btn:hover{
padding: 2px;
background-color: dimgray;
}
.profile_slider{
width: 325px;
height: 400px;
background: #fff;
color: #7b7a82;
position: absolute;
top: 25px;
left: 0;
font-size: 14px;
transition: bottom 0.2s ease;
}
.profile_slider li{
height: 80px;
border-bottom: 1px solid #eceff4;
padding: 15px;
}
.profile_slider li:last-child{
border-bottom: 0;
}
.profile_slider li .slider_item,
.profile_slider li .slider_left{
display: flex;
}
.profile_slider li .slider_item{
justify-content: space-between;
align-items: center;
height: 100%;
}
.profile_slider img{
width: 35px;
border-radius: 50%;
margin-right: 10px;
}
.profile_slider .item{
text-align: left;
font-size: 12px;
}
.profile_slider .item_email{
font-weight: 300;
margin-top: 5px;
}
.profile_slider .btn{
width: 100px;
padding: 8px 10px;
border-radius: 25px;
cursor: pointer;
font-size: 12px;
text-align: center;
}
.profile_slider .btn.btn_following{
background: #6a60c3;
color: #fff;
}
.profile_slider .btn.btn_following:hover{
background: #8178d1;
}
.profile_slider .btn.btn_follow{
border: 1px solid #7b7a82;
}
.profile_slider .btn.btn_follow:hover{
color: #fff;
background: #7b7a82;
}
.profile_slider.active{
left: 100%;
}
.settings_btn.active{
background: #00bfff;
}
.settings_btn i{
transition: transform 0.2s ease;
}
.settings_btn.active i{
transform: rotate(360deg);
}
.citations h4 {
color: black;
}
footer {
margin-bottom: 120px;
padding: 6px;
background-color: deepskyblue;
color: #ffffff;
text-align: center;
font-size: smaller;
}
#media screen and (max-width: 400px) {
nav {
float: none;
}
}
ul {
float: none;
}
li {
float: none;
width: 100%;
padding: 0;
}
.hero {
text-align: center;
padding: 180px 20px;
}
.connect {
margin: 0;
background-color: white;
color: black;
}
.connect img {
padding: 50px;
}
.content {
padding: 20px 8px;
}
}
.grid-services {
grid-template-columns: 1fr;
height: auto;
grid-template-rows: repeat(6, 1fr);
height: auto;
}
.form {
display: flex;
flex-direction: row;
color: white;
}
.form label {
flex: none;
display: block;
width: 250px;
font-weight: bold;
font-size: 1em;
display: inline-block;
}
.form label.right-inline {
text-align: right;
padding-right: 8px;
padding-left: 10px;
width: 300px;
}
.form .input-control {
flex: 1 1 auto;
display: block;
margin-bottom: 10px;
margin-right: 8px;
padding: 4px;
margin-top: -4px;
}
footer {
grid-area: footer;
margin: 0;
padding: 6px;
background-color: deepskyblue;
color: #ffffff;
text-align: center;
font-size: smaller;
}
You can use the Bootstrap class navbar; it already has breakpoints defined so you can have a presentable grid box at a small webpage size.
I use menu that was created by other developer in our company. I add to the first item of the menu dropdown selection, but the problem that the dropdown box not fully fill the all the item and I can't make it fill.
Here is HTML:
<div class="main-container-top-menu scroll1" id="main-container-top-menu">
<div class="top-menu-item-container-empty">
<div style="width: 50px"></div>
</div>
<div class="top-menu-item-container">
<div class="inactive-border-bottom">
<p class="control has-icons-left is-expanded">
<span class="select is-fullwidth ">
<select class="full-height">
<option>dropdown</option>
<option>options 1</option>
</select>
</span>
<span class="icon is-small is-left"><i class="far fa-building"></i></span>
</p>
</div>
</div>
<div class="top-menu-item-container" >
<div>
<div class="top-menu-item">2. Lot and Model</div>
</div>
</div>
<div class="top-menu-item-container" >
<div [className]="ishpExpanded?'active-border-bottom':'inactive-border-bottom'">
<div class="top-menu-item">3. Home Plan</div>
</div>
</div>
<div class="top-menu-item-container">
<div [className]="isupgExpanded?'active-border-bottom':'inactive-border-bottom'">
<div class="top-menu-item">4. Upgrades</div>
</div>
</div>
<div class="top-menu-item-container">
<div [className]="isnextExpanded?'active-border-bottom':'inactive-border-bottom'">
<div class="top-menu-item">5. Next Steps</div>
</div>
</div>
<div class="top-menu-icon-container">
<i class="fas fa-print top-menu-icon"></i>
<i class="fas fa-share-alt top-menu-icon"></i>
</div>
</div>
And here is CSS:
.scroll1::-webkit-scrollbar {
width: 0px;
height: 3px;
}
.scroll1::-webkit-scrollbar-track {
background: #eff0f0;
}
.scroll1::-webkit-scrollbar-thumb {
background: #666;
}
.main-container-top-menu {
scrollbar-width: auto;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.top-menu-item-container-empty {
border-bottom: 2px solid #eff0f0;
font-family: "Roboto", sans-serif;
border-right: 2px solid #eff0f0;
box-sizing: border-box;
color: #626262;
font-size: 14px;
font-weight: 350;
user-select: none;
justify-content: space-between;
}
.top-menu-item-container {
border-bottom: 2px solid #eff0f0;
font-family: "Roboto", sans-serif;
border-right: 2px solid #eff0f0;
box-sizing: border-box;
color: #626262;
font-size: 14px;
font-weight: 350;
user-select: none;
flex: 1;
justify-content: space-between;
}
.active-border-bottom {
align-items: center;
display: flex;
padding-left: 20px;
padding-right: 20px;
height: 100%;
border-bottom: 3px solid #eb2028;
box-sizing: border-box;
}
.inactive-border-bottom {
align-items: center;
display: flex;
padding-left: 20px;
padding-right: 20px;
height: 100%;
}
.top-menu-item-active {
cursor: pointer;
font-family: "Roboto", sans-serif;
padding: 5px;
font-family: "Roboto", sans-serif;
box-sizing: border-box;
color: #1d1d1d;
font-size: 14px;
font-weight: 350;
user-select: none;
align-items: center;
justify-content: center;
display: flex;
stroke-width: 0.6px;
-webkit-text-stroke-width: 0.6px;
flex: 1;
}
.top-menu-item {
cursor: pointer;
padding: 10px;
font-family: "Roboto", sans-serif;
box-sizing: border-box;
color: #626262;
font-size: 14px;
user-select: none;
align-items: center;
justify-content: center;
display: flex;
flex: 1;
}
.top-menu-item-first {
cursor: default;
border-right: 2px solid #eff0f0;
font-size: 14px;
padding-right: 20px;
font-weight: 800;
border-bottom: 2px solid #eff0f0;
border-left: none;
text-align: left;
justify-content: left;
flex: 1;
}
.top-right-menu-item {
/* margin-right: 50px; */
border-bottom: 2px solid #eff0f0;
height: 100%;
display: inline-flex;
justify-content: flex-end;
align-items: center;
}
.top-item-logo {
height: 55px;
z-index: 100;
width: 55px;
object-fit: contain;
}
.top-menu-icon-container{
display: flex;
align-items: center;
justify-content: center;
}
.top-menu-icon {
cursor: pointer;
margin-right: 25px;
margin-left: 25px;
cursor: pointer;
width: 14px;
padding-top: 25px;
padding-bottom: 25px;
}
.left-arrow,
.right-arrow {
display: none;
}
#media screen and (max-width: 768px) {
.constructor-top-container {
justify-content: center;
padding-left: 3%;
}
}
#media screen and (max-width: 1088px) {
.top-right-menu-item {
padding-left: 10px;
margin-right: 0px;
border-bottom: 2px solid #eff0f0;
flex: 1;
height: 100%;
display: inline-flex;
justify-content: flex-end;
align-items: center;
}
.main-container-top-menu {
padding-left: 0;
padding-right: 0;
padding-bottom: 3px;
}
}
#media screen and (max-width: 414px) {
.top-menu-icon {
margin-right: 15px;
cursor: pointer;
width: 14px;
padding-top: 12px;
}
.scroll1::-webkit-scrollbar {
width: 0px;
height: 0px;
}
.scroll1::-webkit-scrollbar-track {
background: #eff0f0;
}
.scroll1::-webkit-scrollbar-thumb {
background: #666;
}
.top-menu-item-first {
padding-left: 35px;
}
.main-container-top-menu {
transition: 0.2s all;
min-height: 62px;
}
.top-item-logo {
position: absolute;
top: 0;
right: 0px;
margin: 0;
padding: 0;
z-index: 100;
height: 62px;
width: 62px;
object-fit: contain;
}
.left-arrow {
height: 60px;
padding-left: 5px;
padding-right: 5px;
background: white;
display: flex;
align-items: center;
position: absolute;
cursor: pointer;
color: #d1d1d1;
top: 0px;
font-size: 1.6rem;
left: 0;
z-index: 5;
padding-left: 7px;
}
.right-arrow {
height: 60px;
padding-left: 5px;
padding-right: 5px;
background: white;
display: flex;
align-items: center;
position: absolute;
cursor: pointer;
color: #b1b1b1;
font-size: 1.6rem;
left: calc(100% - 88px);
}
}
#media screen and (max-width: 1088px) {
.main-container-top-menu {
overflow-x: auto;
overflow-y: hidden;
/* display: block; */
width: 100%;
white-space: nowrap !important;
}
}
#media screen and (max-width: 414px) {
.main-container {
padding-left: 0px;
padding-right: 0px;
}
}
.no-suite-title {
text-transform: uppercase;
font-size: 1.3em;
font-weight: 300;
position: absolute;
left: 10%;
top: 50%;
z-index: 1000;
}
Workink jsFiddle!
How can I make dropdown to fill the menuc without gaps?
Update
Text moved to the left:
To get the desired result, you need to do the following:
Remove padding-left: 20px and padding-right: 20px from the .inactive-border-bottom selector;
Add height: 100% to these selectors - .control and .select.is-fullwidth.
Need to register .full-height in your css, and write the rule height: 100%!important in it. !important is necessary because this rule overrides the height: 2.5em rule in the .select select.