Text under icon, flexbox - flexbox

I want my text to center under my icons but won't get my flexbow to work.
Right now the text is horizontal on the right side of the icon, but I want it to be underneath.
Here is my code.
HTML:
<section class="portfolio-section-green">
<div class="project-card" href="#">
<h4>FOR MORE</h4>
<div class="for-more-wrapper">
<a class="for-more-icon" href ="https://www.linkedin.com/in/johanna-rexin-56207144/">
<img src="./images/linkedin.svg" alt="linkedin" />
</a>
<p class="for-more-name">LINKEDIN</p>
<a class ="for-more-icon" href ="https://github.com/johannarexin">
<img src="./images/github.svg" alt="github" />
</a>
<p class="for-more-name">GITHUB</p>
<a class="for-more-icon" href ="https://stackoverflow.com/c/technigo/users/144/?tab=profile">
<img src="./images/stack_overflow.svg" alt="stack overflow" />
</a>
<p class="for-more-name">STACK OVERFLOW</p>
</div>
</div>
</section>
CSS:
.for-more-wrapper {
display: flex;
}
.for-more-icon {
height: 50px;
width: 50px;
}
.for-more-name {
display: flex;
flex-direction: column;
justify-content: center;
}

The problem is you haven't specified the align-items: center.
When you have normal flex layout (without the column as the direction), then you use justify-content: center, for horizontally centered alignment.
But when you use the flex-direction: column, you are changing the whole flow of the layout, so the justify-content works for vertical alignment and align-items property works for horizontal alignment.
Here's a small demo:
body {
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
<div class="container">
<img src="https://pngimg.com/uploads/square/square_PNG19.png" width="50px" height="50px" />
<span>Some text</span>
</div>
For your code, I have made some modifications to your code:
.for-more-wrapper {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 7px;
font-family: sans-serif;
font-size: 0.8em;
}
.for-more-icon {
height: 50px;
width: 50px;
}
.for-more-links {
display: flex;
justify-content: center;
gap: 50px;
}
<section class="portfolio-section-green">
<div class="project-card" href="#">
<h4>FOR MORE</h4>
<div class="for-more-links">
<div class="for-more-wrapper">
<a href ="https://www.linkedin.com/in/johanna-rexin-56207144/">
<img class="for-more-icon" src="https://pngimg.com/uploads/square/square_PNG19.png" alt="linkedin" />
</a>
<p class="for-more-name">LINKEDIN</p>
</div>
<div class="for-more-wrapper">
<a href="https://github.com/johannarexin">
<img class="for-more-icon" src="https://pngimg.com/uploads/square/square_PNG19.png" alt="github" />
</a>
<p class="for-more-name">GITHUB</p>
</div>
<div class="for-more-wrapper">
<a class="for-more-icon" href ="https://stackoverflow.com/c/technigo/users/144/?tab=profile">
<img class="for-more-icon" src="https://pngimg.com/uploads/square/square_PNG19.png" alt="stack overflow" />
</a>
<p class="for-more-name">STACK OVERFLOW</p>
</div>
</div>
</div>
</section>

Related

why is flexbox not vertically and horizontally not working?

Hi I'm trying to vertically and horizontally center a grid div by using flexbox inside a another div with a background image. It goes to the top left.
.flex_center {
display: flex;
align-items: center;
justify-content: center;
background-color: coral;
opacity: 0.7;
width: 1300px;
height: 485px;
z-index: 0;
}
.grid {
display: grid;
grid-gap: 10px;
grid-template-rows: 161px 161px 161px;
grid-template-columns: 360px 940px;
background-color: coral;
}
<section class="hero">
<div class="flex_center">
<div class="grid">
<div class="grid-item-1"><img src="images/logo_hero.png" class="logo_center"></div>
<div class="grid-item-2">
<p class="center">KIA'PALANO SEAFOODS</p>
</div>
<div class="grid-item-3">
<p class="squamish">A Squamish tribal-owned seafood company <br> located along the Squamish River, B.C</p>
</div>
<div class="grid-item-4">
<div class="button">COME ON IN</div>
</div>
</div>
</div>
</section>

My Sidebar is getting behind the content and webpage is losing responsiveness

I'm a newbie.So, I tried putting CSS cards on a page that has a sidebar. I used Html & CSS flexbox. First I made them separately and they were perfectly fine and responsive. When I tried merging the both in a single page, the cards came in front of the navbar and the page overall loses its responsiveness too, as the cards lose their form. So, how can I fix this issue?
:root{
font-size: 16px;
font-family: 'Courier New', Courier, monospace;
--text-primary: #b6b6b6;
--text-secondary: #ececec;
--bg-primary: #152238;
--bg-secondary: #141418;
--transition-speed: 600ms;
box-sizing: border-box;
margin: 0;
padding: 0;
}
body{
color: black;
margin: 0;
padding: 0;
background-color: #bbff99;
background-image: linear-gradient(319deg, #bbff99 0%, #ffec99 37%, #ff9999 100%);
background-size: cover;
}
/* Used to colorize the browser scrollbar*/
body::-webkit-scrollbar{
width: 0.45rem;
}
body::-webkit-scrollbar-track{
background: #1e1e24;
}
body::-webkit-scrollbar-thumb{
background: #6649b8;
}
main{
margin-left: 5rem;
padding: 1rem;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.todima{
position: relative;
top: 5rem;
text-align: center;
}
.navbar{
width: 4.5rem;
height: 100vh;
position: fixed;
background-color: var(--bg-primary);
transition: width 200ms ease;
}
.navbar-nav {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
}
.logo{
font-weight: bold;
text-transform: uppercase;
margin-top: 1rem;
margin-bottom: 1rem;
text-align: center;
width: 100%;
font-size: 1.5rem;
letter-spacing: 0.3ch;
}
.navbar-item{
width: 100%;
}
.navbar-item:last-child{
margin-top: auto;
}
.nav-link{
display: flex;
align-items: center;
height: 5rem;
color: var(--text-primary);
text-decoration: none;
filter: grayscale(100%) opacity(0.7);
transition: var(--transition-speed);
}
.nav-link:hover{
filter: grayscale(0%) opacity(1);
background: #0a304a;
}
.link-text{
display: none;
margin-left: 0.5rem;
}
.nav-link i{
min-width: 2rem;
margin: 0 1rem;
}
.navbar:hover{
width: 16rem;
}
.navbar:hover .link-text{
display: block;
}
.fas{
color: #F98125;
transition:var(--transition-speed);
}
.a1{
font-family: 'Major Mono Display', monospace;
}
h1{
font-family: 'Pacifico', cursive;
margin: 7px;
margin-left: 12px;
font-size: 36px;
color:#0B1354;
}
p{
margin: 7px;
margin-left: 10px;
font-size: 28px;
font-family: 'Caveat', cursive;
color: #660F56;
}
.cardcont{
background: #FFFAFA;
width: 450px;
margin: 40px;
border-radius: 7px;
perspective: 1px;
overflow: hidden;
border: 8px solid transparent;
}
.cardcont:link {
text-decoration: none;
}
.cardcont:visited {
text-decoration: none;
}
.cardcont:hover{
border-width: 8px;
border-style: outset;
border-left-color: #e975a8;
border-top-color:#e975a8 ;
border-bottom-color: #7ddff8;
border-right-color: #7ddff8;
transition: 0.5s;
}
.container{
position: relative;
top: 5rem;
display: flex;
justify-content: center;
flex-wrap: wrap;
}
.card-image{
height: 200px;
margin-top: 7px;
margin: 6px;
}
.image-1{
background-image: url(dashboardprofile.png);
}
.image-2{
background-image: url(picks.png);
}
.image-3{
background-image: url(http://www.simpleimageresizer.com/_uploads/photos/b5f9c7fc/pexels-suzy-hazelwood-1130980_450x130.jpg);
}
.image-4{
background-image: url(contributor.png);
}
.image-5{
background-image: url(request.png);
}
.image-6{
background-image: url(logout.png);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dashboard withh Cards</title>
<!-- <link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous"> -->
<script src="https://kit.fontawesome.com/7d904839de.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="mergerdraft.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght#600&family=Major+Mono+Display&family=Pacifico&display=swap" rel="stylesheet">
</head>
<body>
<nav class="navbar">
<ul class="navbar-nav">
<li class="logo">
<a href="#" class="nav-link">
<span class="link-text logo-text">Cuet Course Insights</span>
</a>
</li>
<li class="navbar-item">
<a href="#" class="nav-link">
<i class="fas fa-home fa-2x"></i>
<span class="link-text">Home</span>
</a>
</li>
<li class="navbar-item">
<a href="#" class="nav-link">
<i class="fas fa-user-circle fa-2x"></i>
<span class="link-text">Profile</span>
</a>
</li>
<li class="navbar-item">
<a href="#" class="nav-link">
<i class="fas fa-file-download fa-2x"></i>
<span class="link-text">Download books</span>
</a>
</li>
<li class="navbar-item">
<a href="#" class="nav-link">
<i class="fas fa-exclamation-triangle fa-2x"></i>
<span class="link-text">Report an issue</span>
</a>
</li>
<li class="navbar-item">
<a href="#" class="nav-link">
<i class="fas fa-sign-out-alt fa-2x"></i>
<span class="link-text">Log Out</span>
</a>
</li>
</ul>
</nav>
<main>
<section class="todima">
<h1 class="a1">Welcome to your dashboard</h1>
<p>Glad to have you here. Hope you make the best use of your time. </p>
</section>
<section class="container">
<a href="dashboard.html" class="cardcont"><div class="card">
<div class="card-image image-1"></div>
<h1>Profile</h1>
<p>Visit your profile and all related information in this tab</p>
</div></a>
<a href="" class="cardcont"><div class="card">
<div class="card-image image-2"></div>
<h1>Your Picks</h1>
<p>See your specially hand-picked items, without the peril of following all the steps.</p>
</div></a>
<a href="" class="cardcont"><div class="card">
<div class="card-image image-3"></div>
<h1>Course materials</h1>
<p>Find and read the Books, Previous year Questions, Notes of all the toppers from our vast library of resources. In short, GO FOR GLORY!</p>
</div></a>
<a href="" class="cardcont"><div class="card">
<div class="card-image image-4"></div>
<h1>Be a Contributor</h1>
<p>Wanna contribute to the community? No one ever regrets it, by helping others who might be in need. Go on!</p>
</div></a>
<a href="" class="cardcont"><div class="card">
<div class="card-image image-5"></div>
<h1>Request materials</h1>
<p>Click here to reach us. Request content(question papers, books) for any course of any department and we'll hear you out. Just fill up the details.</p>
</div></a>
<a href="" class="cardcont"><div class="card">
<div class="card-image image-6"></div>
<h1>Log Out</h1>
<p>All done? Then we guess there's nothing holding you back.</p>
</div></a>
</section>
</main>
</body>
</html>
The simplified rule is that elements in the HTML file will be created in the order that they appear. If elements overlap, the newer element would be drawn on top of the older element.
That's the problem here. The navigation gets created, then the main contents gets created. So the main contents gets priority when those overlap.
We can change that behaviour by overwriting the order. We do that via CSS using the z-index property. Items with a higher z-index will be drawn over items with a lower z-index. The usual method is to set the z-index very high (e.g. 10000) so that the element with that z-index would appear above everything else.
The only change is that I've added z-index: 10000; to .navbar:
:root{
font-size: 16px;
font-family: 'Courier New', Courier, monospace;
--text-primary: #b6b6b6;
--text-secondary: #ececec;
--bg-primary: #152238;
--bg-secondary: #141418;
--transition-speed: 600ms;
box-sizing: border-box;
margin: 0;
padding: 0;
}
body{
color: black;
margin: 0;
padding: 0;
background-color: #bbff99;
background-image: linear-gradient(319deg, #bbff99 0%, #ffec99 37%, #ff9999 100%);
background-size: cover;
}
/* Used to colorize the browser scrollbar*/
body::-webkit-scrollbar{
width: 0.45rem;
}
body::-webkit-scrollbar-track{
background: #1e1e24;
}
body::-webkit-scrollbar-thumb{
background: #6649b8;
}
main{
margin-left: 5rem;
padding: 1rem;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.todima{
position: relative;
top: 5rem;
text-align: center;
}
.navbar{
width: 4.5rem;
height: 100vh;
position: fixed;
background-color: var(--bg-primary);
transition: width 200ms ease;
z-index: 10000;
}
.navbar-nav {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
}
.logo{
font-weight: bold;
text-transform: uppercase;
margin-top: 1rem;
margin-bottom: 1rem;
text-align: center;
width: 100%;
font-size: 1.5rem;
letter-spacing: 0.3ch;
}
.navbar-item{
width: 100%;
}
.navbar-item:last-child{
margin-top: auto;
}
.nav-link{
display: flex;
align-items: center;
height: 5rem;
color: var(--text-primary);
text-decoration: none;
filter: grayscale(100%) opacity(0.7);
transition: var(--transition-speed);
}
.nav-link:hover{
filter: grayscale(0%) opacity(1);
background: #0a304a;
}
.link-text{
display: none;
margin-left: 0.5rem;
}
.nav-link i{
min-width: 2rem;
margin: 0 1rem;
}
.navbar:hover{
width: 16rem;
}
.navbar:hover .link-text{
display: block;
}
.fas{
color: #F98125;
transition:var(--transition-speed);
}
.a1{
font-family: 'Major Mono Display', monospace;
}
h1{
font-family: 'Pacifico', cursive;
margin: 7px;
margin-left: 12px;
font-size: 36px;
color:#0B1354;
}
p{
margin: 7px;
margin-left: 10px;
font-size: 28px;
font-family: 'Caveat', cursive;
color: #660F56;
}
.cardcont{
background: #FFFAFA;
width: 450px;
margin: 40px;
border-radius: 7px;
perspective: 1px;
overflow: hidden;
border: 8px solid transparent;
}
.cardcont:link {
text-decoration: none;
}
.cardcont:visited {
text-decoration: none;
}
.cardcont:hover{
border-width: 8px;
border-style: outset;
border-left-color: #e975a8;
border-top-color:#e975a8 ;
border-bottom-color: #7ddff8;
border-right-color: #7ddff8;
transition: 0.5s;
}
.container{
position: relative;
top: 5rem;
display: flex;
justify-content: center;
flex-wrap: wrap;
}
.card-image{
height: 200px;
margin-top: 7px;
margin: 6px;
}
.image-1{
background-image: url(dashboardprofile.png);
}
.image-2{
background-image: url(picks.png);
}
.image-3{
background-image: url(http://www.simpleimageresizer.com/_uploads/photos/b5f9c7fc/pexels-suzy-hazelwood-1130980_450x130.jpg);
}
.image-4{
background-image: url(contributor.png);
}
.image-5{
background-image: url(request.png);
}
.image-6{
background-image: url(logout.png);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dashboard withh Cards</title>
<!-- <link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous"> -->
<script src="https://kit.fontawesome.com/7d904839de.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="mergerdraft.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght#600&family=Major+Mono+Display&family=Pacifico&display=swap" rel="stylesheet">
</head>
<body>
<nav class="navbar">
<ul class="navbar-nav">
<li class="logo">
<a href="#" class="nav-link">
<span class="link-text logo-text">Cuet Course Insights</span>
</a>
</li>
<li class="navbar-item">
<a href="#" class="nav-link">
<i class="fas fa-home fa-2x"></i>
<span class="link-text">Home</span>
</a>
</li>
<li class="navbar-item">
<a href="#" class="nav-link">
<i class="fas fa-user-circle fa-2x"></i>
<span class="link-text">Profile</span>
</a>
</li>
<li class="navbar-item">
<a href="#" class="nav-link">
<i class="fas fa-file-download fa-2x"></i>
<span class="link-text">Download books</span>
</a>
</li>
<li class="navbar-item">
<a href="#" class="nav-link">
<i class="fas fa-exclamation-triangle fa-2x"></i>
<span class="link-text">Report an issue</span>
</a>
</li>
<li class="navbar-item">
<a href="#" class="nav-link">
<i class="fas fa-sign-out-alt fa-2x"></i>
<span class="link-text">Log Out</span>
</a>
</li>
</ul>
</nav>
<main>
<section class="todima">
<h1 class="a1">Welcome to your dashboard</h1>
<p>Glad to have you here. Hope you make the best use of your time. </p>
</section>
<section class="container">
<a href="dashboard.html" class="cardcont"><div class="card">
<div class="card-image image-1"></div>
<h1>Profile</h1>
<p>Visit your profile and all related information in this tab</p>
</div></a>
<a href="" class="cardcont"><div class="card">
<div class="card-image image-2"></div>
<h1>Your Picks</h1>
<p>See your specially hand-picked items, without the peril of following all the steps.</p>
</div></a>
<a href="" class="cardcont"><div class="card">
<div class="card-image image-3"></div>
<h1>Course materials</h1>
<p>Find and read the Books, Previous year Questions, Notes of all the toppers from our vast library of resources. In short, GO FOR GLORY!</p>
</div></a>
<a href="" class="cardcont"><div class="card">
<div class="card-image image-4"></div>
<h1>Be a Contributor</h1>
<p>Wanna contribute to the community? No one ever regrets it, by helping others who might be in need. Go on!</p>
</div></a>
<a href="" class="cardcont"><div class="card">
<div class="card-image image-5"></div>
<h1>Request materials</h1>
<p>Click here to reach us. Request content(question papers, books) for any course of any department and we'll hear you out. Just fill up the details.</p>
</div></a>
<a href="" class="cardcont"><div class="card">
<div class="card-image image-6"></div>
<h1>Log Out</h1>
<p>All done? Then we guess there's nothing holding you back.</p>
</div></a>
</section>
</main>
</body>
</html>
The second question is about handling different screen sizes. The best way to do that is via CSS media queries. Those allow you to add a set of rules to your CSS file, which will only be processed if they match your condition(s).
For example, if you want to run some rules if the page width is 700px or narrower, you would do this:
#media (max-width: 700px) {
.cardcont {
background-color: black;
}
}
You can have multiple media queries and each one can have multiple conditions. Media queries are usually put at the end of the CSS file, because that allows you to overwrite earlier rules.
I would suggest that you use those to make changes to the page at small sizes. Examples changes would be:
Removing the margin from .cardcont.
Move the navigation to the top of the page.

How to open modal window by clicking on SVG element

I've got a complex SVG that is the floor plan of a building. I'd like to create modal windows or popups that provide a small description of the different rooms in the building.
The question: how do I add a boostrap modal (or other popup) on click of a or inside the SVG? I've tried adding the modal code within a tag but that doesn't seem to be working.
<rect data-toggle="modal" data-target="#section-h-modal" id="section-h" x="112.6" y="31.4" class="mapsvg-region" width="35.2" height="69.3" style="vector-effect: non-scaling-stroke; fill: rgb(0, 125, 186);">
<foreignobject class="node" x="46" y="22" width="100" height="100">
<div id="section-h-modal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">x</button>
<h4 class="modal-title">Modal Header</h4>
</div>
<div class="modal-body">
<p>Some text in the modal.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</foreignobject>
You have used wrong tag to trigger the Modal Know more about
foreignObject
Click Here
and your solution is
here
<svg>
<g>
<a xlink:href="#" class="btn-cta" >
<rect data-toggle="modal" data-target="#section-h-modal" id="section-h"
x="112.6" y="31.4" class="mapsvg-region" width="35.2" height="69.3"
style="vector-effect: non-scaling-stroke; fill: rgb(0, 125, 186);" >
</rect>
</a>
</g>
</svg>
<div class="overlay">
<div class="modal">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button class="close-btn">x</button>
<h4 class="modal-title">Modal Header</h4>
</div>
<div class="modal-body">
<p>Some text in the modal.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-
dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
CSS
.btn-cta {
width: 120px;
display: block;
margin: 0 auto;
text-align: center;
text-transform: uppercase;
font-size: 20px;
padding: 10px;
background: #ccc;
color: #555;
text-decoration: none;
transition: all 0.2s ease-in-out;
}
.overlay {
position: absolute;
height: 100%;
width: 100%;
background: rgba(0, 0, 0, 0.7);
display: flex;
margin-top: -10%;
justify-content: center;
align-items: center;
pointer-events: none;
opacity: 0;
transition: all 0.5s cubic-bezier(0.59, -0.17, 0.3, 1.67);
}
.overlay.is-open {
opacity: 1;
pointer-events: auto;
}
.modal {
transform: translate(0px, -50px);
transition: all 0.7s cubic-bezier(0.59, -0.17, 0.3, 1.67);
position: relative;
padding: 30px;
width: 400px;
background-color: #ddd;
color: #231D23;
text-align: center;
overflow: hidden;
box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.4);
}
.modal .close-btn {
position: absolute;
padding: 3px 9px;
font-size: 24px;
text-align: center;
background: #ccc;
color: #9c9c9c;
top: -1px;
right: 0;
cursor: pointer;
transition: all 0.3s ease-in-out;
}
JQuery
$(function () {
$('.btn-cta').click(function () {
$('.overlay').addClass('is-open');
return false;
});
$('.close-btn').click(function () {
$('.overlay').removeClass('is-open');
});
});
In most libraries, e.g., bootstrap or materialize, you can open modal dialogs via JavaScript codes. For this reason, please read their examples to find out, how to open it.
To allow click events on your svg elements, you have to know, that each of the svg elements is an ordinary dom element. That means, you can access it like a p tag or something similar.
For example, you have a circle in your svg with id circle01. To add an on-click-event, you can use:
$("#circle01").click(function (e) { ... });
via jQuery or
document.getElementById("circle01").onclick = function (e) { ... };
via pure JavaScript.
To understand the magic of svg, you have to know, that it is pure html ;)

column of icons in bootstrap v4

I have a simple column of icons using flexbox in bootstrap v4. It comes up fine, but if you then click on an icon, the position changes slightly. Seems to happen only in chrome. Here is a fiddle:
https://jsfiddle.net/lenb/shr8bk89/10/
`
HTML:
<body>
<div id='no'>
<div id='minus' class="icon" title="Not special.">
<a href="#" id="nHeart">
<img class="img icon" src="http://gps-photo.org/images/Not.svg" />
</a>
</div>
<div id='plus' class="icon" title="Loving it!">
<a href="#" id="heart1">
<img class="img" src="http://gps-photo.org/images/red-304570-1.svg" />
</a>
</div>
<div id='comment-button-div' class="icon" title="Click for comments">
<a class="comment-page" data-toggle="modal">
<img class="img" id='comment-button' src="http://gps-photo.org/images/comments-97860-3.svg" />
</a>
</div>
<div id='info-div1' class="icon" title='Information'>
<a class="info-page" data-toggle="modal">
<img id="info1" class="img" src="http://gps-photo.org/images/information-39064-2.svg" />
</a>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/js/bootstrap.min.js" integrity="sha384-vZ2WRJMwsjRMW/8U7i6PWi6AlO1L79snBrmgiDpgIWJ82z8eA5lenwvxbMV1PAh7" crossorigin="anonymous"></script>
</body>
CSS:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" integrity="sha384-y3tfxAZXuh4HwSYylfB+J125MxIs6mR5FOHamPBG064zB+AFeWH94NdvaCBm8qnd" crossorigin="anonymous">
#removal {
border-color: black;
border-top: 10rem;
}
html,
body {
width: 100%;
height: 100%;
}
#no {
padding: 1rem;
display: flex;
display: -webkit-flex;
flex-wrap: nowrap;
-webkit-flex-wrap: nowrap;
justify-content: space-between;
-webkit-justify-content: space-between;
align-items: center;
-webkit-align-items: center;
align-content: space-between;
-webkit-align-content: space-between;
flex: 1 1 auto;
-webkit-flex: 1 1 auto;
}
.icon {
margin: auto;
flex-grow: 1;
flex-basis: auto;
}
/* // next is for images */
.img {
width: 8vmin;
}
/* // stuff living in #no */
#info-div1 {
order: 3;
-webkit-order: 3;
}
#minus {
order: 0;
-webkit-order: 0;
}
#plus {
order: 1;
-webkit-order: 1;
}
#comment-button-div {
order: 2;
-webkit-order: 2;
}
#no {
flex-direction: column;
-webkit-flex-direction: column;
height: 100%;
max-width: 10rem;
order: 0;
-webkit-order: 0;
}
I see no reason why the positioning should change.
Can someone tell me what is wrong.
Using normalize.css as the 1st to load helps to normalize vertical alignment for Chrome

Flexbox equal width problems

Dear fellow stackoverflowers,
I'm having a peculiar problem I can't seem to find the solution for.
I'm trying to apply the width of the largest div to the smaller divs, so that they appear equal in width, through flexboxing. Unfortunately, all the solutions so far have been futile efforts. Do you have any idea why the different divs in the example I've linked to won't display the same width as the largest element? I know the boxes get their width from the content, but I just can't seem to make them behave the way I want.
HTML
<section id="contact" class="wrapper bgfixed">
<div>
<h1>Contact</h1>
<div id="contactholder">
<a href="#">
<div>
<h1 class="icon-mail"></h1>
<h2>EMAIL</h2>
<p>someonesprofessionalemail#gmail.com</p>
</div>
</a>
<a href="#">
<div>
<h1 class="icon-old-phone"></h1>
<h2>TELEPHONE</h2>
<p>39 88 49 92 91</p>
</div>
</a>
<a href="#">
<div>
<h1 class="icon-facebook2"></h1>
<h2>FACEBOOK</h2>
<p>www.facebooooooooooooooooooook.com/snowman</p>
</div>
</a>
<a href="#">
<div>
<h1 class="icon-soundcloud"></h1>
<h2>LOREM IPSUM</h2>
<p>www.loremipsumyesyesyesblahblabhlabh.com</p>
</div>
</a>
</div>
</div>
</section>
CSS
a{text-decoration: none;}
#contact
{
width: 100%;
height: 82vh;
color: whitesmoke;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
background: #34495e;
}
#contactholder
{
display: flex;
justify-content: space-between;
font-size: 80%;
}
#contactholder div
{
flex: 1;
flex-grow: 1;
font-size: 0.5rem;
}
#contactholder div h1
{
padding: 3rem;
letter-spacing: 0;
display: inline-block;
background-image: linear-gradient(white, 1%, #3498db);
border-radius: 100rem;
box-shadow: 0 1px 1px grey;
transition: 0.3s;
margin-bottom: -0.5rem;
}
#contactholder a:hover h1
{
background-image: linear-gradient(white, 1%, #00A4EB);
text-shadow: 0 1px 1px;
}
Hoping for some brilliant minds!
Best wishes,
Lodott1

Resources