How to create perfect css squares in flexbox without using :after - html

There seems to be a problem in this next piece of code. Testing on Chrome, there is a difference of just .5 px between height and width, but when switching to device mode, the difference gets bigger (almost 10px). I do have a <meta name="viewport" content="width=device-width, initial-scale=1.0"> set.
What I need: perfect squares and perfect circles. Flexbox is used and I don't want this :after fix used to create perfect squares. What am I doing wrong?
body {
max-inline-size: 1440px;
margin: 0 auto;
}
.oc {
display: flex;
justify-content: flex-start;
}
.ic {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: stretch;
flex-grow: 1;
}
.lc {
display: flex;
justify-content: stretch;
align-items: stretch;
border-radius: 25%;
border: solid 1px black;
margin: 1px;
padding: 20px;
flex: 1;
block-size: calc(50vw - 52px);
}
.abc {
font-size:90px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
border: solid 1px black;
flex-grow: 1;
}
#media screen and (min-width: 768px) {
.abc {
font-size: 180px;
}
}
#media screen and (min-width: 1024px) {
.oc {
flex-wrap: wrap;
}
.ic {
flex-direction: row;
flex-basis: 100vw;
}
.lc {
block-size: calc(33vw - 46px);
}
}
#media screen and (min-width: 1440px) {
.lc {
block-size: calc((1440px / 3) - 46px);
}
}
<div class="oc">
<div class="ic">
<div class="lc">
<div class="abc">A</div>
</div>
<div class="lc">
<div class="abc">B</div>
</div>
<div class="lc">
<div class="abc">C</div>
</div>
</div>
<div class="ic">
<div class="lc">
<div class="abc">A</div>
</div>
<div class="lc">
<div class="abc">B</div>
</div>
<div class="lc">
<div class="abc">C</div>
</div>
</div>
</div>

Not sure why you don't want to use the padding trick but it's the way to go. Your calculation won't be accurate using vw unit because you need to account for the scrollbar width
body {
max-inline-size: 1440px;
margin: 0 auto;
}
.oc {
display: flex;
justify-content: flex-start;
}
.ic {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: stretch;
flex-grow: 1;
}
.lc {
display: flex;
justify-content: stretch;
align-items: stretch;
border-radius: 25%;
border: solid 1px black;
margin: 1px;
padding: 20px;
flex: 1;
}
/* this will do the trick */
.lc .abc::before {
content:"";
padding-top:100%;
}
/**/
.abc {
font-size: min(90px,18vw);
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
border: solid 1px black;
flex-grow: 1;
}
#media screen and (min-width: 768px) {
.abc {
font-size: 180px;
}
}
#media screen and (min-width: 1024px) {
.oc {
flex-wrap: wrap;
}
.ic {
flex-direction: row;
flex-basis: 100vw;
}
}
<div class="oc">
<div class="ic">
<div class="lc">
<div class="abc">A</div>
</div>
<div class="lc">
<div class="abc">B</div>
</div>
<div class="lc">
<div class="abc">C</div>
</div>
</div>
<div class="ic">
<div class="lc">
<div class="abc">A</div>
</div>
<div class="lc">
<div class="abc">B</div>
</div>
<div class="lc">
<div class="abc">C</div>
</div>
</div>
</div>
If you insist on using vw you need to adjust the code like below. Notice how you will have perfect square but I had to hide the scrollbar to get the result:
body {
max-inline-size: 1440px;
margin: 0 auto;
overflow:hidden;
}
.oc {
display: flex;
justify-content: flex-start;
}
.ic {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: stretch;
flex-grow: 1;
}
.lc {
display: flex;
justify-content: stretch;
align-items: stretch;
border-radius: 25%;
border: solid 1px black;
margin: 1px;
padding: 20px;
flex: 1;
block-size: calc(50vw - 2px); /* remove only margin */
box-sizing:border-box; /* you don't have to care about padding and border*/
}
.abc {
font-size: 90px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
border: solid 1px black;
flex: 1;
}
#media screen and (min-width: 768px) {
.abc {
font-size: 180px;
}
}
#media screen and (min-width: 1024px) {
.oc {
flex-wrap: wrap;
}
.ic {
flex-direction: row;
flex-basis: 100vw;
}
.lc {
block-size: calc(calc(100vw/3) - 2px);
}
}
#media screen and (min-width: 1440px) {
.lc {
block-size: calc((1440px / 3) - 2px);
}
}
<div class="oc">
<div class="ic">
<div class="lc">
<div class="abc">A</div>
</div>
<div class="lc">
<div class="abc">B</div>
</div>
<div class="lc">
<div class="abc">C</div>
</div>
</div>
<div class="ic">
<div class="lc">
<div class="abc">A</div>
</div>
<div class="lc">
<div class="abc">B</div>
</div>
<div class="lc">
<div class="abc">C</div>
</div>
</div>
</div>

Related

Flexbox: Item 1 and 3 on same row, item 2 on next row

I got a header with a logo in the center of the row.
[ LINK | LOGO | LINK ]
.header {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.item {
margin: 5%;
}
#media only screen and (max-width: 600px) {
.header {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.item-1 {
order: 1;
}
.item-2 {
order: 3;
}
.item-3 {
order: 1;
}
}
<div class="header">
<div class="item item-1">About</div>
<div class="item item-2">
<img width="250" src="https://svgsilh.com/svg/1015751.svg" />
</div>
<div class="item item-3">Contact</div>
</div>
For screen width less than 600px, I would like to have the header organized like this:
[ LINK | LINK ]
[ LOGO ]
I have tried achieving this by using flexbox, with direction column for less than 600px and order: n for the three items.
I manage to get the Logo at the bottom, but not the item 1 and item 3 on the same line.
Is there a way to make this happen using flexbox, or do I have to use another technique?
flex-wrap and eventually gap can be plenty enough without resetting direction .
flex-direction:column will stack the children any way, that was your mistake, from there , nothing could work ;).
order:1 on the logo is also plenty enough to put it on last position (default is order:0).
example
.header {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
gap: 5%;
}
.item {
margin: auto 5%;/* margin could be removed resetting a few propertie on .item2 See next snippet */
}
#media only screen and (max-width: 600px) {
.header {
flex-wrap: wrap;
}
.item-2 {
order: 1;
}
}
<div class="header">
<div class="item item-1">About</div>
<div class="item item-2">
<img width="250" src="https://svgsilh.com/svg/1015751.svg" />
</div>
<div class="item item-3">Contact</div>
</div>
With no margin reset on Item
.header {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
gap: 5%;
}
#media only screen and (max-width: 600px) {
.header {
flex-wrap: wrap;
}
.item-2 {
order: 1;
min-width: 90%;
text-align: center;
}
}
<div class="header">
<div class="item item-1">About</div>
<div class="item item-2">
<img width="250" src="https://svgsilh.com/svg/1015751.svg" />
</div>
<div class="item item-3">Contact</div>
</div>
Try like this - flex-wrap: wrap on the parent, and flex: 1 on the second item:
.header {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.item {
margin: 5%;
}
#media only screen and (max-width: 600px) {
.header {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
}
.item-1 {
order: 1;
}
.item-2 {
order: 3;
flex: 1;
}
.item-3 {
order: 1;
}
}
<div class="header">
<div class="item item-1">About</div>
<div class="item item-2">
<img width="250" src="https://svgsilh.com/svg/1015751.svg" />
</div>
<div class="item item-3">Contact</div>
</div>
Leave flex-direction:row and add flex-wrap:wrap on the header.
Add flex:1 1 100%; text-align:center on the item-3 element.
.header {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.item {
margin: 5%;
}
#media only screen and (max-width: 1000px) {
.header {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
flex-wrap:wrap;
}
.item-1 {
order: 1;
}
.item-2 {
order: 3;
width:100%;
flex: 1 1 100%;
align-items:center;
text-align:center;
}
.item-3 {
order: 1;
}
}
<div class="header">
<div class="item item-1">About</div>
<div class="item item-2">
<img width="250" src="https://svgsilh.com/svg/1015751.svg" />
</div>
<div class="item item-3">Contact</div>
</div>
You don't need to repeat the CSS code for media query. flex-wrap and flex-basis should help you achieve this along with order.
.header {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
}
.item {
margin: 5%;
}
#media only screen and (max-width: 600px) {
.item-1 {
order: 1;
}
.item-2 {
order: 3;
flex-basis: 100%;
text-align: center;
}
.item-3 {
order: 2;
}
}
<div class="header">
<div class="item item-1">About</div>
<div class="item item-2">
<img width="250" src="https://svgsilh.com/svg/1015751.svg" />
</div>
<div class="item item-3">Contact</div>
</div>

Why are my divs disappearing when I use flex-direction?

I am currently working on my webpage's responsiveness and have implemented flexbox for the positioning of my page's elements. The issue that I am experiencing is that when I use 'flex-direction: column' in my media query, the divs disappear upon the browser being resized. What am I doing wrong here?
#blue {
background-color: #57afb5;
max-width: 470px;
height: 350px;
flex: 1;
justify-content: space-around;
}
#dark-green {
background-color: #29914c;
max-width: 470px;
height: 350px;
flex: 1;
justify-content: space-around;
}
#green {
background-color: #91e3ad;
max-width: 470px;
height: 350px;
flex: 1;
justify-content: space-around;
}
#orange {
background-color: #c98a32;
max-width: 470px;
height: 350px;
flex: 1;
justify-content: space-around;
}
#top {
display: flex;
justify-content: space-around;
margin-top: 2%;
}
#bottom {
display: flex;
justify-content: space-around;
margin-top: 2%;
}
/* responsive web design*/
#media only screen and (max-width: 960px) {
#top {
display: flex;
flex-direction: column;
}
#bottom {
display: flex;
flex-direction: column;
}
/*end of responsive web design*/
<div class='main-content'>
<div id='Navbar_Link-Toggle' style='font-size: 20px'>
<i id='main' class='fas fa-bars'></i>
</div>
<div class='container'>
<div class='Navbar'>
<a class='links' href=''>FOOD</a>
<a class='links' href=''>FUN</a>
<img id='center-logo' src='img/SAMO.png'>
<a class='links' href=''>HISTORY</a>
<a class='links' href=''>LOCATION</a>
</div>
</div>
<div class='header'>
<img id='food' src='img/food.jpg'>
</div>
</div>
<div id='top'>
<div id='blue'></div>
<div id='dark-green'></div>
</div>
<div id='bottom'>
<div id='green'></div>
<div id='orange'></div>
</div>
</div>
The #top and #bottom divs have no height. You could give them a hight. I.E #top, #bottom { hight: 700px; }
Alternatively, use display: block; as illustrated in the example below.
Side note: When I have missing elements, I'll sometimes throw a border: solid red 2px; on them to better visualize what is happening. Hope that helps for next time!
#blue {
background-color: #57afb5;
max-width: 470px;
height: 350px;
flex: 1;
justify-content: space-around;
}
#dark-green {
background-color: #29914c;
max-width: 470px;
height: 350px;
flex: 1;
justify-content: space-around;
}
#green {
background-color: #91e3ad;
max-width: 470px;
height: 350px;
flex: 1;
justify-content: space-around;
}
#orange {
background-color: #c98a32;
max-width: 470px;
height: 350px;
flex: 1;
justify-content: space-around;
}
#top {
display: flex;
justify-content: space-around;
margin-top: 2%;
}
#bottom {
display: flex;
justify-content: space-around;
margin-top: 2%;
}
/* responsive web design*/
#media only screen and (max-width: 960px) {
#top,
#bottom {
display: block;
}
}
/*end of responsive web design*/
<div class='main-content'>
<div id='Navbar_Link-Toggle' style='font-size: 20px'>
<i id='main' class='fas fa-bars'></i>
</div>
<div class='container'>
<div class='Navbar'>
<a class='links' href=''>FOOD</a>
<a class='links' href=''>FUN</a>
<img id='center-logo' src='img/SAMO.png'>
<a class='links' href=''>HISTORY</a>
<a class='links' href=''>LOCATION</a>
</div>
</div>
<div class='header'>
<img id='food' src='img/food.jpg'>
</div>
</div>
<div id='top'>
<div id='blue'></div>
<div id='dark-green'></div>
</div>
<div id='bottom'>
<div id='green'></div>
<div id='orange'></div>
</div>

Is there a way to build this layout with flexbox?

Hi I am trying to build this layout with flexbox.I provided my current code because i dont know how to move further.Even i posted image how iut should look like under the code.I tried everything but i cant achieve these result. Columns 2,3,5,6,7,8 must be same size. Im new to flex box and i really want to achieve this goal. Thanks for any help.
.tall {
height: 300px;
}
.content {
display: flex;
height: 100%;
}
.left {
display: flex;
flex-direction: column;
flex: 1;
}
.box {
padding-bottom: 50px;
}
.right3collumns {
display: flex;
flex-direction: column;
flex: 2;
}
.box2:nth-child(1) {
background-color: teal;
}
.box2:nth-child(2) {
background-color: red;
}
.box2:nth-child(3) {
background-color: blue;
}
.right {
flex: 2;
background: #22B14C;
}
.right2 {
display: flex;
flex-basis: 200px;
flex-direction: column;
background-color: red;
}
.right2small {
flex-basis: 100px;
background-color: turquoise;
}
.box:nth-child(1) {
background: #ED1C24;
}
.box:nth-child(2) {
background: #00A2E8;
}
.box:nth-child(3) {
background: #FFAEC9;
}
<div class="content">
<div class="right">
<img src="assets/group.png" alt="group">
</div>
<div class="left">
<div class="box">Small DIv</div>
<div class="box">Small DIv</div>
</div>
<div class="right2">bigger</div>
<div class="right2small">smaller</div>
<div class="right3collumns">
<div class="box2">Small DIv</div>
<div class="box2">Small DIv</div>
<div class="box2">Small DIv</div>
</div>
</div>
Here is one way of achieving the layout, I strongly advise, if you can, to use CSS Grid instead.
.grid {
display: flex;
flex: 1;
}
.grid--col {
flex-direction: column;
}
.grid__item {
display: flex;
justify-content: center;
align-items: center;
flex: 1;
border: 1px solid #ddd;
}
.grid__item--x2 {
flex: 2;
}
.grid--main {
background: #f5f5f5;
border: 1px dashed #999;
max-width: 960px;
margin: 50px auto;
}
<div class="grid grid--main">
<div class="grid__item">1</div>
<div class="grid__item grid__item--x2">
<div class="grid grid--col">
<div class="grid">
<div class="grid__item">2</div>
<div class="grid__item grid__item--x2">4</div>
<div class="grid__item">8</div>
</div>
<div class="grid">
<div class="grid__item">3</div>
<div class="grid__item">5</div>
<div class="grid__item">6</div>
<div class="grid__item">7</div>
</div>
</div>
</div>
</div>
You can modify the CSS/SCSS code to change the layout for different breakpoints using the CSS #media rules.
For example, you can have everything stacked, when the viewport is less than or equal to 960px.
#media only screen and (max-width: 960px) {
.grid {
flex-direction: column;
}
}
.grid {
display: flex;
flex: 1;
}
.grid--col {
flex-direction: column;
}
.grid__item {
display: flex;
justify-content: center;
align-items: center;
flex: 1;
border: 1px solid #ddd;
}
.grid__item--x2 {
flex: 2;
}
.grid--main {
background: #f5f5f5;
border: 1px dashed #999;
max-width: 960px;
margin: 50px auto;
}
#media only screen and (max-width: 960px) {
.grid {
flex-direction: column;
}
}
<div class="grid grid--main">
<div class="grid__item">1</div>
<div class="grid__item grid__item--x2">
<div class="grid grid--col">
<div class="grid">
<div class="grid__item">2</div>
<div class="grid__item grid__item--x2">4</div>
<div class="grid__item">8</div>
</div>
<div class="grid">
<div class="grid__item">3</div>
<div class="grid__item">5</div>
<div class="grid__item">6</div>
<div class="grid__item">7</div>
</div>
</div>
</div>
</div>

justify-content: center not working on flex:100% in mobile

I'm trying to build a 3 by 3 flexbox grid of button links that are responsive. The grid looks great on desktop and tablet, however, in the mobile version the items are left aligned and are unable to be horizontally centered. My goal is to get one column for the mobile with all the content centered. I switched to flex: 100%; for the mobile version and tried using justify-content: center, but it doesn't work and I'm not sure why.
#love_button,
#additude_button,
#isnpr_button,
#functional_medicine_button,
#immh_button {
width: 178px;
height: 111px;
display: block;
background-repeat: no-repeat;
}
.flex-container {
height: 100%;
padding: 0;
margin: 0;
list-style: none;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
flex-wrap: wrap;
justify-content: space-evenly;
border: 4px solid orange;
}
.flex-item {
width: 178px;
height: 111px;
flex: 33.3% 33.3% 33.3%;
margin-bottom: 65px;
background: royalblue;
}
Mobile Media Query #media only screen and (max-device-width: 640px) {
/* Fixes bottom gap between resource link and footer mobile */
.push {
margin-bottom: 0;
}
.flex-container {
justify-content: center;
}
.flex-item {
flex: 100%;
}
#hide {
display: none;
}
}
<main>
<section id="resources">
<h1 class="resources_header">RESOURCES</h1>
<div class="flex-container">
</div>
<div class="flex-container push">
</div>
</section>
</main>
Instead try changing display:block and margin:10px auto in the media query.
Please check my snippet, and let me know if you have any questions.
#love_button,
#additude_button,
#isnpr_button,
#functional_medicine_button,
#immh_button {
width: 178px;
height: 111px;
display: block;
background-repeat: no-repeat;
}
.flex-container {
height: 100%;
padding: 0;
margin: 0;
list-style: none;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
justify-content: space-evenly;
}
.flex-item {
width: 178px;
height: 111px;
flex: 33.3% 33.3% 33.3%;
margin-bottom: 65px;
border: 1px solid red;
background: green;
}
#media only screen and (max-width: 640px) {
/* Fixes bottom gap between resource link and footer mobile */
.push {
margin-bottom: 0;
}
.flex-container {
display: block;
margin: auto;
}
.flex-item {
margin: 10px auto;
}
#hide {
display: none;
}
}
<main>
<section id="resources">
<h1 class="resources_header">RESOURCES</h1>
<div class="flex-container">
</div>
<div class="flex-container push">
</div>
</section>
</main>
Use align-items: center or align-content: space-evenly or both.
Without align-items or align-content
.flex-container {
width: 150px;
height: 150px;
border: 1px solid black;
display: flex;
flex-wrap: wrap;
justify-content: space-evenly;
align-content: space-evenly;
}
.flex-children {
width: 40px;
height: 40px;
background-color: red;
}
<div class="flex-container">
<div class="flex-children"></div>
<div class="flex-children"></div>
<div class="flex-children"></div>
<div class="flex-children"></div>
<div class="flex-children"></div>
<div class="flex-children"></div>
<div class="flex-children"></div>
<div class="flex-children"></div>
<div class="flex-children"></div>
</div>
With align-items or align-content
.flex-container {
width: 150px;
height: 150px;
border: 1px solid black;
display: flex;
flex-wrap: wrap;
justify-content: space-evenly;
align-items: center;
}
.flex-children {
width: 40px;
height: 40px;
background-color: red;
}
<div class="flex-container">
<div class="flex-children"></div>
<div class="flex-children"></div>
<div class="flex-children"></div>
<div class="flex-children"></div>
<div class="flex-children"></div>
<div class="flex-children"></div>
<div class="flex-children"></div>
<div class="flex-children"></div>
<div class="flex-children"></div>
</div>
CSS-tricks: align-items
CSS-tricks: align-content

CSS Flexbox annoying slight offset of row elements [duplicate]

This question already has answers here:
White space under image [duplicate]
(5 answers)
Remove white space from image
(3 answers)
Closed 5 years ago.
So I have two divs in a full width container that I want to give variable sizing with flexbox, but no matter what I do, there is an annoying offset at the bottom. Using margins I can come close to fixing the problem, but it's never perfect.
If you run the code snippet below and scroll to the bottom you can see it, the image and the black content container are not aligned at the bottom.
What's going on?
#container {
width: 100%;
display: inline-flex;
flex-direction: row;
}
#image-wrapper {
flex-grow: 3;
max-width: 1000px;
position: relative;
/*background-color: black;*/
}
#menu {
flex-grow: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 50px;
background-color: #101010;
color: #fefefe;
align-items: stretch;
display: flex;
margin-bottom:7px;
}
#form {
width: 100px;
}
#image {
width: 100%;
}
<div id="container">
<div id="image-wrapper">
<img id="image" src="http://imgsv.imaging.nikon.com/lineup/lens/zoom/normalzoom/af-s_dx_18-140mmf_35-56g_ed_vr/img/sample/sample1_l.jpg"/>
</div>
<div id="menu">
<div id="form">
CONTENT<br>CONTENT<br>
</div>
</div>
</container>
There is some space below the image since the image is an inline-element and as such there is some space reserved below the (invisble) baseline that the image is aligned to vertically. To avoid that, there are two possible solutions:
1.) Apply display: block; to the image (see first snippet)
or
2.) Apply font-size: 0 to the image container (see second snippet)
#container {
width: 100%;
display: inline-flex;
flex-direction: row;
}
#image-wrapper {
flex-grow: 3;
max-width: 1000px;
position: relative;
/*background-color: black;*/
}
img {
display: block;
}
#menu {
flex-grow: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 50px;
background-color: #101010;
color: #fefefe;
align-items: stretch;
display: flex;
}
#form {
width: 100px;
}
#image {
width: 100%;
}
<div id="container">
<div id="image-wrapper">
<img id="image" src="http://imgsv.imaging.nikon.com/lineup/lens/zoom/normalzoom/af-s_dx_18-140mmf_35-56g_ed_vr/img/sample/sample1_l.jpg" />
</div>
<div id="menu">
<div id="form">
CONTENT<br>CONTENT<br>
</div>
</div>
</div>
SECOND SOLUTION:
#container {
width: 100%;
display: inline-flex;
flex-direction: row;
}
#image-wrapper {
flex-grow: 3;
max-width: 1000px;
position: relative;
/*background-color: black;*/
font-size: 0;
}
#menu {
flex-grow: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 50px;
background-color: #101010;
color: #fefefe;
align-items: stretch;
display: flex;
}
#form {
width: 100px;
}
#image {
width: 100%;
}
<div id="container">
<div id="image-wrapper">
<img id="image" src="http://imgsv.imaging.nikon.com/lineup/lens/zoom/normalzoom/af-s_dx_18-140mmf_35-56g_ed_vr/img/sample/sample1_l.jpg" />
</div>
<div id="menu">
<div id="form">
CONTENT<br>CONTENT<br>
</div>
</div>
</div>
#container {
width: 100%;
display: inline-flex;
flex-direction: row;
}
#image-wrapper {
flex-grow: 3;
max-width: 1000px;
position: relative;
/*background-color: black;*/
}
#menu {
flex-grow: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 50px;
background-color: #101010;
color: #fefefe;
align-items: stretch;
display: flex;
margin-bottom:4px;
}
#form {
width: 100px;
}
#image {
width: 100%;
}
<div id="container">
<div id="image-wrapper">
<img id="image" src="http://imgsv.imaging.nikon.com/lineup/lens/zoom/normalzoom/af-s_dx_18-140mmf_35-56g_ed_vr/img/sample/sample1_l.jpg"/>
</div>
<div id="menu">
<div id="form">
CONTENT<br>CONTENT<br>
</div>
</div>
</container>
Looks like the margin is just a bit off