Item moving around when window resized - html

See Umbrella image in images:
Full-size window:
.
Reduced (ideal placement):
I would like to have my umbrella image in the centre of the screen no matter the size of the window.
It works from the point where the window shrinks and works in mobile view too.
I've tried various methods but it doesn't seem to be working, any tips would be greatly appreciated.
Here is my code:
HTML
<div class="wrapper">
<div class="page2">
<h2>Blog</h2>
<div class="wrap">
<div class="card">
<a href="welcome.html">
<img class="card-img" src="str3.jpg">
</a>
<div class="card-text">
<h3>Welcome</h3>
<p>Website Launch and my First Project</p>
</div>
</div>
<div class="card">
<a href="blog.html">
<img class="card-img" src="steve_roe_kyoto.jpg">
</a>
<div class="card-text">
<h3> Kyoto</h3>
<p>My Recent Trip</p>
</div>
</div>
<div class="card">
<a href="best.html">
<img class="card-img" src="str4.jpg">
</a>
<div class="card-text">
<h3>Best of 2018</h3>
<p>Neon Goodness from Last Year</p>
</div>
</div>
</div>
<div class="page3">
<footer>
<div class="umbrella_icon">
<img src="umbrella-02.png">
</div>
<div class="logo_footer">Steve Roe</div>
<div class="footer_menu">
<ul class="ul_footer">
<li>Work With Me</li>
<li>
Contact</li>
</ul>
</div>
</footer>
</div>
</div>
</div>
CSS
.page2{
width: 100%;
margin: 0 auto;
margin-top: 20px;
height: 100%;
}
//cards
.wrap{
width:960px;
margin:auto;
margin-top: 100px;
}
.card{
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.15);
transition: 0.4s;
width: 300px;
text-align: center;
font-size: 16px;
float:left;
margin:10px;
text-decoration: none;
}
.page3{
margin: 20px;
margin-top: 20px;
height: 30%;
}
.umbrella_icon {
text-align: center;
}
.footer {
z-index: 1000;
width: 960px;
margin: 0 auto;
}

Use dispaly:flex to .wrap
See working code
.page2{
width: 100%;
margin: 0 auto;
margin-top: 20px;
height: 100%;
}
.wrap{
margin: auto;
margin-top: 100px;
display: flex;
}
.card{
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.15);
transition: 0.4s;
width: 300px;
text-align: center;
font-size: 16px;
float:left;
margin:10px;
text-decoration: none;
}
.page3{
margin: 20px;
margin-top: 20px;
height: 30%;
}
.umbrella_icon {
text-align: center;
}
.footer {
z-index: 1000;
width: 960px;
margin: 0 auto;
}
<div class="wrapper">
<div class="page2">
<h2>Blog</h2>
<div class="wrap">
<div class="card">
<a href="welcome.html">
<img class="card-img" src="str3.jpg">
</a>
<div class="card-text">
<h3>Welcome</h3>
<p>Website Launch and my First Project</p>
</div>
</div>
<div class="card">
<a href="blog.html">
<img class="card-img" src="steve_roe_kyoto.jpg">
</a>
<div class="card-text">
<h3> Kyoto</h3>
<p>My Recent Trip</p>
</div>
</div>
<div class="card">
<a href="best.html">
<img class="card-img" src="str4.jpg">
</a>
<div class="card-text">
<h3>Best of 2018</h3>
<p>Neon Goodness from Last Year</p>
</div>
</div>
</div>
<div class="page3">
<footer>
<div class="umbrella_icon">
<img src="umbrella-02.png" alt="umbrella">
</div>
<div class="logo_footer">Steve Roe</div>
<div class="footer_menu">
<ul class="ul_footer">
<li>Work With Me</li>
<li>
Contact</li>
</ul>
</div>
</footer>
</div>
</div>
</div>

End The page 2 div before starting page 3 div.
Change the page3 css to
.page3{
margin: 50vh 50vw;
}
<h2>Blog</h2>
<div class="wrap">
<div class="card">
<a href="welcome.html">
<img class="card-img" src="str3.jpg">
</a>
<div class="card-text">
<h3>Welcome</h3>
<p>Website Launch and my First Project</p>
</div>
</div>
<div class="card">
<a href="blog.html">
<img class="card-img" src="steve_roe_kyoto.jpg">
</a>
<div class="card-text">
<h3> Kyoto</h3>
<p>My Recent Trip</p>
</div>
</div>
<div class="card">
<a href="best.html">
<img class="card-img" src="str4.jpg">
</a>
<div class="card-text">
<h3>Best of 2018</h3>
<p>Neon Goodness from Last Year</p>
</div>
</div>
</div>
</div>
<div class="page3">
<footer>
<div class="umbrella_icon">
<img src="umbrella-02.png" alt="umbrella Here">
</div>
<div class="logo_footer">Steve Roe</div>
<div class="footer_menu">
<ul class="ul_footer">
<li>Work With Me</li>
<li>
Contact</li>
</ul>
</div>
</footer>
</div>

Use flex for .wrap like this :
.wrap{
width:960px;
margin:auto;
margin-top: 100px;
display: flex;
justify-content: center;
}
this code make image in center horizontally.

Related

Center horizontally and vertically a div in a section and make each section fill the whole page when scrolling

I am trying to code a page where each section fills the whole page. And I am also trying to center vertically and horizontally the divs in each section.
I don't know if it's possible, if you guys can enlighten me it would be great.
I also would like to know if it's possible that, when I scroll it automatically goes to the next section. I don't know if it's clear enough to understand.
Here's the CSS :
.presta .container {
width: 100%;
position: relative;
}
.presta .h1 {
font-size: 80px;
font-weight: bold;
}
.presta card {
padding: 30px;
margin: 0 auto;
}
.logoPresta:hover {
transition: transform 0.3s ease-in;
transform: translateY(-10px);
}
.prestaShow {
text-align: center;
}
.wrapper {
min-height: 100%;
}
<div class="navbar ">
<div class="container flex">
<div class="logo" data-aos="fade-right">
<img src="images/linko_bg_transp.png" alt="" />
</div>
<nav data-aos="fade-in">
<ul>
<li>Accueil</li>
<li>Présentation</li>
<li>Nos Prestations</li>
<li>Nous contacter</li>
</ul>
</nav>
</div>
</div>
<section class="presta bg-light wrapper">
<div class="container">
<div class="text-center">
<h1>Nos domaines d'expertises</h1>
</div>
<div class="grid grid-4">
<div class="logoPresta card">
<img src="images/1.jpg" alt="">
</div>
<div class="logoPresta card">
<img src="images/2.jpg" alt="">
</div>
<div class="logoPresta card">
<img src="images/3.jpg" alt="">
</div>
<div class="logoPresta card">
<img src="images/4.jpg" alt="">
</div>
</div>
</div>
</section>
<section class="prestaShow wrapper">
<div class="container info">
<div class="text-center">
<h2>Informatique</h2>
</div>
<div class="textePresta card">
Conception & développement d'applications web
</div>
<div class="textePresta card">
Création & amélioration de bases de données
</div>
<div class="textePresta card">
Déploiement d'infrastructures réseaux
</div>
</div>
</section>
Here are the images of the page :
You can resize section to full page height by changing 100% to 100vh
Also, take a look at CSS section to see how to center wrappers' content (expand Code snippet to see differences).
UPD:
.snap-wrapper will help you to scroll full sections, take a look at Code snippet on full-screen.
.presta .container {
width: 100%;
position: relative;
}
.presta .h1 {
font-size: 80px;
font-weight: bold;
}
.presta card {
padding: 30px;
margin: 0 auto;
}
.logoPresta:hover {
transition: transform 0.3s ease-in;
transform: translateY(-10px);
}
.prestaShow {
text-align: center;
}
.wrapper {
/* centering wrapper content */
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
}
/* use .snap-wrapper to scroll page by full sections */
.snap-wrapper {
display: flex;
flex-direction: column;
flex-wrap: nowrap;
scroll-snap-type: y mandatory;
overflow: auto;
height: 100vh;
}
.snap-wrapper > .wrapper {
scroll-snap-align: center;
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<div class="navbar ">
<div class="container flex">
<div class="logo" data-aos="fade-right">
<img src="images/linko_bg_transp.png" alt="" />
</div>
<nav data-aos="fade-in">
<ul>
<li>Accueil</li>
<li>Présentation</li>
<li>Nos Prestations</li>
<li>Nous contacter</li>
</ul>
</nav>
</div>
</div>
<div class="snap-wrapper">
<section class="presta bg-light wrapper">
<div class="container">
<div class="text-center">
<h1>Nos domaines d'expertises</h1>
</div>
<div class="grid grid-4">
<div class="logoPresta card">
<img src="images/1.jpg" alt="">
</div>
<div class="logoPresta card">
<img src="images/2.jpg" alt="">
</div>
<div class="logoPresta card">
<img src="images/3.jpg" alt="">
</div>
<div class="logoPresta card">
<img src="images/4.jpg" alt="">
</div>
</div>
</div>
</section>
<section class="prestaShow wrapper">
<div class="container info">
<div class="text-center">
<h2>Informatique</h2>
</div>
<div class="textePresta card">
Conception & développement d'applications web
</div>
<div class="textePresta card">
Création & amélioration de bases de données
</div>
<div class="textePresta card">
Déploiement d'infrastructures réseaux
</div>
</div>
</section>
</div>

How to rotate first element wit flexbox and make it full-height?

I try to implement this graphic with HTML, CSS using flexbox:
Now, I have trouble with the left part. I don't know how to implement this -90 degrees rotated element. The right part (all elements that are horizontally aligned) is not the problem.
Here is what I have so far:
.container {
max-width: 1176px;
width: 100%!important;
margin: 0 auto!important;
float: none!important;
z-index: 1;
}
.pt {
padding-top: 3.5rem;
/* 56px */
}
.pb {
padding-bottom: 3rem;
/* 48px */
}
.ptms {
padding-top: 1.5rem;
/* 24px */
}
.full-width {
width: 100%;
padding: 0 1.5rem;
}
.three-col {
width: 33.3333334%;
padding: 0 1.5rem;
}
.platform-container,
.platform-card-container {
display: flex;
}
.platform-card-container .three-col,
.platform-card-container .full-width {
padding: 0 .75rem;
}
.platform-card-container a {
text-decoration: none;
}
.platform-card,
.platform-card-first {
border-radius: .5rem;
box-shadow: 0 .25rem .75rem 0 rgba(27, 27, 27, 0.24);
display: flex;
height: 100%;
}
.platform-card {
align-items: center;
}
.platform-card-first {
}
.platform-card-icon {
padding: .75rem;
border-radius: 50%;
background-color: #f5f5f5;
width: 3.5rem;
height: 3.5rem;
min-width: 3.5rem;
}
.platform-card-text {
margin-left: 1rem;
}
.platform-card-text-title {
margin-bottom: .5rem;
color: #1b1b1b;
}
.platform-card-text-desc {
color: #007095;
}
<div class="container platform-container">
<div>
<div class="pt platform-card-container">
<div class="full-width">
<a href="">
<div class="platform-card-first">
<div class="platform-card-icon">
<img src="img/icons/axonivy-website-icon-technology-3d-printing-darkblue.svg">
</div>
<div class="platform-card-text">
<h4 class="platform-card-text-title">Open Architecture</h4>
<div class="platform-card-text-desc">Extend systems as required</div>
</div>
</div>
</a>
</div>
</div>
</div>
<div>
<div class="pt platform-card-container">
<div class="three-col">
<a href="">
<div class="platform-card">
<div class="platform-card-icon">
<img src="img/icons/axonivy-website-icon-design-ruler-triangle-darkblue.svg">
</div>
<div class="platform-card-text">
<h4 class="platform-card-text-title">User Interface</h4>
<div class="platform-card-text-desc">Modern front-end technologies</div>
</div>
</div>
</a>
</div>
<div class="three-col">
<a href="">
<div class="platform-card">
<div class="platform-card-icon">
<img src="img/icons/axonivy-website-icon-mobile-phone-location-darkblue.svg">
</div>
<div class="platform-card-text">
<h4 class="platform-card-text-title">Intelligent Mobility</h4>
<div class="platform-card-text-desc">Mobile and offline access</div>
</div>
</div>
</a>
</div>
<div class="three-col">
<a href="">
<div class="platform-card">
<div class="platform-card-icon">
<img src="img/icons/axonivy-website-icon-network-monitor-team-darkblue.svg">
</div>
<div class="platform-card-text">
<h4 class="platform-card-text-title">Social Collaboration</h4>
<div class="platform-card-text-desc">Efficient teamwork</div>
</div>
</div>
</a>
</div>
</div>
<div class="ptms platform-card-container">
<div class="full-width">
<a href="">
<div class="platform-card">
<div class="platform-card-icon">
<img src="img/icons/axonivy-website-icon-toys-lego-darkblue.svg">
</div>
<div class="platform-card-text">
<h4 class="platform-card-text-title">Low-Code Suppport</h4>
<div class="platform-card-text-desc">Processes without programming</div>
</div>
</div>
</a>
</div>
</div>
<div class="ptms platform-card-container">
<div class="three-col">
<a href="">
<div class="platform-card">
<div class="platform-card-icon">
<img src="img/icons/axonivy-website-icon-multimedia-shuffle-darkblue.svg">
</div>
<div class="platform-card-text">
<h4 class="platform-card-text-title">Business Rule Engine</h4>
<div class="platform-card-text-desc">Intelligent decision making</div>
</div>
</div>
</a>
</div>
<div class="three-col">
<a href="">
<div class="platform-card">
<div class="platform-card-icon">
<img src="img/icons/axonivy-website-icon-programming-module-puzzle-darkblue.svg">
</div>
<div class="platform-card-text">
<h4 class="platform-card-text-title">Integration</h4>
<div class="platform-card-text-desc">Standard connectors and more</div>
</div>
</div>
</a>
</div>
<div class="three-col">
<a href="">
<div class="platform-card">
<div class="platform-card-icon">
<img src="img/icons/axonivy-website-icon-transportation-road-sign-darkblue.svg">
</div>
<div class="platform-card-text">
<h4 class="platform-card-text-title">Adaptive Case Management</h4>
<div class="platform-card-text-desc">Making processes flexible</div>
</div>
</div>
</a>
</div>
</div>
<div class="ptms platform-card-container">
<div class="full-width">
<a href="">
<div class="platform-card">
<div class="platform-card-icon">
<img src="img/icons/axonivy-website-icon-interface-settings-cog-double-darkblue.svg">
</div>
<div class="platform-card-text">
<h4 class="platform-card-text-title">Process Engine</h4>
<div class="platform-card-text-desc">Powerful process automation</div>
</div>
</div>
</a>
</div>
</div>
<div class="ptms platform-card-container">
<div class="full-width">
<a href="">
<div class="platform-card">
<div class="platform-card-icon">
<img src="img/icons/axonivy-website-icon-work-presentation-projector-screen-darkblue.svg">
</div>
<div class="platform-card-text">
<h4 class="platform-card-text-title">Modern Runtime Platform</h4>
<div class="platform-card-text-desc">Environment with container support</div>
</div>
</div>
</a>
</div>
</div>
</div>
Does anyone have a hint on how I should proceed?
I believe these styles are what you want:
text-align: right;
writing-mode: vertical-rl;
transform: rotate(180deg);
text-orientation: mixed;
https://jsfiddle.net/aycq2v8u/
edit: I noticed that the height still wasn't right. (BTW, display:grid makes this sort of thing easier). here's a revision with that fixed as well. although, this does require either ridiculous looking selectors or changes to the html, which I have done here: https://jsfiddle.net/rxgbo4a9/
changes required:
the card container of the first card (that needs to be full height) needs to be different. since it is on the side and generally different content, I marked it as an aside:
<aside class="pt platform-card-container">
then, with that, using minimal changes to your css we get the desired result:
aside.platform-card-container {
height:100%
}
aside.platform-card-container a {
display: flex;
height: 100%
}
note that specifying height instead of using flexbox is not ideal. however, since all your code makes the same mistake, I think you minimize technical debt to keep all the problems of the same type .. ie, keep using height until you are ready to remove it generally.

Bulma - How to put image and text inline

I want text on right and image on left and vice-versa with vertically centered both.
It should look like as follows
Image
Structure
<section>
<div class="columns">
<div class="column is-7">
<!-- Image -->
</div>
<div class="column is-5">
<!-- My hero -->
</div>
</div>
</section>
<section>
<div class="columns">
<div class="column is-5">
<!-- My hero -->
</div>
<div class="column is-7">
<!-- Image -->
</div>
</div>
</section>
In total
(Change CSS according to your needs)
.myBg {
background-color: #273238;
color: white;
border: 1px solid white;
}
.myHero .hr {
display: inline-block;
width: 100px;
height: 15px;
background: white;
border-radius: 20px;
margin-bottom: 15px;
}
.myHero h1 {
font-size: 50px
}
.myHero.hero-right {
padding-right: 100px;
text-align: right;
}
.myHero.hero-left {
padding-left: 100px;
}
#media(max-width: 768px) {
.myHero {
padding: 100px 50px !important;
//text-align: left !important;
}
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.6.1/css/bulma.min.css">
<section class="myBg">
<div class="columns is-vcentered">
<div class="column is-7">
<figure class="image is-4by3">
<img src="https://i.stack.imgur.com/WpMdM.png" alt="">
</figure>
</div>
<div class="column is-5">
<div class="myHero hero-right">
<div class="hr"></div>
<h1>BOOST</h1>
<ul>
<li>This is the cooles thing.</li>
<li>I am gonna do in my entire life. Awesome!</li>
<li>Achievements are good as heaven. I want it soon.</li>
</ul>
</div>
</div>
</div>
</section>
<section class="myBg">
<div class="columns is-vcentered">
<div class="column is-5">
<div class="myHero hero-left">
<div class="hr"></div>
<h1>BOOST</h1>
<ul>
<li>This is the cooles thing.</li>
<li>I am gonna do in my entire life. Awesome!</li>
<li>Achievements are good as heaven. I want it soon.</li>
</ul>
</div>
</div>
<div class="column is-7">
<figure class="image is-4by3">
<img src="https://i.stack.imgur.com/WpMdM.png" alt="">
</figure>
</div>
</div>
</section>

How to get the horizontal-card-footer div right below other div and not at right

I want to have a structure like this:
But its not working, the image, date, title and subtitle are ok, but then do you know how to put the Image title right below the image and the view and save links below the other texts with the same margin-left of 1rem?
I have here the Example: http://jsfiddle.net/tyyj57gs/6/, the issue should be because the horizontal-card div have display flex but Im not having sucess solving that issue.
Html:
<div class="container pb-4">
<div class="row">
<div class="col-lg-3">
<div class="horizontal-card">
<img src="http://via.placeholder.com/200x100"/>
<div class="horizontal-card-body">
<span class="card-text">Date</span>
<h4 class="card-title">Title</h4>
<span class="card-text">Subtitle</span>
</div>
<div class="horizontal-card-footer">
<span>Image Title</span>
<a class="card-text status">#View</a>
<a class="card-text status">#Save</a>
</div>
</div>
</div>
CSS
.horizontal-card{
display: flex;
border:1px solid gray;
margin-bottom:1rem;
img{
width: 200px;
height: 100px;
border-bottom: 2px solid red;
}
.horizontal-card-body{
display: flex;
flex-direction: column;
margin-left:1rem;
}
}
I did this by using display:inline-block instead of the flex box you had. The sections are broken into two rows. Add style as you wish.
HTML:
<div class="card">
<div class="row">
<div class="innerLeft">
<img src="http://via.placeholder.com/200x100"/>
</div>
<div class="innerRight">
<div class="horizontal-card-footer">
<span class="card-text">Date</span>
<h4 class="card-title">Title</h4>
<span class="card-text">Subtitle</span>
</div>
</div>
</div>
<div class="row">
<div class="innerLeft">
<p>Image Title</p>
</div>
<div class="innerRight">
<a class="card-text status">#View</a>
<a class="card-text status">#Save</a>
</div>
</div>
</div>
CSS:
.card {
display:block;
width:100%;
max-width:800px;
}
img {
width: 100%;
height: auto;
border-bottom: 2px solid orange;
}
.innerLeft {
display:inline-block;
margin-right:-4px;
vertical-align:top;
width:30%;
text-align:center;
padding:5px;
}
.innerRight {
display:inline-block;
vertical-align:top;
width:70%;
text-align:left;
padding:5px;
}
.card-text {
display:inline-block;
}
FIDDLE : http://jsfiddle.net/tyyj57gs/9/
You can create the layout you want using flexbox.
In the snippet below I have restructured your .horizontal-card into .card-left and .card-right.
.horizontal-card {
display: flex;
border: 1px solid gray;
margin-bottom: 1rem;
}
.card-left,
.card-right {
display: flex;
flex-direction: column;
}
.card-right {
width: 100%;
}
.card-left span {
background: orange;
flex: 1;
display: flex;
justify-content: center;
align-items: center;
}
.horizontal-card-body,
.horizontal-card-footer {
padding-left: 1em;
}
img {
width: 200px;
height: 100px;
}
.horizontal-card-footer {
/* Add to ensure the footer is pinned to the bottom of the card */
margin-top: auto;
border-top: 1px solid grey;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet">
<div class="container pb-4">
<div class="row">
<div class="col-lg-3">
<div class="horizontal-card">
<div class="card-left">
<img src="http://via.placeholder.com/200x100" />
<span>Image Title</span>
</div>
<div class="card-right">
<div class="horizontal-card-body">
<span class="card-text">Date</span>
<h4 class="card-title">Title</h4>
<span class="card-text">Subtitle</span>
</div>
<div class="horizontal-card-footer">
<a class="card-text status">#View</a>
<a class="card-text status">#Save</a>
</div>
</div>
</div>
</div>
<div class="container pb-4">
<div class="row">
<div class="col-lg-3">
<div class="horizontal-card">
<div class="card-left">
<img src="http://via.placeholder.com/200x100" />
<span>Image Title</span>
</div>
<div class="card-right">
<div class="horizontal-card-body">
<span class="card-text">Date</span>
<h4 class="card-title">Title</h4>
<span class="card-text">I am a card with a longer subtitle. I am a card with a longer subtitle. I am a card with a longer subtitle. I am a card with a longer subtitle. </span>
</div>
<div class="horizontal-card-footer">
<a class="card-text status">#View</a>
<a class="card-text status">#Save</a>
</div>
</div>
</div>
</div>
<div class="container pb-4">
<div class="row">
<div class="col-lg-3">
<div class="horizontal-card">
<div class="card-left">
<img src="http://via.placeholder.com/200x100" />
<span>Image Title</span>
</div>
<div class="card-right">
<div class="horizontal-card-body">
<span class="card-text">Date</span>
<h4 class="card-title">Title</h4>
<span class="card-text"></span>
</div>
<div class="horizontal-card-footer">
<a class="card-text status">#View</a>
<a class="card-text status">#Save</a>
</div>
</div>
</div>
</div>
Here is my version of the image. Let me know if there are any issues, I have used position absolute for the footer's position.
For the SCSS version of the CSS refer the fiddle, else refer the snippet below!
JSFiddle Demo
.horizontal-card {
position: relative;
display: flex;
border: 1px solid gray;
margin-bottom: 1rem;
}
.horizontal-card img {
width: 200px;
height: 130px;
border-bottom: 30px solid orange;
}
.horizontal-card .horizontal-card-body {
display: flex;
flex-direction: column;
margin-left: 1rem;
}
.horizontal-card .horizontal-card-footer {
position: absolute;
left: 0px;
right: 0px;
bottom: 0px;
height: 30px;
display: flex;
align-items: center;
}
.horizontal-card .horizontal-card-footer span {
width: 200px;
display: inline-block;
}
.horizontal-card .horizontal-card-footer a {
margin-left: 10px;
}
<div class="container pb-4">
<div class="row">
<div class="col-lg-3">
<div class="horizontal-card">
<img src="http://via.placeholder.com/200x100" />
<div class="horizontal-card-body">
<span class="card-text">Date</span>
<h4 class="card-title">Title</h4>
<span class="card-text">Subtitle</span>
</div>
<div class="horizontal-card-footer">
<span>Image Title</span>
<a class="card-text status">#View</a>
<a class="card-text status">#Save</a>
</div>
</div>
</div>

Display elements in a inline-block depend on section width

I have tried for some time to do something like on the image.
Elements (.element) goes down but they are not centered but stick left.
My code now is:
Html:
<div id="_technology_page" class="region">
<div class="actions_container">
<div class="actions">
{{#each actions}}
<div class="action">
<a href="{{link}}">
<img src="/img/technology/grafiki/{{icon}}.png" alt="">
<p class="action_text">
{{text}}
</p>
</a>
</div>
{{/each}}
</div>
</div>
</div>
Css: (scss):
#_technology_page {
.actions_container {
max-width: 100%;
position: relative;
text-align: center;
display: flex;
.actions {
position: relative;
.action {
float: left;
position: relative;
position: relative;
margin: 10px 40px;
text-align: center;
float: left;
height: 300px;
width: 250px;
display: flex;
img {
margin: auto;
width: 120px
}
.action_text {
width: 100%;
color: black;
position: absolute;
bottom: 0;
}
}
}
}
}
I have tried many things, search examples, bot nothing works as I want it to works.
Also, I have tried to do it on Bootstrap grid system, but those elements are still stuck to the left side of the container.
Please provide some examples how to do it, I have no idea how to do it anymore.
using flexbox here is a way simpler code from yours
body {
margin: 0
}
.region {
border: solid;
padding: 50px 0
}
.actions {
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
border: red solid;
padding: 10px;
}
.action {
flex: 0 140px;
height: 140px;
border: orange solid;
margin: 5px;
}
<div id="_technology_page" class="region">
<div class="actions_container">
<div class="actions">
<div class="action">
<a href="{{link}}">
<img src="/img/technology/grafiki/{{icon}}.png" alt="">
<p class="action_text">
</p>
</a>
</div>
<div class="action">
<a href="{{link}}">
<img src="/img/technology/grafiki/{{icon}}.png" alt="">
<p class="action_text">
</p>
</a>
</div>
<div class="action">
<a href="{{link}}">
<img src="/img/technology/grafiki/{{icon}}.png" alt="">
<p class="action_text">
</p>
</a>
</div>
<div class="action">
<a href="{{link}}">
<img src="/img/technology/grafiki/{{icon}}.png" alt="">
<p class="action_text">
</p>
</a>
</div>
<div class="action">
<a href="{{link}}">
<img src="/img/technology/grafiki/{{icon}}.png" alt="">
<p class="action_text">
</p>
</a>
</div>
<div class="action">
<a href="{{link}}">
<img src="/img/technology/grafiki/{{icon}}.png" alt="">
<p class="action_text">
</p>
</a>
</div>
<div class="action">
<a href="{{link}}">
<img src="/img/technology/grafiki/{{icon}}.png" alt="">
<p class="action_text">
</p>
</a>
</div>
</div>
</div>
</div>