Bad render mobile menu only Iphone - diffrent height? - css

I have problem with my website.
I did responsive website with mobile menu and it's looking very good on Developere Mode with responsive and android phone but on iphone it look terrible..
Here on dev tools/android:
Here on iphone:
Code:
HTML:
<header class="header">
<div class="header-wrapper">
<div class="header-logo" id="headerLogo">
<img src="assets/images/logo_right.svg" alt="Logo company" height="70px">
</div>
<div class="header-logo header-logo--mobile">
<img class="logo-mobile" src="assets/images/logo.png" alt="Logo company" height="70px">
</div>
<div class="header-contact-container">
<div class="header-contact__item">
<div class="header-contact__icon">
<i class="gg-phone"></i>
</div>
</div>
</div>
</div>
<nav class="site-nav" id="nav__main">
<ul class="site-nav__list">
<li class="site-nav__item site-nav__item--is-hidden">
<a class="site-nav__anchor" href="#" id="mobile_nav">MENU</a>
</li>
<li class="site-nav__item">
<a class="site-nav__anchor" href="javascript: scrollSmoothTo('mainWrapper')"
id="homeNavButton">Home</a>
</li>
<li class="site-nav__item">
<a class="site-nav__anchor" href="javascript: scrollSmoothTo('aboutUs')"
id="aboutNavButton">About</a>
</li>
<li class="site-nav__item">
<a class="site-nav__anchor" href="javascript: scrollSmoothTo('services')" id="servicesNavButton">Services</a>
</li>
<li class="site-nav__item">
<a class="site-nav__anchor" href="javascript: scrollSmoothTo('contact')" id="contactNavButton">Contact</a>
</li>
</ul>
</nav>
</header>
CSS DEFAULT
.header {
display: block;
}
.header-wrapper {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
width: 65%;
padding: 30px 0;
margin: 0 auto;
}
.header-logo {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.header-logo--mobile {
display: none;
}
.header-contact-container {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.header-contact__item {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
}
.header-contact__title {
font-size: 1.2rem;
text-transform: uppercase;
margin: 0 0 10px;
}
.header-contact__data {
text-align: center;
}
.header-contact__icon {
display: block;
margin-left: 15px;
height: 100%;
}
.site-nav {
height: 50px;
background: rgb(250, 255, 253);
border-top: 1px solid rgba(224, 224, 224, 0.68);
border-bottom: 1px solid rgba(224, 224, 224, 0.68);
z-index: 999;
}
.site-nav__list {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
margin: 0 auto;
padding: 0;
height: 100%;
list-style: none;
}
.site-nav__item--is-hidden {
display: none;
}
.site-nav__item {
width: 180px;
height: 80%;
}
.site-nav__anchor {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
height: 100%;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
color: rgb(6, 67, 62);
font-family: 'Sora', sans-serif;
font-weight: 500;
font-size: 1.1em;
text-transform: uppercase;
text-decoration: none;
-webkit-appearance: none!important;
}
.site-nav__anchor:hover {
font-size: 1.2rem;
color: #ffcc00;
}
.header-nav--sticky {
position: fixed;
top: 0;
width: 100%;
}
CSS MOBILE
.header-wrapper {
display: block;
width: 100%;
text-align: center;
}
.header-logo {
display: none;
}
.header-logo--mobile {
display: block;
padding-top: 30px;
}
.logo-mobile {
}
.header-contact-container {
display: block;
}
.header-contact__item {
-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;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
width: auto;
padding-top: 30px;
}
.header-contact__title {
font-size: 1.4rem;
}
.header-contact__data {
display: block;
/*-webkit-box-ordinal-group:3;*/
/*-ms-flex-order:2;*/
/*order:2;*/
font-size: 1.2rem;
}
.site-nav {
height: auto!important;
}
.site-nav__list {
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
height: auto!important;
/*height: auto;*/
}
.site-nav__item--is-hidden {
display: block!important;
background: #FFCC00;
max-height: 100%!important;
}
.site-nav__item {
display: none;
width: 100%;
max-height: 100%!important;
}
.site-nav__anchor {
padding: 15px 0;
border-bottom: 1px solid rgba(0, 0, 0, 0.16);
}
.site-nav__anchor:nth-child(1):hover {
font-size: 1.2rem;
color:inherit!important;
}
JS
const mobileButtonMenu = document.getElementById("mobile_nav")
mobileButtonMenu.addEventListener("click", setMobileMenu);
function setMobileMenu() {
const menu = document.querySelectorAll(".site-nav__item")
if (menu[1].style.display === "block") {
menu[1].style.display = "none";
menu[2].style.display = "none";
menu[3].style.display = "none";
menu[4].style.display = "none";
} else {
menu[1].style.display = "block";
menu[2].style.display = "block";
menu[3].style.display = "block";
menu[4].style.display = "block";
}
}
I dont know what I have to do. I think that problem may be with height:auto, because other elements with flex was be good render.

Related

Problems with css menu styles

I am really new to working on this, the problem I have is two
What I am trying to do is give it to show the menu as shown in the following image:
I can not put the option that was selected underlined, and so that the displayed menu is horizontal, what I have is this:
Searching the web I have not found anything to solve it or something to take an example to solve my problem, I am working with CSS and Vue.Js, if someone can tell me how to solve this
Underline the selected menu and see the menu displayed horizontally
My Code:
<div class="panel-group" id="accordion-mbl-menu">
<div class="panel">
<b-navbar-toggle target="collapse-cat-lvl1-469">
Accesorios
<img src="#/assets/images/layout/menu/chevron.svg" class="icon">
</b-navbar-toggle>
<div style="background-color:white;">
<b-collapse id="collapse-cat-lvl1-469">
<div data-cat-acc="473" class="grid-item parent-lvl-2">
<a class="link -1 grid-sty-1" href="#" target="_self" data-menu-item-id="473">
<span class="text">GTI</span>
</a>
</div>
...
(other menu options)
...
</b-collapse>
</div>
</div>
<div class="panel">
<button type="button" class="navbar-toggler collapsed"> ¿Necesitas ayuda? </button>
</div>
</div>
My code CSS
#media (max-width: 828px) {
#menu-header.show {
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
}
#menu-header {
display: block ;
position: fixed;
z-index: 1;
background-color: #FFF;
left: 0;
top: 100px;
height: -webkit-calc(100% - 50px);
height: -moz-calc(100% - 50px);
height: calc(100% - 50px);
width: 90%;
padding: 20px 20px;
max-width: 87.5%;
transform: translateX(-100%);
transition: transform 650ms ease;
.grid-sty-1 {
height: 55px;
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: -moz-box;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
-moz-box-align: center;
align-items: center;
height: 40px;
font-size: 16px;
font-family: "VWHead-Bold", sans-serif;
position: relative;
a{
text-decoration: none;
outline: none !important;
padding-right: 15px;
position: relative;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
-moz-box-align: center;
-ms-flex-align: center;
align-items: center;
}
> .text {
padding-left: 15px;
color: #001E50;
}
}
.navbar-greetings{
font-family: 'VWHead-Regular';
font-size: 24px;
line-height: 29px;
display: flex;
align-items: center;
color: #001E50;
}
#accordion-mbl-menu {
margin: 0;
.panel {
box-shadow: none !important;
background-color: transparent;
border-radius: 0;
border: 0;
margin-bottom: 0;
> button.collapsed {
color: #001e50;
> .icon{
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
}
> button.not-collapsed > .icon {
-webkit-transform: rotate(180deg);
transform: rotate(180deg);
}
> button {
margin: 0px;
padding: 0px;
width: 100%;
height: 55px;
font-size: 20px;
font-family: "VWHead-Bold";
font-weight: normal;
color: #2f3538;
text-decoration: none;
outline: none !important;
border-bottom: 1px solid #dee1e3;
padding-right: 15px;
position: relative;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
-moz-box-align: center;
-ms-flex-align: center;
align-items: center;
> .icon {
width: 20px;
height: 20px;
fill: currentColor;
-webkit-transition: all 350ms ease;
transition: all 350ms ease;
position: absolute;
right: 15px;
top: auto;
}
.collapse.in {
display: block;
}
}
}
}
}
}
Any way to style this?
To show underline on hover
.class:hover {
text-decoration: underline;
}
To display horizontal
.container {
display: flex;
flex-direction: row;
}

Overlay div preloader to a section element

I need to add a div preloader in the center of an article element!
I don't want this pre-loader to expand to the entire body, as the side menu is static!
Therefore, I want it to occupy only the article element and overlay the section element until the data in this section is ready to be displayed after a request.
I created an example, with a setTimout simulating a pre-loader display time.
However, in the example, the preloader is not overlapping the section, but pushing it down.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Template</title>
<meta name="description" content="Description of site" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>
<body>
<div class="content">
<header id="header">
</header>
<main id="main">
<nav id="nav-left">
</nav>
<article id="article">
<div id="breadcrumb">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item active" aria-current="page">Dashboard</li>
</ol>
</nav>
</div>
<div id="preloader" class="page-loader-wrapper">
<div class="loader">
<div class="loader-wheel"></div>
<div class="loader-text"></div>
</div>
</div>
<section id="section"></section>
<footer id="footer">Footer</footer>
</article>
</main>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script>
let loader = document.getElementById('preloader');
setTimeout(function(){ loader.style.display = 'none'; }, 1500);
</script>
</body>
</html>
<style>
body {
height: 100vh;
width: 100%;
overflow: hidden;
}
#content {
background-color: #fff;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
height: 100%;
}
#header {
border-bottom: 1px solid transparent;
background-color: #404bb3;
color: #fff;
}
#media (min-width: 768px) {
#header {
height: 3.5rem;
}
}
#media (min-width: 768px) {
#main {
height: calc(100vh - 3.5rem);
}
}
#main {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
height: calc(100vh - 3rem);
z-index: 0;
}
#media (min-width: 768px) {
#nav-left {
position: relative;
}
}
#nav-left {
background-color: #fff;
border-right: 1px solid #000;
z-index: 9000;
min-width: 15.625rem;
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-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
#media (min-width: 768px) {
#article {
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
width: calc(100vw - 15.625rem);
}
}
#article {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
width: 100%;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
}
#breadcrumb {
border-bottom: 1px solid #000;
padding: 0 15px;
-webkit-box-flex: 0;
-ms-flex: 0 1 3rem;
flex: 0 1 3rem;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.breadcrumb {
background-color: transparent;
margin: 0;
padding: 0;
}
/* loading */
.page-loader-wrapper {
align-items: center;
background-color: black;
display: flex;
height: 87%;
justify-content: center;
margin: 0;
opacity: 0.5;
}
.loader {
width: 60px;
}
.loader-wheel {
animation: spin 1s infinite linear;
border: 2px solid rgb(212 216 245);
border-left: 4px solid #404bb3;
border-radius: 50%;
height: 50px;
margin-bottom: 10px;
width: 50px;
}
.loader-text {
color: #404bb3;
font-family: arial, sans-serif;
}
#section {
background-color: #9932cc;
border-bottom: 1px solid #000;
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
padding: 15px 0;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
overflow-x: hidden;
overflow-y: auto;
}
#media (min-width: 768px) {
#footer {
padding: 0 1rem;
-webkit-box-pack: justify;
-ms- flex-pack: justify;
justify-content: space-between;
}
}
#footer {
font-size: 80%;
-webkit-box-flex: 0;
-ms-flex: 0 1 3rem;
flex: 0 1 3rem;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
</style>
For this to work as you expect, I would do the following:
Make the section position: relative;
Remove the preloader from the DOM, so it's only added when needed
Move the prelaoder inside of the section, so it can be positioned relative to that (when it appears)
Modify preloader CSS, so its position: absolute;
// extract preloader from DOM
const preloader = `
<div id="preloader" class="page-loader-wrapper">
<div class="loader">
<div class="loader-wheel"></div>
<div class="loader-text"></div>
</div>
</div>
`
$('#addPreloader').on('click', function() {
// add preloader
$('#section').append(preloader);
// remove preloader after 1500 ms
setTimeout(function() {
$('#preloader').remove()
}, 1500);
})
body {
height: 100vh;
width: 100%;
overflow: hidden;
}
#content {
background-color: #fff;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
height: 100%;
}
#header {
border-bottom: 1px solid transparent;
background-color: #404bb3;
color: #fff;
}
#media (min-width: 768px) {
#header {
height: 3.5rem;
}
}
#media (min-width: 768px) {
#main {
height: calc(100vh - 3.5rem);
}
}
#main {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
height: calc(100vh - 3rem);
z-index: 0;
}
#media (min-width: 768px) {
#nav-left {
position: relative;
}
}
#nav-left {
background-color: #fff;
border-right: 1px solid #000;
z-index: 9000;
min-width: 15.625rem;
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-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
#media (min-width: 768px) {
#article {
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
width: calc(100vw - 15.625rem);
}
}
#article {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
width: 100%;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
}
#breadcrumb {
border-bottom: 1px solid #000;
padding: 0 15px;
-webkit-box-flex: 0;
-ms-flex: 0 1 3rem;
flex: 0 1 3rem;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.breadcrumb {
background-color: transparent;
margin: 0;
padding: 0;
}
/* loading */
.page-loader-wrapper {
align-items: center;
background-color: black;
display: flex;
justify-content: center;
margin: 0;
opacity: 0.5;
height: 100%;
width: 100%;
position: absolute;
top: 0;
left: 0;
}
.loader {
width: 60px;
}
.loader-wheel {
animation: spin 1s infinite linear;
border: 2px solid rgb(212 216 245);
border-left: 4px solid #404bb3;
border-radius: 50%;
height: 50px;
margin-bottom: 10px;
width: 50px;
}
.loader-text {
color: #404bb3;
font-family: arial, sans-serif;
}
#section {
background-color: #9932cc;
border-bottom: 1px solid #000;
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
padding: 15px 0;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
overflow-x: hidden;
overflow-y: auto;
position: relative;
}
#media (min-width: 768px) {
#footer {
padding: 0 1rem;
-webkit-box-pack: justify;
-ms- flex-pack: justify;
justify-content: space-between;
}
}
#footer {
font-size: 80%;
-webkit-box-flex: 0;
-ms-flex: 0 1 3rem;
flex: 0 1 3rem;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
<!DOCTYPE html>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<div class="content">
<header id="header">
</header>
<main id="main">
<nav id="nav-left">
</nav>
<article id="article">
<div id="breadcrumb">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item active" aria-current="page">Dashboard</li>
</ol>
</nav>
</div>
<section id="section"></section>
<footer id="footer">
Footer
<button id="addPreloader">ADD PRELOADER</button>
</footer>
</article>
</main>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

<li> tag with flex, custom bullet icon and bold text

Everything seems to be working but as soon as I create bold text either with <strong> or <span> inside the <li> tag - it ignores the space that should have been between words because I'm using flex.
I have tried every possible justify-content on the <li> tag and didn't come up with a solution to this.
HTML:
<div class="bullets">
<ul>
<li><strong>100X</strong> More Powerful</li>
<li>Say <strong>No</strong> To Plastic</li>
<li>Fits <strong>99.9%</strong> On The Market</li>
<li>Saves Approximately <strong>8 Hours A Year</strong></li>
<li>Durable Like <strong>$3,000</strong> Worth</li>
</ul>
</div>
CSS:
.bullets {
display: flex;
flex-flow: column wrap;
font-size: 18px;
ul {
list-style: none;
li {
display: flex;
align-items: center;
padding-left: 16px;
}
li:not(:first-of-type) {
margin-top: 15px;
}
li:before {
content: "";
background-image: url('https://cdn.shopify.com/s/files/1/0493/4605/2261/files/checkmark.svg?v=1600908500');
background-size: 24px 21px;
margin-left: -16px;
width: 24px;
height: 21px;
margin-right: 10px;
}
}
}
https://jsfiddle.net/z2r6j4ts/
You may use a gap
.bullets {
display: -webkit-box;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
flex-flow: column wrap;
font-size: 18px;
}
.bullets ul {
list-style: none;
}
.bullets ul li {
display: -webkit-box;
display: flex;
-webkit-box-align: center;
align-items: center;
padding-left: 16px;
gap: 0.25em;
}
.bullets ul li:not(:first-of-type) {
margin-top: 15px;
}
.bullets ul li:before {
content: "";
background-image: url("https://cdn.shopify.com/s/files/1/0493/4605/2261/files/checkmark.svg?v=1600908500");
background-size: 24px 21px;
margin-left: -16px;
width: 24px;
height: 21px;
margin-right: 10px;
}
<div class="bullets">
<ul>
<li><strong>100X</strong> More Powerful</li>
<li>Say <strong>No</strong> To Plastic</li>
<li>Fits <strong>99.9%</strong> On The Market</li>
<li>Saves Approximately <strong>8 Hours A Year</strong></li>
<li>Durable Like <strong>$3,000</strong> Worth</li>
</ul>
</div>
edit
examples from below comments :
flex-wrap/white-space
.bullets {
display: -webkit-box;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
flex-flow: column wrap;
font-size: 18px;
}
.bullets ul {
list-style: none;
}
.bullets ul li {
display: -webkit-box;
display: flex;
flex-wrap: wrap;
-webkit-box-align: center;
align-items: center;
padding-left: 16px;
gap: 0.25em;
white-space: nowrap;
}
.bullets ul li:not(:first-of-type) {
margin-top: 15px;
}
.bullets ul li:before {
content: "";
background-image: url("https://cdn.shopify.com/s/files/1/0493/4605/2261/files/checkmark.svg?v=1600908500");
background-size: 24px 21px;
margin-left: -16px;
width: 24px;
height: 21px;
margin-right: 10px;
}
<div class="bullets">
<ul>
<li><strong>100X</strong> More Powerful</li>
<li>Say <strong>No</strong> To Plastic</li>
<li>Fits <strong>99.9%</strong> On The Market</li>
<li>Saves Approximately <strong>8 Hours A Year </strong>8 Hours A Year 8 Hours A Year 8 Hours A Year</li>
<li>Durable Like <strong>$3,000</strong> Worth</li>
</ul>
</div>
flex-wrap only
.bullets {
display: -webkit-box;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
flex-flow: column wrap;
font-size: 18px;
}
.bullets ul {
list-style: none;
}
.bullets ul li {
display: -webkit-box;
display: flex;
flex-wrap: wrap;
-webkit-box-align: center;
align-items: center;
padding-left: 16px;
gap: 0.25em;
}
.bullets ul li:not(:first-of-type) {
margin-top: 15px;
}
.bullets ul li:before {
content: "";
background-image: url("https://cdn.shopify.com/s/files/1/0493/4605/2261/files/checkmark.svg?v=1600908500");
background-size: 24px 21px;
margin-left: -16px;
width: 24px;
height: 21px;
margin-right: 10px;
}
<div class="bullets">
<ul>
<li><strong>100X</strong> More Powerful</li>
<li>Say <strong>No</strong> To Plastic</li>
<li>Fits <strong>99.9%</strong> On The Market</li>
<li>Saves Approximately <strong>8 Hours A Year </strong>8 Hours A Year 8 Hours A Year 8 Hours A Year</li>
<li>Durable Like <strong>$3,000</strong> Worth</li>
</ul>
</div>
Add these line to your CSS code:
li > strong{ margin: 0 2px; }
You can add the following code to make spacing work:
li {
strong {
margin: 0 .25rem;
}
}

How to remove the text-decoration underline on a flex child when the parent is the anchor?

I am trying to remove the text-decoration of a flex child when the parent is the anchor. I've tried all of the following code, and it is not working at all. I've created a jsFiddle, and on that the underline shows all the time and not on hover. In my WordPress installation, it only shows on hover. I'm really not sure what to do! Any help is appreciated!
Thank you ahead of time!!!!
.fleximagebox_link:hover, a.fleximagebox_link:hover, a .fleximagebox_link:hover,
.fleximagebox_link a:hover, .fleximagebox_link:hover a,
a .fleximagebox_link p:hover, .image_background:hover, .image_background:hover a,
a .image_background:hover, .image_background.fleximagebox_link a:hover,
a .image_background.fleximagebox_link:hover {
text-decoration: none!important;
}
Here is the jsFiddle that explains what I'm talking about: https://jsfiddle.net/Clare12345/th60mde3/2/
This will get rid of the underline in your fiddle .flexbox_images a { text-decoration: none; }
As to why it's on your website, all we can do is guess if you don't include the code or a link to your site. But you might try changing that line to .flexbox_images a, .flexbox_images a:hover { text-decoration: none !important; }
.flexbox_images a {
text-decoration: none;
}
.main_box {
background: white;
height: 400px;
width: 100%;
margin: 0 auto;
padding: 0px;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
overflow: hidden;
}
.main_box .flexbox_images {
color: white;
width: 100%;
padding: 0px;
overflow: auto;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.flexbox_images a {
-webkit-box-flex: 1;
-moz-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
width: 100%;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.image_background {
height: 250px;
margin: 0 auto;
-webkit-box-flex: 1;
-moz-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
max-width: 101%;
}
.image_background_left {
background-repeat: no-repeat;
background-size: contain;
background-image: url(http://pipsum.com/350x240.jpg);
justify-content: flex-end;
margin-right: -1px;
}
.image_background_right {
background-repeat: no-repeat;
background-size: contain;
background-image: url(http://pipsum.com/350x240.jpg);
justify-content: flex-start;
margin-left: -1px;
}
.fleximagebox_link {
font-size: 28pt;
background: rgba(255, 255, 255, 0.85);
color: #000!important;
text-transform: uppercase;
font-weight: 900;
letter-spacing: 1.5px;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
width: 130px;
}
.image_background_left .fleximagebox_link {
justify-content: flex-end;
padding-left: 35px;
}
.image_background_right .fleximagebox_link {
justify-content: flex-start;
padding-right: 35px;
}
.image_background_right .fleximagebox_link p {
font-size: 28pt!important;
color: #000!important;
text-transform: uppercase;
font-weight: 900;
letter-spacing: 1.5px;
margin-bottom: 0px;
}
.main_black_bar {
width: 3px;
background: #000;
height: 50px;
margin-top: 15px;
margin-bottom: 15px;
margin-left: -1px;
}
.image_background_left .main_black_bar {
margin-left: 35px;
}
.image_background_right .main_black_bar {
margin-right: 35px;
}
<div class="main_box">
<div class="flexbox_images">
<a href="">
<div class="image_background image_background_left">
<div class="fleximagebox_link">Buy
<div class="main_black_bar"> </div>
</div>
</div>
</a>
<a href="">
<div class="image_background image_background_right">
<div class="fleximagebox_link">
<div class="main_black_bar"> </div>Sell</div>
</div>
</a>
</div>
</div>

Flexbox, center several elements vertically (as one)

I have a container with several elements inside. I want to center these elements vertically, as a group. Can this be done with flexbox and if so, how?
Here is a demo:
.container {
margin: 0 auto;
width: 700px;
height: 600px;
background: #ebebeb;
flex-direction: column;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-ms-flex-align: center;
-webkit-align-items: center;
-webkit-box-align: center;
align-items: center;
}
.btn {
display: inline-block;
padding: 5px 10px;
padding: 0.3125rem 0.625rem;
background: #129c87;
color: #fff;
border: 1px solid #999;
border-radius: 2px;
font-weight: 600;
text-align: center;
outline: none;
border: none;
cursor: pointer;
font-family: Arial;
}
<div class="container">
<h1>Center me and my paragraphs plz</h1>
<p>First paragraph is always first</p>
<p>Then comes the second</p>
<a class="btn" href="#">Read more</a>
</div>
You just need justify-content:center;
fiddle: https://jsfiddle.net/w64ks4x7/
.container {
margin: 0 auto;
width: 700px;
height: 600px;
background: #ebebeb;
flex-direction: column;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-ms-flex-align: center;
-webkit-align-items: center;
-webkit-box-align: center;
align-items: center;
justify-content:center;
}

Resources