CSS boxes layout - html

I am trying to create boxes next to each other but I am not sure what I am missing or getting wrong?
I have tried border attributes but it seems not working properly, and I would like the vertical lines to be attached to the horizontal lines and the content of the boxes be equally disposed like showed in the screenshot from Balenciaga website.
Balenciaga Website Footer
* {
box-sizing: border-box;
color: #000;
margin: inherit;
}
html {
background-color: #dee1ec;
font-family: Helvetica, Arial, sans-serif;
font-size: 12px;
}
body {}
a {
text-decoration: none;
}
.header {
border-bottom: 1px solid #000;
border-top: 1px solid #000;
padding-bottom: 16px;
padding-top: 16px;
}
.christianmeloni {
display: inline-block;
padding-left: 12px;
}
.menu {
display: inline-block;
float: right;
padding-right: 12px;
}
.work:hover,
.about:hover,
.contact:hover {
text-decoration: underline;
}
.content {
margin-bottom: 12px;
margin-top: 12px;
padding-left: 12px;
padding-right: 12px;
}
.mission {}
.band {
border-bottom: 1px solid #000;
border-top: 1px solid #000;
padding-bottom: 22px;
padding-top: 22px;
}
.brand {
border-right: 1px solid #000;
display: inline-block;
min-height: 320px;
padding-right: 12px;
width: 20%;
}
.experience {
border-right: 1px solid #000;
display: inline-block;
min-height: 320px;
padding-left: 12px;
padding-right: 12px;
width: 20%;
}
.innovation {
display: inline-block;
min-height: 320px;
padding-left: 12px;
padding-right: 12px;
width: 20%;
}
.engagement {
border-left: 1px solid #000;
display: inline-block;
min-height: 320px;
padding-left: 12px;
padding-right: 12px;
width: 20%;
}
.strategy {
border-left: 1px solid #000;
display: inline-block;
min-height: 320px;
padding-left: 12px;
width: 20%;
}
.footer {
border-bottom: 1px solid #000;
border-top: 1px solid #000;
padding-bottom: 16px;
padding-top: 16px;
}
.credit {
display: inline-block;
padding-left: 12px;
}
.follow {
display: inline-block;
float: right;
padding-right: 12px;
}
.credit:hover,
.facebook:hover,
.twitter:hover,
.instagram:hover {
text-decoration: underline;
}
<header class="header">
<div class="christianmeloni">
<span>
CHRISTIAN MELONI
</span>
</div>
<div class="menu">
<span>
<a class="work" href="#">Work</a>
<a class="about" href="#">About</a>
<a class="contact" href="#">Contact</a>
</span>
</div>
</header>
<div class="content">
<div class="mission">
<div>
Transforming businesses by developing original products, services and experiences. Disruptive thinking for ambitious brands. Challenge the ordinary, to achieve the extraordinary. We’re always in motion.
</div>
<div>
Our experience is that working collaboratively produces the best results.
</div>
<div>
Known for a collaborative, problem-solving approach to design, with personal involvement by all principals in every project and continuous attention to the details. We’re a global brand and innovation consultancy. We help ambitious leaders define compelling
brand strategies, design powerful brand experiences and innovate new brand-led products and services. We challenge ourselves and our clients to push boundaries. We are a design and innovation company. We work with forward-looking companies to shape
modern brands for a purpose-driven future. Founded with a simple but compelling vision: to build a brand consultancy as strong in its strategic thinking as it was in its creativity. We can’t help but tell it how it is. We know the rules and know
when and how to break them. We have firm beliefs, big ideas, strong convictions. We look inside for ideas and outside for inspiration. We like to challenge and be challenged, to teach and be taught. We take our craft seriously – ourselves less so.
We play music by ear, we follow our intuition. This is our nature, our essence. We have a strong ‘one-office’ philosophy and operating model. Our global team of strategists, designers and programme managers work as one coherent team across our different
locations in order to bring the best of our knowledge, skills and experience to every one of our clients wherever they are in the world. We come from many different places, speak many different languages and bring diverse skills and perspectives.
But we operate as one office, bringing the best regardless of where we (or you) are.
</div>
</div>
</div>
<div class="band"></div>
<div class="content">
<div class="brand">
<div>
BRAND
</div>
<div>
Disruptive thinking starts with a great story. We help leaders discover and define the most powerful and authentic brand narrative that will inspire their people, engage their customers and disrupt their markets. We help them develop a concise set of
bold and innovative initiatives that challenge the status quo and make the brand vision a reality.
</div>
</div>
<div class="experience">
<div>
EXPERIENCE
</div>
<div>
Disruptive thinking delivers great customer experiences. We design powerful, creative and engaging brand experiences, online and offline, that challenge people to think, feel and behave differently towards the brand and turn passive customers into passionate
brand advocates.
</div>
</div>
<div class="innovation">
<div>
INNOVATION
</div>
<div>
Disruptive thinking requires innovation. We work closely with our clients to develop new brands, products and services that are rooted in, and bring to life, what makes them special. We think it’s this kind of brand-led innovation that proves sustainably
successful. The smartest thinkers come to us to collaborate with each other. Designers, strategists, writers, makers, innovators, and dreamers—together we keep brands agile. We build some of the world’s most agile brands—brands that thrive on change.
</div>
</div>
<div class="engagement">
<div>
ENGAGEMENT
</div>
<div>
Disruptive thinking requires innovation. We work closely with our clients to develop new brands, products and services that are rooted in, and bring to life, what makes them special. We think it’s this kind of brand-led innovation that proves sustainably
successful. The smartest thinkers come to us to collaborate with each other. Designers, strategists, writers, makers, innovators, and dreamers—together we keep brands agile. We build some of the world’s most agile brands—brands that thrive on change.
</div>
</div>
<div class="strategy">
<div>
STRATEGY
</div>
<div>
Disruptive thinking requires innovation. We work closely with our clients to develop new brands, products and services that are rooted in, and bring to life, what makes them special. We think it’s this kind of brand-led innovation that proves sustainably
successful. The smartest thinkers come to us to collaborate with each other. Designers, strategists, writers, makers, innovators, and dreamers—together we keep brands agile. We build some of the world’s most agile brands—brands that thrive on change.
</div>
</div>
</div>
<footer class="footer">
<div class="credit">
<span>
© 2017 Christian Meloni
</span>
</div>
<div class="follow">
<span>
<a class="facebook" href="https://www.facebook.com/christianmelonicom/">Facebook</a>
<a class="twitter" href="#">Twitter</a>
<a class="instagram" href="#">Instagram</a>
</span>
</div>
</footer>

Instead of relying on display: inline-block, which causes items to be aligned by the base line, you can use CSS flexbox instead. The advantage of using flexbox is that each item will be stretched to its parent container's height (no more ugly equal height hacks), and it is just extremely easy to implement:
.content {
padding-left: 12px;
padding-right: 12px;
display: flex; // This is what you really need
}
// This is just to give the individual columns sufficient space at the top and bottom
.content > div {
padding-top: 12px;
padding-bottom: 12px;
}
And simply remove all the min-height and display: inline-block from the direct descendants of the <div class="content"> element, and you are good to go.
See proof-of-concept below:
* {
box-sizing: border-box;
color: #000;
margin: inherit;
}
html {
background-color: #dee1ec;
font-family: Helvetica, Arial, sans-serif;
font-size: 12px;
}
body {
}
a {
text-decoration: none;
}
.header {
border-bottom: 1px solid #000;
border-top: 1px solid #000;
padding-bottom: 16px;
padding-top: 16px;
}
.christianmeloni {
display: inline-block;
padding-left: 12px;
}
.menu {
display: inline-block;
float: right;
padding-right: 12px;
}
.work:hover, .about:hover, .contact:hover {
text-decoration: underline;
}
.content {
padding-left: 12px;
padding-right: 12px;
display: flex;
}
.content > div {
padding-top: 12px;
padding-bottom: 12px;
}
.band {
border-bottom: 1px solid #000;
border-top: 1px solid #000;
padding-bottom: 22px;
padding-top: 22px;
}
.brand {
border-right: 1px solid #000;
padding-right: 12px;
width: 20%;
}
.experience {
border-right: 1px solid #000;
padding-left: 12px;
padding-right: 12px;
width: 20%;
}
.innovation{
padding-left: 12px;
padding-right: 12px;
width: 20%;
}
.engagement{
border-left: 1px solid #000;
padding-left: 12px;
padding-right: 12px;
width: 20%;
}
.strategy{
border-left: 1px solid #000;
padding-left: 12px;
width: 20%;
}
.footer {
border-bottom: 1px solid #000;
border-top: 1px solid #000;
padding-bottom: 16px;
padding-top: 16px;
}
.credit {
display: inline-block;
padding-left: 12px;
}
.follow {
display: inline-block;
float: right;
padding-right: 12px;
}
.credit:hover, .facebook:hover, .twitter:hover, .instagram:hover {
text-decoration: underline;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Christian Meloni</title>
<link href="christianmeloni.css" rel="stylesheet">
<link href="christianmeloni.ico" rel="icon">
</head>
<body>
<header class="header">
<div class="christianmeloni">
<span>
CHRISTIAN MELONI
</span>
</div>
<div class="menu">
<span>
<a class="work" href="#">Work</a>
<a class="about" href="#">About</a>
<a class="contact" href="#">Contact</a>
</span>
</div>
</header>
<div class="content">
<div class="mission">
<div>
Transforming businesses by developing original products, services and experiences.
Disruptive thinking for ambitious brands.
Challenge the ordinary, to achieve the extraordinary.
We’re always in motion.
</div>
<div>
Our experience is that working collaboratively produces the best results.
</div>
<div>
Known for a collaborative, problem-solving approach to design, with personal involvement by all principals in every project and continuous attention to the details.
We’re a global brand and innovation consultancy.
We help ambitious leaders define compelling brand strategies, design powerful brand experiences and innovate new brand-led products and services.
We challenge ourselves and our clients to push boundaries.
We are a design and innovation company. We work with forward-looking companies to shape modern brands for a purpose-driven future.
Founded with a simple but compelling vision: to build a brand consultancy as strong in its strategic thinking as it was in its creativity.
We can’t help but tell it how it is. We know the rules and know when and how to break them. We have firm beliefs, big ideas, strong convictions. We look inside for ideas and outside for inspiration. We like to challenge and be challenged, to teach and be taught. We take our craft seriously – ourselves less so. We play music by ear, we follow our intuition.
This is our nature, our essence.
We have a strong ‘one-office’ philosophy and operating model. Our global team of strategists, designers and programme managers work as one coherent team across our different locations in order to bring the best of our knowledge, skills and experience to every one of our clients wherever they are in the world.
We come from many different places, speak many different languages and bring diverse skills and perspectives. But we operate as one office, bringing the best regardless of where we (or you) are.
</div>
</div>
</div>
<div class="band"></div>
<div class="content">
<div class="brand">
<div>
BRAND
</div>
<div>
Disruptive thinking starts with a great story. We help leaders discover and define the most powerful and authentic brand narrative that will inspire their people, engage their customers and disrupt their markets. We help them develop a concise set of bold and innovative initiatives that challenge the status quo and make the brand vision a reality.
</div>
</div>
<div class="experience">
<div>
EXPERIENCE
</div>
<div>
Disruptive thinking delivers great customer experiences. We design powerful, creative and engaging brand experiences, online and offline, that challenge people to think, feel and behave differently towards the brand and turn passive customers into passionate brand advocates.
</div>
</div>
<div class="innovation">
<div>
INNOVATION
</div>
<div>
Disruptive thinking requires innovation. We work closely with our clients to develop new brands, products and services that are rooted in, and bring to life, what makes them special. We think it’s this kind of brand-led innovation that proves sustainably successful.
The smartest thinkers come to us to collaborate with each other. Designers, strategists, writers, makers, innovators, and dreamers—together we keep brands agile.
We build some of the world’s most agile brands—brands that thrive on change.
</div>
</div>
<div class="engagement">
<div>
ENGAGEMENT
</div>
<div>
Disruptive thinking requires innovation. We work closely with our clients to develop new brands, products and services that are rooted in, and bring to life, what makes them special. We think it’s this kind of brand-led innovation that proves sustainably successful.
The smartest thinkers come to us to collaborate with each other. Designers, strategists, writers, makers, innovators, and dreamers—together we keep brands agile.
We build some of the world’s most agile brands—brands that thrive on change.
</div>
</div>
<div class="strategy">
<div>
STRATEGY
</div>
<div>
Disruptive thinking requires innovation. We work closely with our clients to develop new brands, products and services that are rooted in, and bring to life, what makes them special. We think it’s this kind of brand-led innovation that proves sustainably successful.
The smartest thinkers come to us to collaborate with each other. Designers, strategists, writers, makers, innovators, and dreamers—together we keep brands agile.
We build some of the world’s most agile brands—brands that thrive on change.
</div>
</div>
</div>
<footer class="footer">
<div class="credit">
<span>
© 2017 Christian Meloni
</span>
</div>
<div class="follow">
<span>
<a class="facebook" href="https://www.facebook.com/christianmelonicom/">Facebook</a>
<a class="twitter" href="#">Twitter</a>
<a class="instagram" href="#">Instagram</a>
</span>
</div>
</footer>
</body>
</html>

I edited your snipet.
I used display: flex; on .content
Removed margin and padding to ad them on boxes (.subContent)
* {
box-sizing: border-box;
color: #000;
margin: inherit;
}
html {
background-color: #dee1ec;
font-family: Helvetica, Arial, sans-serif;
font-size: 12px;
}
body {}
a {
text-decoration: none;
}
.header {
border-bottom: 1px solid #000;
border-top: 1px solid #000;
padding-bottom: 16px;
padding-top: 16px;
}
.christianmeloni {
display: inline-block;
padding-left: 12px;
}
.menu {
display: inline-block;
float: right;
padding-right: 12px;
}
.work:hover,
.about:hover,
.contact:hover {
text-decoration: underline;
}
.content {
margin-bottom: 12px;
margin-top: 12px;
padding-left: 12px;
padding-right: 12px;
}
.mission {}
.band {
border-bottom: 1px solid #000;
border-top: 1px solid #000;
padding-bottom: 22px;
padding-top: 22px;
}
.brand {
border-right: 1px solid #000;
display: inline-block;
min-height: 320px;
padding-right: 12px;
width: 20%;
}
.experience {
border-right: 1px solid #000;
display: inline-block;
min-height: 320px;
padding-left: 12px;
padding-right: 12px;
width: 20%;
}
.innovation {
display: inline-block;
min-height: 320px;
padding-left: 12px;
padding-right: 12px;
width: 20%;
}
.engagement {
border-left: 1px solid #000;
display: inline-block;
min-height: 320px;
padding-left: 12px;
padding-right: 12px;
width: 20%;
}
.strategy {
border-left: 1px solid #000;
display: inline-block;
min-height: 320px;
padding-left: 12px;
width: 20%;
}
.footer {
border-bottom: 1px solid #000;
border-top: 1px solid #000;
padding-bottom: 16px;
padding-top: 16px;
}
.credit {
display: inline-block;
padding-left: 12px;
}
.follow {
display: inline-block;
float: right;
padding-right: 12px;
}
.credit:hover,
.facebook:hover,
.twitter:hover,
.instagram:hover {
text-decoration: underline;
}
.content {
margin: 0;
padding: 0;
display: flex;
}
.subContent {
padding : 12px;
}
<header class="header">
<div class="christianmeloni">
<span>
CHRISTIAN MELONI
</span>
</div>
<div class="menu">
<span>
<a class="work" href="#">Work</a>
<a class="about" href="#">About</a>
<a class="contact" href="#">Contact</a>
</span>
</div>
</header>
<div class="content">
<div class="subContent mission">
<div>
Transforming businesses by developing original products, services and experiences. Disruptive thinking for ambitious brands. Challenge the ordinary, to achieve the extraordinary. We’re always in motion.
</div>
<div>
Our experience is that working collaboratively produces the best results.
</div>
<div>
Known for a collaborative, problem-solving approach to design, with personal involvement by all principals in every project and continuous attention to the details. We’re a global brand and innovation consultancy. We help ambitious leaders define compelling
brand strategies, design powerful brand experiences and innovate new brand-led products and services. We challenge ourselves and our clients to push boundaries. We are a design and innovation company. We work with forward-looking companies to shape
modern brands for a purpose-driven future. Founded with a simple but compelling vision: to build a brand consultancy as strong in its strategic thinking as it was in its creativity. We can’t help but tell it how it is. We know the rules and know
when and how to break them. We have firm beliefs, big ideas, strong convictions. We look inside for ideas and outside for inspiration. We like to challenge and be challenged, to teach and be taught. We take our craft seriously – ourselves less so.
We play music by ear, we follow our intuition. This is our nature, our essence. We have a strong ‘one-office’ philosophy and operating model. Our global team of strategists, designers and programme managers work as one coherent team across our different
locations in order to bring the best of our knowledge, skills and experience to every one of our clients wherever they are in the world. We come from many different places, speak many different languages and bring diverse skills and perspectives.
But we operate as one office, bringing the best regardless of where we (or you) are.
</div>
</div>
</div>
<div class="band"></div>
<div class="content">
<div class="subContent brand">
<div>
BRAND
</div>
<div>
Disruptive thinking starts with a great story. We help leaders discover and define the most powerful and authentic brand narrative that will inspire their people, engage their customers and disrupt their markets. We help them develop a concise set of
bold and innovative initiatives that challenge the status quo and make the brand vision a reality.
</div>
</div>
<div class="subContent experience">
<div>
EXPERIENCE
</div>
<div>
Disruptive thinking delivers great customer experiences. We design powerful, creative and engaging brand experiences, online and offline, that challenge people to think, feel and behave differently towards the brand and turn passive customers into passionate
brand advocates.
</div>
</div>
<div class="subContent innovation">
<div>
INNOVATION
</div>
<div>
Disruptive thinking requires innovation. We work closely with our clients to develop new brands, products and services that are rooted in, and bring to life, what makes them special. We think it’s this kind of brand-led innovation that proves sustainably
successful. The smartest thinkers come to us to collaborate with each other. Designers, strategists, writers, makers, innovators, and dreamers—together we keep brands agile. We build some of the world’s most agile brands—brands that thrive on change.
</div>
</div>
<div class="subContent engagement">
<div>
ENGAGEMENT
</div>
<div>
Disruptive thinking requires innovation. We work closely with our clients to develop new brands, products and services that are rooted in, and bring to life, what makes them special. We think it’s this kind of brand-led innovation that proves sustainably
successful. The smartest thinkers come to us to collaborate with each other. Designers, strategists, writers, makers, innovators, and dreamers—together we keep brands agile. We build some of the world’s most agile brands—brands that thrive on change.
</div>
</div>
<div class="subContent strategy">
<div>
STRATEGY
</div>
<div>
Disruptive thinking requires innovation. We work closely with our clients to develop new brands, products and services that are rooted in, and bring to life, what makes them special. We think it’s this kind of brand-led innovation that proves sustainably
successful. The smartest thinkers come to us to collaborate with each other. Designers, strategists, writers, makers, innovators, and dreamers—together we keep brands agile. We build some of the world’s most agile brands—brands that thrive on change.
</div>
</div>
</div>
<footer class="footer">
<div class="credit">
<span>
© 2017 Christian Meloni
</span>
</div>
<div class="follow">
<span>
<a class="facebook" href="https://www.facebook.com/christianmelonicom/">Facebook</a>
<a class="twitter" href="#">Twitter</a>
<a class="instagram" href="#">Instagram</a>
</span>
</div>
</footer>

Related

Text goes outside of footer when I shrink the browser

I have created a static website using html and css, the problem is that when I shrink the browser the text inside of the footer goes outside of the footer, how can I make so that the text always stays in the footer regardless of whether I shrink the browser or not?
* {
margin: 0px;
padding: 0px;
}
.nav-h1 {
text-align: center;
margin-top: 27px;
font-family: 'Open Sans';
font-size: 40px;
}
.nav {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 50%;
}
a {
display: inline-block;
margin: 10px;
font-family: 'Open Sans';
color: black;
font-weight: bold;
}
.a-container {
margin-left: 10%;
margin-top: 27px;
}
.logo-section {
margin-left: 15px;
margin-top: 15px;
}
.main {
min-height: calc(100vh - 70px);
background-color:#F1F1F1;
overflow: hidden;
}
.footer {
width: 100%;
height: 100%;
background-color: black;
color: gray;
font-family: 'Open Sans';
font-size: 15px;
}
.first-box {
width: 45%;
margin: 0 auto;
margin-top: 50px;
}
.first-box-text {
margin-top: 20px;
font-family: 'Open Sans';
}
.centered-p {
text-align: center;
margin-top: 20px;
font-family: 'Open Sans';
}
.second-word {
color: #ffa200;
text-decoration: underline;
}
.centered-img{
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 30px;
}
.header {
height: 8%;
}
.logo-img {
margin-top: 10px;
height: 50px;
}
.flex-container {
display: flex;
margin-top: 50px;
margin-left: 17%;
}
section {
flex: 2;
}
aside {
flex: 1;
}
.bordered-div {
margin-top: 50px;
text-align: center;
padding: 15px;
font-family: 'Open Sans';
font-size: 25px;
border-top: solid 2px gray;
border-bottom: solid 2px gray;
}
.flex-container-first-section-a {
color: #ffa200;
text-decoration: none;
border-bottom: 2px solid #ffa200;
}
.aside-first-section {
width: 60%;
text-align: center;
padding: 15px;
margin-left: 50px;
border-top: solid 2px gray;
border-bottom: solid 2px gray;
}
.aside-img {
margin-left: 50px;
margin-top: 20px;
}
.third-section {
margin-top: 25px;
font-family: 'Open Sans';
}
.forth-section-h1{
margin-left: 28%;
margin-top: 50px;
font-family: 'Open Sans';
}
.forth-section-p {
margin-left: 90px;
margin-top: 40px;
font-family: 'Open Sans';
}
.bordered-div-h1-upper-case {
text-transform: uppercase;
}
.image-container {
display: flex;
margin-top: 30px;
}
.image-container-img {
padding: 5px;
}
.img-with-text {
margin: 10px;
font-family: 'Open Sans';
}
.img-with-text-span {
border-top: solid 3px #ffa200
}
.second-section {
margin-top: 10px;
font-family: 'Open Sans';
}
.bottom-message {
height: 300px;
width: 100%;
margin-top: 50px;
margin-bottom: 50px;
text-align: center;
border: solid 2px black;
}
.bottom-message-button {
width: 50%;
height: 15%;
margin-top: 50px;
background-color: #ffa200;
border-radius: 4px;
border: none;
color: white;
font-family: 'Open Sans';
font-size: 20px;
font-weight: bold;
}
.bottom-message-content {
margin-top: 60px;
margin: 70px;
}
.centered-heading {
font-family: 'Open Sans';
}
.flex-container-first-p {
font-family: 'Open Sans';
}
.bottom-message-h1, .bottom-message-content-p {
font-family: 'Open Sans';
margin-top: 20px;
}
.footer-section {
width: 50%;
margin: 0 auto;
}
.footer-content {
margin: 0px;
padding: 0px;
}
.footer-links-a {
color: gray;
text-decoration: none;
border-right: 1px solid;
padding-right: 23px;
}
.capital-words {
text-transform: uppercase;
padding-top: 10px;
}
.footer-links {
width: 800px;
margin: 0 auto;
margin-top: 50px;
}
.copyright-p {
padding-top: 10px;
}
.aside-h2 {
font-size: 15px;
text-align: center;
margin-top: 10px;
}
.aside-third-section > img {
height: 250px;
}
.line {
border-bottom: solid 2px black;
width: 70%;
margin: 0 auto;
padding-top: 50px;
}
.box-message {
height: 200px;
width: 280px;
margin-top: 50px;
margin-left: 80px;
border: solid 2px black;
}
.box-message-p {
font-family: 'Open Sans';
margin-top: 50px;
width: 60%;
margin: 0 auto;
margin-top: 35px;
font-size: 15px;
}
.box-message-button, .box-message-a {
margin-top: 30px;
margin-left: 70px;
}
.box-message-a {
color: #ffa200;
text-decoration: none;
border-bottom: solid 2px #ffa200;
font-size: 25px;
}
.trending-news-div {
width: 60%;
text-align: center;
padding: 15px;
margin-left: 70px;
margin-top: 50px;
border-top: solid 2px gray;
border-bottom: solid 2px gray;
}
<div class="container">
<div class="header">
<div class="nav">
<h1 class="nav-h1">Nip & Tuck</h1>
<div class="a-container">
<a>Lifestyle</a>
<a>Culture</a>
<a>Sports</a>
<a>Politics</a>
</div>
<div class="logo-section">
<img class="logo-img" src="/assets/images/twitter-logo.PNG" alt="twitter logo">
<img class="logo-img"src="/assets/images/youtube-logo.png" alt="youtube logo">
<img class="logo-img"src="/assets/images/facebook-logo.png" alt="facebook logo">
</div>
</div>
</div>
<div class="main">
<div class="first-box">
<h1 class="centered-heading">How one woman gave her boss, her ex-boyfriend and all her doubters, the big middle finger</h1>
<p class="first-box-text">Janice Allbright decided enough was enough. It was time to change her life. After six months of stock trading, the final result was renewed confidence, increased happiness and £128,405!
</p>
<p class="centered-p">By
<a class="second-word">Kelly Chang</a>
| 30.06.2020</p>
<img src="/assets/images/center-image.png" alt="woman carrying a bag" class="centered-img">
<p class="centered-p">"It's not arrogance, it's confidence"</p>
</div>
<div class="flex-container">
<section>
<p class="flex-container-first-p">
“My life was basically sh!t, says Janice Allbright, a single woman whose life was literally in the toilet six months ago. “I was working at a shop on the high street, earning next to nothing. Then I would go home to my abusive boyfriend. Not exactly a fairytale life.” Everything changed for Janice when she discovered online trading while killing time on her lunch break. “My colleagues, friends and boyfriend at the time all doubted me. Now I’m the queen bitch, laughing at their tears.”
</p>
<div class="bordered-div">
<p>Change your life with the Online Investing System</p>
<a class="flex-container-first-section-a" href="">Get started for free</a>
</div>
<img src="/assets/images/second-center-image.PNG" alt="woman talking on the phone" class="centered-img">
<p class="centered-p">A new and better life</p>
<section class="second-section">
<p>Janice credits her amazing financial success to trading stocks online. The highschool dropout had concerns at the beginning, due to her lack of financial knowledge and experience. “It turned out there was nothing to worry about,” she says. “My broker provided me with all of the training and tools I needed to become a successful stock trader. Their patience was amazing.” </p>
</section>
<section class="third-section">
<p>Brokers and platforms, like the Online Investing System, have turned novice investors into financial superheroes. People like Janice have taken advantage of some tough competition amongst brokers to get the best services for lower prices. Sometimes even for free. “I didn’t have any money for fancy financial tools or software. But lucky me, my broker gave me everything for free.”</p>
</section>
<section class="forth-section">
<img src="/assets/images/third-center-image.PNG" alt="" class="centered-img">
<h1 class="forth-section-h1">"Now I do whatever the f#ack I want when I f#cking want"</h1>
<p class="forth-section-p">Janice believes that her success has given her the confidence to deal with anything life throws her way. And she openly admits that displaying her wealth has become a guilty pleasure. “I was driving in my G Wagon a few weeks ago and noticed my ex-boyfriend waiting at the bus stop. I could resist. I stopped my car, rolled down the window and happily presented my middle finger. I drove away with a smile. Life is good.”</p>
</section>
<div class="bordered-div">
<p>Learn more about online stock trading and how you can profit </p>
<a class="flex-container-first-section-a" href="">Start Now</a>
</div>
<div class="bordered-div">
<h1 class="bordered-div-h1-upper-case">Celebrity News </h1>
</div>
<div class="image-container">
<div class="img-with-text">
<img src="/assets/images/hollywood-image.PNG" alt="hollywod sign" class="image-container-img">
<div class="img-with-text-bottom">
<h4 class="img-with-text-h4">Ass-tastic! We rank the best bums in Hollywood.</h4>
<span class="img-with-text-span">By Lili Johnson 30.06.2020</span>
</div>
</div>
<div class="img-with-text">
<div class="img-with-text-bottom">
<img src="/assets/images/laptop-image.PNG" alt="a picture of a laptop" class="image-container-img">
<h4 class="img-with-text-h4">Coming soon to Netflix. See which movies have us hot and bothered.</h4>
<span class="img-with-text-span">By Gavin Lewis 30.06.2020</span>
</div>
</div>
<div class="img-with-text">
<img src="/assets/images/couple-fighting-image.PNG" alt="a picture of a couple fighting" class="image-container-img">
<h4 class="img-with-text-h4">Another celebrity couple calls it quits. Why can't the rich and famous stay together?</h4>
<span class="img-with-text-span">By Adriana Huber 30.06.2020</span>
</div>
</div>
<div class="bottom-message">
<div class="bottom-message-content">
<h1 class="bottom-message-h1">The rich are getting richer</h1>
<p class="bottom-message-content-p">And so can you. By becoming an online trader of currencies, stocks and commodities, you too can increase your monthly income and upgrade your standard of living </p>
<button class="bottom-message-button">Start with free 1-on-1 coaching</button>
</div>
</div>
</section>
<aside>
<div class="aside-first-section">
<h3>Hot Topics</h3>
</div>
<div class="aside-second-section">
<img src="/assets/images/second-column-first-img.PNG" alt="" class="aside-img">
<h2 class="aside-h2">Man steals £ 2,500,000 from the <br> bank with a legal loophole!</h2>
</div>
<div class="aside-third-section">
<img src="/assets/images/second-column-second-img.PNG" alt="" class="aside-img">
<h2 class="aside-h2">Does praying to God for money <br> actually work?</h2>
</div>
<div class="line"></div>
<div class="aside-third-section">
<img src="/assets/images/second-column-sixth-image.png" alt="" class="aside-img">
<h2 class="aside-h2">Japanese scientists have <br> discovored the secret of making money. Find out if it's real.</h2>
</div>
<div class="box-message">
<div class="box-message-content">
<p class="box-message-p">Learn more about online stock trading and how you can profit.</p>
<a class="box-message-a" href="">Start Now</a>
</div>
</div>
<div class="trending-news-div">
<h3>Trending Financial News</h3>
</div>
<div class="aside-third-section">
<img src="/assets/images/second-column-third-image.png" alt="" class="aside-img">
<h2 class="aside-h2">Royal family goes bancrupt. <br> Could be out on the streets very soon.</h2>
</div>
<div class="line"></div>
<div class="aside-third-section">
<img src="/assets/images/second-column-forth-image.png" alt="" class="aside-img">
<h2 class="aside-h2">Man wins the lottery and blows it <br> all in a Spanish casino.</h2>
</div>
<div class="aside-third-section">
<img src="/assets/images/second-column-fifth-image.png" alt="" class="aside-img">
<h2 class="aside-h2">Silver vs Gold. Our experts give <br> you the breakdown.</h2>
</div>
</aside>
</div>
</div>
<div class="footer">
<section class="footer-section">
<div class="footer-content">
<p class="capital-words">TERMS AND CONDITIONS CAREFULLY READ AND AGREE TO TERMS BELOW:</p>
<br>
<p>We are not affiliated in any way with any news publication. All trademarks on this web site whether registered or not, are the property of their respective owners. The authors of this web site are not sponsored by or affiliated with any of the third-party trade mark or third-party registered trade mark owners, and make no representations about them, their owners, their products or services. It is important to note that this site and the comments/answers depicted above is to be used as an illustrative example of what some individuals have achieved with this/these products. The website, and any page on the website, is based loosely off a true story, but has been modified in multiple ways including, but not limited to: the story, the photos, and the comments. Thus, this page, and any page on this website, are not to be taken literally or as a non-fiction story. Ther page, and the results mentioned on this page, although achievable for some, are not to be construed as the results that you may achieve on the same routine. I UNDERSTAND THIS WEBSITE IS ONLY ILLUSTRATIVE OF WHAT MIGHT BE ACHIEVABLE FROM USING THIS/THESE PRODUCTS, AND THAT THE STORY/COMMENTS DEPICTED ABOVE IS NOT TO BE TAKEN LITERALLY. Ther page receives compensation for clicks on or purchase of products featured on this site.</p><br>
<p class="capital-words">IMPORTANT CONSUMER DISCLOSURE</p><br>
<p>The term "advertorial" is a combination of "advertisement" and "editorial" written in an editorial format as an independent news story, when in fact the advertisement may promote a particular product or interest. Advertorials take factual information and report it in an editorial format to allow the author, often a company marketing its products, to enhance or explain certain elements to maintain the reader's interest. A familiar example is an airline's in-flight magazines that provide an editorial reports about travel destinations to which the airline flies.</p><br>
<p>As an advertorial, I UNDERSTAND THIS WEBSITE IS ONLY ILLUSTRATIVE OF WHAT MIGHT BE ACHIEVABLE FROM USING THIS PROGRAM, AND THAT THE STORY DEPICTED ABOVE IS NOT TO BE TAKEN LITERALLY. Ther page receives compensation for clicks on or purchase of products featured on this site. Ther program is not a job but an educational opportunity that can help individuals learn how to earn money through their entrepreneurial efforts. Anyone who decides to buy any program about making money will not necessarily make money simply by purchasing the program. People who think "I bought these materials so I'm going to automatically make money" are wrong. As any type of education has so many variables, it is impossible to accurately state what you may expect to achieve, however, people who bought the program not only bought the program, but also undertook additional training and education, applied the principles to an area of the market that was growing, kept their commitments and continued to learn. If you do what the individuals depicted did, you may generally expect to achieve a great education in the area of your choice, but you should not expect to earn any specific amount of money. Typical users of the starter materials that don't enroll in coaching, don't keep their commitments and don't implement what they learn, generally make no money. Though the success of the depicted individual is true, her picture and name have been changed to protect her identity. Consistent with the advertorial concept, the comments posted in the comment section are also representative of typical comments and experiences which have been compiled into a comment format to illustrate a dialogue, however, the comments are not actual posts to this webpage and have been compiled or generated for illustrative purposes only.</p><br>
<p>We are not affiliated in any way with CNN, WebTV, News Channel 1, ABC, NBC, CBS, U.S. News or FOX, and all such trademarks on this web site, whether registered or not, are the property of their respective owners. The authors of this web site are not sponsored by or affiliated with any of the third-party trade mark or third-party registered trade mark owners, and make no representations about them, their owners, their products or services.</p>
</div>
<div class="footer-links">
<a class="footer-links-a" href="">Cookie Policy</a>
<a class="footer-links-a" href="">Privacy Policy</a>
<a class="footer-links-a" href="">Data Processing Agreement</a>
<a class="footer-links-a" href="">Terms and Conditions</a>
</div>
<p class="testimonials-p">*Testimonials:
All characters, information and events depicted on This Website are entirely fictitious. Any similarity to actual events or persons, living or dead, is purely coincidental.</p>
<p class="copyright-p">© fortunetonight.com 2020</p>
</section>
</div>
</div>
I tried setting the width in pixels and ems but that still doesn't fix the issue
You have a width of 800px set on .footer-links
That means, no matter how wide your window is, it will keep it at 800px which will make you scroll side to side.
Change the width of .footer-links to be 100% or just remove it all together and that should fix it.
You could use the #media rule in your css..
#media(max-width: 1000px){
.footer-links {
width: 600px;
margin: 0 auto;
margin-top: 50px;
}
}
Link to more on #media --> https://www.w3schools.com/cssref/css3_pr_mediaquery.asp

Too much space on the right and the bottom

I'm having problem where I have too much space on the right and bottom for my site, it's making scroll bars that let you scroll to far.
the problem with the scroll right is in the "grid_container_ci" div
and for bottom scrolling is the "grid_container_footer" div.
I have tried using margin's to get rid of it, but not successful. It seems like the problem came after I added the "grid_container_ci" div. but even now when I comment out my "grid_container_ci" div, I still have problem with "grid_container_footer".
<!-- Company Information --->
<div class="grid_container_ci">
<h3>Company Information</h3>
<p>Incorporated in 2004, Rapid Marine HVAC (Asia Pacific)
Pte Ltd<br>is one of Singapore’s largest Marine and Offshore
service providers<br>for HVAC, Refrigeration and Mechanical
Ventilation systems.</p>
<p>We have decades of unique expertise and experience
providing<br>comprehensive turnkey HVAC solutions to
a wide range of Offshore<br>and Marine applications and
also established an overseas network to<br>meet with the
stringent demands of this vast industry.</p>
<p>Our team of experienced engineers and operational staff
with in-depth<br>knowledge of the Rules & Regulations
of the standard classification<br>societies; Codes and
Standards, we are able to provide our customers<br>with
cost and time saving solutions meeting their budget and
according<br>to their requirements.</p>
<p>Today, Rapid Marine HVAC (Asia Pacific) Pte Ltd can
support clients<br>from project feasibility study through
actual execution safely, rapidly,<br>on time and within
budget. This execution of extensive and complex<br>projects
is now our core business.</p>
<p>We provide comprehensive turkey HVAC & Refrigeration,<br>
Heat Exchanger and Heat Transfer solutions to a wide range<br>
of Marine and offshore applications, including Tankers,<br>
Bulkers, Container Vessels, Accommodation barges,<br>
Multi-purpose Supply Vessels, FPSOs, Oilrigs, Platforms,<br>
Pipe Laying Barges and Offshore Accommodation<br>
modules.</p>
<img class="platform" src="Oil_platform_P-51_(Brazil).jpg" alt="picture">
</div>
<!-- Footer section --->
<footer>
<div class="grid_container_footer">
<div class="vision">
<h3>VISION</h3>
<p>Our vision is to be the worldwide leader<br>in HVAC&R services for the marine & offshore industry.</p>
</div>
<div class="mission">
<h3>MISSION</h3>
<p>Our mission is to understand our<br> customers needs and provide them<br>with cost effective and reliable HVAC&R<br>solutions using innovative technology<br>and methods which put us at the<br>forefront of our industry</p>
</div>
<div class="contact_us">
<h3>CONTACT US</h3>
<p>30 Gul Lane<br>Singapore 629424<br>T:+65 6898 2775<br>F:+65 6898 2776<br>E:enquiry#rapidoffshoremarine.com</p>
</div>
<div class="news">
<h3>NEWS</h3>
<p></p>
</div>
</div>
.grid_container_footer {
display: grid;
grid-template-columns: auto auto auto auto;
grid-template-rows: auto auto;
font-family: helvitica;
font-size: 13px;
color: white;
background-color: rgb(15,55,123);
margin-left: -7.7px;
padding-bottom: -200px;
width: 1519px;
}
.vision h3 {
position: relative;
left: 180px;
}
.vision p {
position: relative;
left: 75px;
}
.mission h3 {
position: relative;
left: 55px;
}
.contact_us h3 {
position: relative;
left: 2px;
}
.news h3 {
position: relative;
left: 70px;
}
.grid_container_ci {
position: relative;
font-family: helvitica;
color: rgb(15,55,126);
margin-bottom: -400px;
}
.grid_container_ci h3 {
border-bottom: 4px solid rgb(15,55,126)
}
.platform {
position: relative;
left: 650px;
bottom: 505px;
}
Try below CSS code. May this solve your problem.
.grid_container_footer {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-template-rows: auto auto;
font-family: helvitica;
font-size: 13px;
color: white;
background-color: rgb(15,55,123);
margin-left: -7.7px;
padding: 20px;
}
.grid_container_ci {
font-family: helvitica;
color: rgb(15,55,126);
position: relative;
}
.grid_container_ci h3 {
border-bottom: 4px solid rgb(15,55,126)
}
.platform {
position: absolute;
top: 50px;
right: 20px;
}
The problem is your styling. Too much unneccesary paddings and margins. Check this updated one.
* {
box-sizing: border-box;
}
.grid_container_footer {
display: flex;
justify-content: space-around;
font-family: Helvetica;
font-size: 13px;
color: white;
background-color: rgb(15,55,123);
width: 100%;
padding: 20px 40px;
}
.grid_container_footer > div {
margin: 10px;
}
.vision h3 {
position: relative;
}
.vision p {
position: relative;
}
.mission h3 {
position: relative;
}
.contact_us h3 {
position: relative;
}
.news h3 {
position: relative;
}
.grid_container_ci {
position: relative;
font-family: helvitica;
color: rgb(15,55,126);
}
.grid_container_ci h3 {
border-bottom: 4px solid rgb(15,55,126)
}
.platform {
position: relative;
}
footer {
width: 100%;
position: relative;
bottom: 0;
}
<div class="grid_container_ci">
<h3>Company Information</h3>
<p>Incorporated in 2004, Rapid Marine HVAC (Asia Pacific)
Pte Ltd<br>is one of Singapore’s largest Marine and Offshore
service providers<br>for HVAC, Refrigeration and Mechanical
Ventilation systems.</p>
<p>We have decades of unique expertise and experience
providing<br>comprehensive turnkey HVAC solutions to
a wide range of Offshore<br>and Marine applications and
also established an overseas network to<br>meet with the
stringent demands of this vast industry.</p>
<p>Our team of experienced engineers and operational staff
with in-depth<br>knowledge of the Rules & Regulations
of the standard classification<br>societies; Codes and
Standards, we are able to provide our customers<br>with
cost and time saving solutions meeting their budget and
according<br>to their requirements.</p>
<p>Today, Rapid Marine HVAC (Asia Pacific) Pte Ltd can
support clients<br>from project feasibility study through
actual execution safely, rapidly,<br>on time and within
budget. This execution of extensive and complex<br>projects
is now our core business.</p>
<p>We provide comprehensive turkey HVAC & Refrigeration,<br>
Heat Exchanger and Heat Transfer solutions to a wide range<br>
of Marine and offshore applications, including Tankers,<br>
Bulkers, Container Vessels, Accommodation barges,<br>
Multi-purpose Supply Vessels, FPSOs, Oilrigs, Platforms,<br>
Pipe Laying Barges and Offshore Accommodation<br>
modules.</p>
<img class="platform" src="Oil_platform_P-51_(Brazil).jpg" alt="picture">
</div>
<!-- Footer section --->
<footer>
<div class="grid_container_footer">
<div class="vision">
<h3>VISION</h3>
<p>Our vision is to be the worldwide leader<br>in HVAC&R services for the marine & offshore industry.</p>
</div>
<div class="mission">
<h3>MISSION</h3>
<p>Our mission is to understand our<br> customers needs and provide them<br>with cost effective and reliable HVAC&R<br>solutions using innovative technology<br>and methods which put us at the<br>forefront of our industry</p>
</div>
<div class="contact_us">
<h3>CONTACT US</h3>
<p>30 Gul Lane<br>Singapore 629424<br>T:+65 6898 2775<br>F:+65 6898 2776<br>E:enquiry#rapidoffshoremarine.com</p>
</div>
<div class="news">
<h3>NEWS</h3>
<p></p>
</div>
</div>
and I updated the .grid_container_footer. I replaced the grid layout with flexbox which is more appropriate in this case.
.grid_container_footer {
display: flex;
font-family: Helvetica;
font-size: 13px;
color: white;
background-color: rgb(15,55,123);
width: 100%; // change from fixed size to percentage
padding: 20px 40px;
}
Thanks for all your input, I don't like just copying and pasting your code into mine as I need to learn how to alter my code to be correct, but based off of all your guys information there was something clearly wrong with my css, so I deleted my .grid_container_ci" css coding and commented out my html for it was well, was able to get the footer fixed when I did that. after I fixed the footer, I added back my html for the "grid_container_ci" and then started stlying again, I wasn't getting the results I wanted, and tried changing my html for the "grid_container_ci" into different divs for the text and image, then used "display-grid" in css to get the result I was looking for, and I got it. Below is my new code if anyone is curious. Thanks for the input!
<!-- Company Information --->
<div class="grid_container_ci">
<div class="ci">
<h3>Company Information</h3>
<p>Incorporated in 2004, Rapid Marine HVAC (Asia Pacific)
Pte Ltd<br>is one of Singapore’s largest Marine and Offshore
service providers<br>for HVAC, Refrigeration and Mechanical
Ventilation systems.</p>
<p>We have decades of unique expertise and experience
providing<br>comprehensive turnkey HVAC solutions to
a wide range of Offshore<br>and Marine applications and
also established an overseas network to<br>meet with the
stringent demands of this vast industry.</p>
<p>Our team of experienced engineers and operational staff
with in-depth<br>knowledge of the Rules & Regulations
of the standard classification<br>societies; Codes and
Standards, we are able to provide our customers<br>with
cost and time saving solutions meeting their budget and
according<br>to their requirements.</p>
<p>Today, Rapid Marine HVAC (Asia Pacific) Pte Ltd can
support clients<br>from project feasibility study through
actual execution safely, rapidly,<br>on time and within
budget. This execution of extensive and complex<br>projects
is now our core business.</p>
<p>We provide comprehensive turkey HVAC & Refrigeration,<br>
Heat Exchanger and Heat Transfer solutions to a wide range<br>
of Marine and offshore applications, including Tankers,<br>
Bulkers, Container Vessels, Accommodation barges,<br>
Multi-purpose Supply Vessels, FPSOs, Oilrigs, Platforms,<br>
Pipe Laying Barges and Offshore Accommodation<br>
modules.</p>
</div>
<div class="image">
<img class="platform" src="Oil_platform_P-51_(Brazil).jpg" alt="picture">
</div>
.grid_container_ci {
display: grid;
grid-template-columns: auto auto;
grid-template-rows: auto;
position: relative;
}
.grid_container_ci .image {
position: relative;
bottom: -60px;
}
.grid_container_ci .ci h3 {
border-bottom: 4px solid rgb(15,55,123);
}

Aligning text around images using HTML and CSS

I have the following issue involving the placement of text around an image using CSS and HTML. The way I've written it works as long as the text doesn't pass the image. The problem is that as soon as it "overflows" beyond the bottom of the image, it justifies all the way left and looks really sloppy.
How can I keep the text below the bottom of the image aligned with the previous text?
Note: I had to remove my original photo to prevent sharing personal information, and the replacement photo ended up being a little bit taller, so I had to copy and paste the text a few times to make it long enough to show what I'm talking about.
Here's the jsfiddle example including all my code: https://jsfiddle.net/dLa9jgcm/2/
.photo {
float: left;
height: 200px;
width: 200px;
margin-right: 20px;
overflow: hidden;
}
.photo img {
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
width: 100%;
}
.info {}
.info h2,
#header h2 {
text-transform: uppercase;
letter-spacing: 2px;
margin-bottom: .3em;
}
.info h4,
#header h4 {
color: #999;
}
<div id="tab-data-wrap">
<!-- About Tab Data -->
<div id="about">
<section class="clearfix">
<div class="g2">
<div class="photo">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Olympic_rings_without_rims.svg/342px-Olympic_rings_without_rims.svg.png" alt="Olympic Rings">
</div>
<div class="info">
<h2>
Zeus
</h2>
<h4>
Associate Financial Advisor
</h4>
<p>Providing expert advice and guidance on investments and retirement planning in conjunction with high level service to individuals and families so that they have the peace-of-mind to pursue other important endeavors throughout their lives. Providing
expert advice and guidance on investments and retirement planning in conjunction with high level service to individuals and families so that they have the peace-of-mind to pursue other important endeavors throughout their lives. Providing
expert advice and guidance on investments and retirement planning in conjunction with high level service to individuals and families so that they have the peace-of-mind to pursue other important endeavors throughout their lives.</p>
<br> I am a Certified Financial Planner (CFP®).
</div>
Here u go JSFiddle link
.info{
float: left;
width: calc(100% - 220px);/*value should be equal to width of image along with margin*/
}
All you need to add is:
.g2 {
display: flex;
}
.photo {
min-width: 25%;
}
.photo{
float: left;
height: 200px;
width: 200px;
margin-right: 20px;
overflow: hidden;
}
.photo img{
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
width: 100%;
}
.info{
}
.info h2, #header h2{
text-transform: uppercase;
letter-spacing: 2px;
margin-bottom: .3em;
}
.info h4, #header h4{
color: #999;
}
.g2 {display: flex;}
.photo {
min-width: 25%;
}
<div id="tab-data-wrap">
<!-- About Tab Data -->
<div id="about">
<section class="clearfix">
<div class="g2">
<div class="photo">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Olympic_rings_without_rims.svg/342px-Olympic_rings_without_rims.svg.png" alt="Olympic Rings">
</div>
<div class="info">
<h2>
Zeus
</h2>
<h4>
Associate Financial Advisor
</h4>
<p>Providing expert advice and guidance on investments and retirement planning in conjunction with high level service to individuals and families so that they have the peace-of-mind to pursue other important endeavors throughout their lives. Providing expert advice and guidance on investments and retirement planning in conjunction with high level service to individuals and families so that they have the peace-of-mind to pursue other important endeavors throughout their lives. Providing expert advice and guidance on investments and retirement planning in conjunction with high level service to individuals and families so that they have the peace-of-mind to pursue other important endeavors throughout their lives.</p>
<br> I am a Certified Financial Planner (CFP®).
</div>
See it here (SO snippets seems down): https://jsfiddle.net/websiter/9d40ap7c/
Feel free to provide the image min-width in any unit you want if you want it fixed size.

How to float pictures with text side by side

I am trying to do two things:
1) Make the three pictures float side by side
2) Create a border filled with the text in the p element below each picture.
Here is an idea of what I am trying to achieve.
Here is what I've done so far...
<div class="fitness-section">
<h1>Get fit</h1>
<img src="images/EssentialWorkouts.png" alt="essentialworkouts" class="essential">
<h5>Essential Workouts</h5>
<p>Going to a gym is definitely the best way to transform and build your body.
However, It is common for many people especially new-gymmers to feel nervous,
intimidated and lost in the gym. There are many effective and essential
workouts that are bound to get you ripped and buff in no time!</p>
Find out more
</div>
<div class="fitness-section">
<img src="images/Motivation.png" alt="motivation" class="motivation">
<p>Have you ever felt unmotivated and lost your will to gym? Fret not, there are
many inspirational quotes and articles here that will help you generate and
maintain a flow of positive attitude to keep you motivated to achieve your
fitness and goals in life!</p>
Find out more
</div>
<div class="fitness-section">
<h1>Get fit</h1>
<img src="images/Shoe.png" alt="shoe" class="shoe">
<p>Working out in the gym with a proper attire is an absolute neccessity to achieve
the best workout possible. Wearing attire that is too tight or too loose will
definitely affect your workouts. Discover and find out what you should and
should not be wearing in the gym.</p>
Find out more
</div>
Here's some work to start you off.
html, body {
box-sizing: border-box;
}
h1 {
text-align: center;
}
.wrapper {
text-align: center;
}
p {
text-align: left;
margin-top: 20px;
border: 1px solid #000;
padding: 10px;
height: 150px;
}
.fitness-section {
display: inline-block;
vertical-align: top;
padding: 10px;
margin-right: -4px;
width: 300px;
}
https://codepen.io/anon/pen/MvyeEN
I can recommend you, to use diffrent classes for your boxes
<div class="fitness-section div1">
<h1>Get fit</h1>
<img src="images/EssentialWorkouts.png" alt="essentialworkouts" class="essential">
<h5>Essential Workouts</h5>
<p>Going to a gym is definitely the best way to transform and build your body.
However, It is common for many people especially new-gymmers to feel nervous,
intimidated and lost in the gym. There are many effective and essential
workouts that are bound to get you ripped and buff in no time!</p>
Find out more
</div>
<div class="fitness-section div2">
<img src="images/Motivation.png" alt="motivation" class="motivation">
<p>Have you ever felt unmotivated and lost your will to gym? Fret not, there are
many inspirational quotes and articles here that will help you generate and
maintain a flow of positive attitude to keep you motivated to achieve your
fitness and goals in life!</p>
Find out more
</div>
<div class="fitness-section div2">
<h1>Get fit</h1>
<img src="images/Shoe.png" alt="shoe" class="shoe">
<p>Working out in the gym with a proper attire is an absolute neccessity to achieve
the best workout possible. Wearing attire that is too tight or too loose will
definitely affect your workouts. Discover and find out what you should and
should not be wearing in the gym.</p>
Find out more
</div>
And for style use this:
.fitness-section {
width: 30%;
}
.div1 {
float: left;
background-color: red;
margin: 15px 15px;
}
.div2 {
float: left;
background-color: blue;
margin: 15px 15px;
}
div3 {
float: right;
background-color:yellow;
margin: 15px 15px;
}

Why is my aside so low on the webpage?

I am struggling with CSS. In this example, could anyone help me understand why the "aside" is not floating to the right just below the picture emplacement? Why is it so low in the page?
Thanks for your advice.
HTML
<body>
<nav id="top-menu">
<ul>
<li> Home </li>
<li> Charting </li>
<li> Map </li>
<li> Financials </li>
<li> Forum </li>
<li> About </li>
</ul>
</nav>
<div id="maindiv">
<header>
<img class="img-right" src="images/Inkscape_stocktails_240_240.png"
alt="Stocktail" width="240" height="240" />
<hgroup>
<h1> Welcome to Stocktails </h1>
</hgroup>
<p> The perfect blend for your investment portfolio </p>
</header>
<article class="story">
<h1> Start investing today with Stocktails </h1>
<p>
Stocktails is a collection of tools and resources to facilitate the investing process, from data retrieval, stock analysis and valuation, up to the construction and monitoring of your portfolio.
</p>
</article>
<article class="story">
<h1> The renaissance of value investing </h1>
<p>
As the world economy slowly emerges and recovers from the Great Recession,
appetite for stocks is still on the wane. Stung by three successive market crashes in recent memory (1987, 2000, 2008),
retail investors turned their attention away from common shares and towards presumably safer assets, such as property.
In parallel, institutional investors, from insurance companies to endowments, have greatly diversified their holdings towards private equity, hedge funds and hard assets.
</p>
<p>
<em>Stocks are down, but not out</em>. It is our belief that they may even be on the verge of a renaissance. As most alternative asset classes,
notably sovereign bonds and property, exhibit signs of a bubble, the pendulum is may be about to swing in the reverse direction.
<strong>Now is the time for the savvy investor to put stocks back at the core of his portfolio</strong>.
</p>
<blockquote>"I will tell you how to become rich. Close the doors. Be fearful when others are greedy. Be greedy when others are fearful." (<cite>Warren Buffet</cite>)</blockquote>
<p>
In addition to a reduced appetite for stocks, modern portfolio theory - that notably relies on the efficient markets hypothesis - led many investors to give up on stock picking
and to invest into passive funds instead (cf. <cite>A random walk down Wall-Street</cite>, by B. Malkiel). As investors buy under-valued shares and spurn or short-sell the richly-valued, prices will tend to align with risk,
making it more difficult to find value in the market. Eventually, the average participant stops scouting for value and resigns himself to purchasing the index.
But not all companies are created equal and opportunities are bound to reappear. It is precisely when the market capitulates that the discerning investor should step back in to pick value stocks.
</p>
<p>
Value investing also suffered from the action of central banks. The unprecedented level of liquidity introduced by quantitative easing in the US, the UK, the EU and Japan was key to prevent an outright depression.
It has also been a boon for most investors. The resulting suppression of interest rates lifted all boats, with little regard for the quality of the asset.
As the tide reverses, the overall performance of the market is bound to disappoint. But we also expect a large variation of performance between strong and weak companies. The stars will then be aligned for the value investor to find gems among the wreck.
</p>
</article>
<article class="story">
<h1> Top 10 investing tips from <cite>Warren Buffet</cite>, the Oracle of Omaha </h1>
<ul>
<li>"It's far better to buy a wonderful company at a fair price than a fair company at a wonderful price."</li>
<li>"Rule No. 1: never lose money; rule No. 2: don't forget rule No. 1"</li>
<li>"Our approach is very much profiting from lack of change rather than from change. With Wrigley chewing gum, it's the lack of change that appeals to me. I don't think it is going to be hurt by the Internet. That's the kind of business I like."</li>
<li>"I try to buy stock in businesses that are so wonderful that an idiot can run them. Because sooner or later, one will."</li>
<li>"The stock market is a no-called-strike game. You don't have to swing at everything – you can wait for your pitch. The problem when you're a money manager is that your fans keep yelling, "Swing, you bum!""</li>
<li>"Price is what you pay; value is what you get. Whether we're talking about socks or stocks, I like buying quality merchandise when it is marked down."</li>
<li>"Never count on making a good sale. Have the purchase price be so attractive that even a mediocre sale gives good results."</li>
<li>"If you understood a business perfectly and the future of the business, you would need very little in the way of a margin of safety."</li>
<li>"We've long felt that the only value of stock forecasters isto make fortune tellers look good. Even now, Charlie [Munger] and I continue to believe that short-term market forecasts are poison and should be kept locked up in a safe place, away from children and also from grown-ups who behave in the market like children."</li>
<li>"We don't get paid for activity, just for being right. As to how long we'll wait, we'll wait indefinitely."</li>
</ul>
</article>
<aside class="about">
<header>
<h1> How to use Stocktails </h1>
<p> A collection of tools to cover the entire investment process </p>
</header>
<section>
<hgroup>
<h1> Stock quotes </h1>
<h2> Price, Volume, Ratios, etc. </h2>
</hgroup>
<p> Keep track of your stocks' movements </p>
</section>
<section>
<hgroup>
<h1> Fundamentals </h1>
<h2> Yearly and quarterly financials </h2>
</hgroup>
<p> Stock valuation and analysis </p>
</section>
<section>
<hgroup>
<h1> Portfolio building </h1>
<h2> Optimize the performance of your assets </h2>
</hgroup>
<p> Sophisticated tools to diversify risk and boost performance </p>
</section>
<section>
<hgroup>
<h1> Discussion </h1>
<h2> Forum </h2>
</hgroup>
<p> Share your investing ideas with other savvy investors </p>
</section>
</aside>
<div class="clear"></div>
</div>
<footer>
<p>
Copyright © 2014.
</p>
</footer>
</body>
CSS
body {
background-color: #fffbef;
}
.story p {
line-height: 1.2;
text-align: justify;
}
h1, h2, h3, h4, h5, h6 {
font-family: sans-serif;
color: #093844;
}
.clear {
margin: 0;
padding: 0;
clear: both;
}
img.img-right {
display: block;
float: right;
border: none;
padding: 2px;
margin: 3px 6pt 3px 6px;
}
/* navigation menu */
nav#top-menu {
width: 100%;
height: 50px;
//background-color: #fff2c1;
margin: 0;
padding: 0;
}
#top-menu ul {
display: block;
list-style-type: none;
width: 600px;
margin: 0 auto;
padding: 0;
}
#top-menu ul li {
margin: 0;
padding: 0;
}
#top-menu ul li a {
display: block;
float: left;
max-height: 25px;
width: 100px;
margin: 0;
padding: 5px 0;
font-family: sans-serif;
font-size: 20px;
text-align: center;
text-decoration: none;
color: #52736b;
border-bottom: #fffbef solid 2px;
}
#top-menu ul li a:hover { border-bottom: #52736b solid 2px; }
/* header */
header h1 { margin-top: 0; }
header p {
font-family: sans-serif;
font-weight: bold;
font-style: italic;
font-size: 85%;
margin: .25ex 12pt;
color: #093844;
}
/* maindiv */
#maindiv {
width: 1250px;
margin: 0 auto;
padding: 10px;
background-color: #eec;
}
/* article */
article {
width: 950px;
float: left;
}
article h1 {
font-size: 110%;
margin-top: 12pt;
padding-top: 3pt;
border-top: 4px solid #52736b;
}
/* aside */
aside.about {
float: right;
width: 238px;
background-color: #b7c4b1;
margin: 3pt 6pt 3pt 6pt;
}
aside h1 { font-size: 110%; }
aside h2 { font-size: 90%; }
aside p {
margin: 0 12pt;
font-family: sans-serif;
font-style: italic;
font-size: 80%;
}
aside section h1 {
padding-top: 3pt;
border-top: 4px solid #4f5856;
}
aside header p {
font-size: 85%;
}
aside section {
padding: 5px 0 5px 0;
}
/* footer */
footer {
background: #4f5856;
clear: all;
}
footer p {
color: #8c8e7e;
font-size: 70%;
font-family: sans-serif;
text-align: center;
margin: 0;
padding: 10px 0;
}
LC
Because your articles are floated left and the position of your aside is low in the document, the rules of floats say that
The outer top of a floating box may not be higher than the outer top
of any block or floated box generated by an element earlier in the
source document.
The way around that is to move your aside element up higher in the document:
jsFiddle example
<article class="story"></article>
<article class="story"></article>
<aside class="about"></aside>
<article class="story"></article>
just add clear: both; and modify your html like in the demo
aside.about {
float: right;
width: 238px;
background-color: #b7c4b1;
margin: 3pt 6pt 3pt 6pt;
clear: both;
}
Html
<header></header>
<aside class="about"></aside><!-- moved -->
<article class="story"></article>
Demo