Column count stacking when there is no content - html

I have looked around but couldn't find anything describing my problem. I have 5 section elements in a main tag with 3 of them containing text and images.
I'm trying to get each section in a column side by side using column count, however the last two columns with no text and images stack instead of remaining next to each other. I have attached a picture below.
When I add the same images and text it works as it should but I would like to know if I can have empty columns as I do not have content for them yet.
The Code:
main {
-webkit-column-count: 5; /* Chrome, Safari, Opera */
-moz-column-count: 5; /* Firefox */
column-count: 5;
}
li {
list-style: none;
}
.office {
margin-top: 5%;
display:inline-block;
width: 100%;
text-align: center;
}
.office_border {
border: 2px solid #95cccc;
width: 150px;
margin: auto;
}
.office_title {
font: normal 1.9rem DIN;
}
.office_properties {
padding: 0;
}
.office_properties_title {
font: 0.8rem 'Josefin Sans';
}
.office_properties_title_text {
font-weight: normal;
}
.office_properties_item_image {
width: 100%;
}
.office_properties_button {
padding: 5%;
}
.office_properties_link {
font-family: 'Josefin Sans';
text-decoration: none;
color: #c0392b;
}
<main>
<section class="office">
<h1 class="office_title">TITLE</h1>
<ul class="office_properties">
<div class="office_border"></div>
<li class="office_properties_title">
<h2 class="office_properties_title_text">Heading</h2>
</li>
<li class="office_properties_item">
<img src="https://placekitten.com/300/200" alt="" class="office_properties_item_image">
</li>
<li class="office_properties_button">
DISCOVER
</li>
<div class="office_border"></div>
</ul>
</section>
<section class="office">
<h1 class="office_title">TITLE</h1>
<ul class="office_properties">
<div class="office_border"></div>
<li class="office_properties_title">
<h2 class="office_properties_title_text">Heading</h2>
</li>
<li class="office_properties_item">
<img src="https://placekitten.com/300/200" alt="" class="office_properties_item_image">
</li>
<li class="office_properties_button">
DISCOVER
</li>
<div class="office_border"></div>
<li class="office_properties_title">
<h2 class="office_properties_title_text">Heading</h2>
</li>
<li class="office_properties_item">
<img src="https://placekitten.com/300/200" alt="" class="office_properties_item_image">
</li>
<li class="office_properties_button">
DISCOVER
</li>
<div class="office_border"></div>
</ul>
</section>
<section class="office">
<h1 class="office_title">TITLE</h1>
<ul class="office_properties">
<div class="office_border"></div>
<li class="office_properties_title">
<h2 class="office_properties_title_text">Heading</h2>
</li>
<li class="office_properties_item">
<img src="https://placekitten.com/300/200" alt="" class="office_properties_item_image">
</li>
<li class="office_properties_button">
DISCOVER
</li>
<div class="office_border"></div>
<li class="office_properties_title">
<h2 class="office_properties_title_text">Heading</h2>
</li>
<li class="office_properties_item">
<img src="https://placekitten.com/300/200" alt="" class="office_properties_item_image">
</li>
<li class="office_properties_button">
DISCOVER
</li>
<div class="office_border"></div>
</ul>
</section>
<section class="office">
<h1 class="office_title">TITLE</h1>
<ul class="office_properties">
<div class="office_border"></div>
<li class="office_properties_title"> </li>
<li class="office_properties_item"> </li>
</ul>
</section>
<section class="office">
<h1 class="office_title">TITLE</h1>
<ul class="office_properties">
<div class="office_border"></div>
<li class="office_properties_title"> </li>
<li class="office_properties_item"> </li>
</ul>
</section>
</main>

You can add display:inline-flex to main you can also find an example I made here, also I added support for column-count for other browsers.
If you want to watch it in the snippet click on "full page".
I hope this help:)
main {
display:inline-flex;
-webkit-column-count: 5; /* Chrome, Safari, Opera */
-moz-column-count: 5; /* Firefox */
column-count: 5;
}
li {
list-style: none;
}
.office {
margin-top: 5%;
display:inline-block;
width: 100%;
text-align: center;
}
.office_border {
border: 2px solid #95cccc;
width: 150px;
margin: auto;
}
.office_title {
font: normal 1.9rem DIN;
}
.office_properties {
padding: 0;
}
.office_properties_title {
font: 0.8rem 'Josefin Sans';
}
.office_properties_title_text {
font-weight: normal;
}
.office_properties_item_image {
width: 100%;
}
.office_properties_button {
padding: 5%;
}
.office_properties_link {
font-family: 'Josefin Sans';
text-decoration: none;
color: #c0392b;
}
<main>
<section class="office">
<h1 class="office_title">TITLE</h1>
<ul class="office_properties">
<div class="office_border"></div>
<li class="office_properties_title">
<h2 class="office_properties_title_text">Heading</h2>
</li>
<li class="office_properties_item">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/b/b7/Strokkur_21_(js).jpg/668px-Strokkur_21_(js).jpg" alt="" class="office_properties_item_image">
</li>
<li class="office_properties_button">
DISCOVER
</li>
<div class="office_border"></div>
</ul>
</section>
<section class="office">
<h1 class="office_title">TITLE</h1>
<ul class="office_properties">
<div class="office_border"></div>
<li class="office_properties_title">
<h2 class="office_properties_title_text">Heading</h2>
</li>
<li class="office_properties_item">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/b/b7/Strokkur_21_(js).jpg/668px-Strokkur_21_(js).jpg" alt="" class="office_properties_item_image">
</li>
<li class="office_properties_button">
DISCOVER
</li>
<div class="office_border"></div>
</ul>
</section>
<section class="office">
<h1 class="office_title">TITLE</h1>
<ul class="office_properties">
<div class="office_border"></div>
<li class="office_properties_title">
<h2 class="office_properties_title_text">Heading</h2>
</li>
<li class="office_properties_item">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/b/b7/Strokkur_21_(js).jpg/668px-Strokkur_21_(js).jpg" alt="" class="office_properties_item_image">
</li>
<li class="office_properties_button">
DISCOVER
</li>
<div class="office_border"></div>
</ul>
</section>
<section class="office">
<h1 class="office_title">TITLE</h1>
<ul class="office_properties">
<div class="office_border"></div>
<li class="office_properties_title">
<h2 class="office_properties_title_text">Heading</h2>
</li>
<li class="office_properties_item">
<img src="assets/properties/21JS.jpg" alt="" class="office_properties_item_image">
</li>
<li class="office_properties_button">
DISCOVER
</li>
<div class="office_border"></div>
</ul>
</section>
<section class="office">
<h1 class="office_title">TITLE</h1>
<ul class="office_properties">
<div class="office_border"></div>
<li class="office_properties_title">
<h2 class="office_properties_title_text">Heading</h2>
</li>
<li class="office_properties_item">
<img src="assets/properties/21JS.jpg" alt="" class="office_properties_item_image">
</li>
<li class="office_properties_button">
DISCOVER
</li>
<div class="office_border"></div>
</ul>
</section>
</main>

Related

How to make header sticky on mobile?

The Goal
To make the header sticky when this responsive HTML5 template is resized to mobile phone dimensions.
The Problem
I cannot seem to find the correct element to add the CSS position property to. No matter what DIV I add the 'sticky' class to, it just won't stay fixed to the top of the screen.
In Action
Desktop Mode Works Fine
Mobile Size Fails
Failed Attempts
I have tried to attach a class, like this...
.makeSticky {
position: -webkit-sticky; /* Safari */
position: sticky;
top: 0;
}
...to every element even remotely close to the header. I just can't find the right one, and get it working.
Live
Here is the page running on a server: http://stpete.epizy.com/en/index.html
Code
<header class="header-area header-3">
<div class="desktop-nav d-none d-lg-block">
<div class="header-nav">
<div class="container-fluid custom-container">
<div class="header-nav-wrapper d-flex justify-content-between">
<div class="header-static-nav">
<p>Get FREE Shipping with <span class="text">$35!</span> Code: FREESHIPPING</p>
</div>
<div class="header-menu-nav">
<ul class="menu-nav">
<li>
<div class="dropdown">
<button type="button" id="setting" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Setting <i class="icon ion-chevron-down"></i></button>
<ul class="dropdown-menu" aria-labelledby="setting">
<li>Checkout</li>
<li>Sign in</li>
</ul>
</div>
</li>
<li>
<div class="dropdown">
<button type="button" id="langue" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><img src="images/1.jpg" alt=""> English <i class="icon ion-chevron-down"></i></button>
<ul class="dropdown-menu" aria-labelledby="langue">
<li><img src="images/1.jpg" alt=""> English</li>
<li><img src="images/2.jpg" alt=""> Spanish</li>
</ul>
</div>
</li>
</ul>
</div> <!-- header menu nav -->
</div> <!-- header nav wrapper -->
</div> <!-- container -->
</div> <!-- header nav -->
<div class="header-middle">
<div class="container-fluid custom-container">
<div class="row">
<div class="col-lg-3">
<div class="header-logo-contact d-flex ">
<div class="desktop-logo">
<a href="index.html">
<img src="images/logo-white.png" alt="Global Eletronics, LLC">
</a>
</div> <!-- desktop logo -->
</div>
</div>
<div class="col-lg-9">
<div class="header-search-cart d-flex align-items-center">
<div class="header-contact d-flex align-items-center">
<i class="icon ion-ios-telephone-outline"></i>
<div class="phone media-body">
<p>24/7 Support</p>
+727-623-0753
</div>
</div>
<div class="header-search media-body">
<form action="#">
<div class="search-category">
<select>
<option value="">All categories</option>
<option value="audio">Audio Parts</option>
<option value="accessories">- - Accessories</option>
<option value="buzzers">- - Buzzers</option>
<option value="batteries">Battery Products</option>
<option value="batteries">- - Primary Batteries</option>
</select>
</div>
<input id="search-box" type="text" placeholder="Part #">
<button><i class="icon ion-android-search"></i></button>
</form>
</div>
<div class="header-cart">
<div class="cart-btn">
<a href="cart.html">
<i class="icon ion-calculator"></i>
<span class="text">RFQ Parts :</span>
<span class="count">0</span>
</a>
</div>
<!--
<div class="mini-cart">
<ul class="cart-items">
<li>
<div class="single-cart-item d-flex">
<div class="cart-item-thumb">
<img src="images/cart-1.jpg" alt="product">
<span class="product-quantity">1x</span>
</div>
</div>
</li>
</ul>
<div class="price_content">
<div class="cart-subtotals">
</div>
<div class="cart-total price_inline">
<span class="label"># Items</span>
<span class="value">12</span>
</div>
</div>
<div class="checkout text-center">
Send RFQ
</div>
</div>
-->
</div>
</div> <!-- header search cart -->
</div>
</div> <!-- row -->
</div> <!-- container -->
</div> <!-- header middle -->
<div class="header-menu">
<div class="container-fluid custom-container">
<div class="row">
<div class="col-lg-3">
<div class="header-menu-vertical">
<h4 class="menu-title">
<span>Parts by</span>
Category
</h4>
<ul class="menu-content menu-expand">
<li class="menu-item">
Semiconductor
</li>
<li class="menu-item">
Passives
</li>
<li class="menu-item">ElectroMechanical</li>
<li class="menu-item">Power & Circuit</li>
<li class="menu-item">Automation</li>
<li class="menu-item">Connectors</li>
<li class="menu-item">Cables & Wires</li>
<li class="menu-item">Test</li>
</ul> <!-- menu content -->
</div> <!-- header menu vertical -->
</div>
<div class="col-lg-9 position-static">
<div class="header-horizontal-menu">
<ul class="menu-content">
<li class="active">Home
</li> <li class="position-static">Products <i class="fal fa-chevron-down"></i>
<ul class="mega-sub-menu d-flex flex-wrap">
<li>
<a class="menu-title" href="#">Shop Grid</a>
<ul class="submenu-item">
<li>Shop Grid Column 3</li>
<li>Shop Grid Column 4</li>
<li>Shop Grid left sidebar</li>
<li>Shop Grid Right sidebar</li>
</ul>
</li>
<li>
<a class="menu-title" href="#">Shop List</a>
<ul class="submenu-item">
<li>Shop List</li>
<li>Shop List Left sidebar</li>
<li>Shop List Right sidebar</li>
</ul>
</li>
<li>
<a class="menu-title" href="#">Shop Single</a>
<ul class="submenu-item">
<li>Shop Single</li>
<li>Shop Variable</li>
<li>Shop Affiliate</li>
<li>Shop Group</li>
<li>Shop Tabs 2</li>
<li>Shop Tabs 3</li>
</ul>
</li>
<li>
<a class="menu-title" href="#">Shop Single</a>
<ul class="submenu-item">
<li>Shop Slider</li>
<li>Shop Gallery Left sidebar</li>
<li>Shop Gallery Right sidebar</li>
<li>Shop Sticky Left sidebar</li>
<li>Shop Sticky Right sidebar</li>
</ul>
</li>
<li class="custom-banner">
<img src="images/custom_banner.jpg" alt="" class="img-responsive">
</li>
</ul>
</li>
<li>Services <i class="fal fa-chevron-down"></i>
<ul class="sub-menu">
<li>About</li>
</ul>
</li>
<li>Resources <i class="fal fa-chevron-down"></i>
<ul class="sub-menu">
<li>BOM Upload Tool</li>
<li>Global Learning Lab</li>
<li>Product Advisor</li>
<li>Articles</li>
</ul>
<li>About</li>
<li>Contact</li>
</ul>
</div> <!-- header horizontal menu -->
</div>
</div> <!-- row -->
</div> <!-- container -->
</div> <!-- header menu -->
</div> <!-- desktop nav -->
<div class="mobile-nav d-lg-none">
<div class="container-fluid">
<div class="mobile-nav-top">
<div class="row align-items-center">
<div class="col-sm-4 col-3">
<div class="mobile-toggle">
<a class="mobile-menu-open" href="javascript:;"><i class="fal fa-bars"></i></a>
</div>
</div>
<div class="col-sm-4 col-5">
<div class="mobile-logo text-center">
<a href="index.html">
<img src="images/logo-white.png" alt="Logo">
</a>
</div> <!-- mobile logo -->
</div>
<div class="col-sm-4 col-4">
<div class="mobile-account-cart">
<ul class="account-cart text-right">
<li>
<div class="dropdown">
<button type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fal fa-user"></i></button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<li>My account</li>
<li>Checkout</li>
<li>Sign in</li>
</ul>
</div>
</li>
<li class="header-cart">
<a href="#">
<i class="fal fa-envelope-open-dollar"></i>
<span>0</span>
</a>
<div class="mini-cart">
<ul class="cart-items">
<li>
<div class="single-cart-item d-flex">
<div class="cart-item-thumb">
<img src="images/cart-1.jpg" alt="product">
<span class="product-quantity">1x</span>
</div>
<div class="cart-item-content media-body">
<h5 class="product-name">New Balance Fresh Foam LAZR</h5>
<span class="product-price">€18.90</span>
<span class="product-color"><strong>Color:</strong> White</span>
<i class="fal fa-times"></i>
</div>
</div>
</li>
<li>
<div class="single-cart-item d-flex">
<div class="cart-item-thumb">
<img src="images/cart-2.jpg" alt="product">
<span class="product-quantity">3x</span>
</div>
<div class="cart-item-content media-body">
<h5 class="product-name">New Balance Fresh Foam LAZR</h5>
<span class="product-price">€18.90</span>
<span class="product-color"><strong>Color:</strong> White</span>
<i class="fal fa-times"></i>
</div>
</div>
</li>
</ul>
<div class="price_content">
<div class="cart-subtotals">
<div class="products price_inline">
<span class="label">Subtotal</span>
<span class="value">€30.80</span>
</div>
<div class="shipping price_inline">
<span class="label">Shipping</span>
<span class="value">€7.00</span>
</div>
<div class="tax price_inline">
<span class="label">Taxes</span>
<span class="value">€0.00</span>
</div>
</div>
<div class="cart-total price_inline">
<span class="label">Total</span>
<span class="value">€37.80</span>
</div>
</div> <!-- price content -->
<div class="checkout text-center">
Checkout
</div>
</div> <!-- mini cart -->
</li>
</ul>
</div>
</div>
</div> <!-- row -->
</div> <!-- mobile nav top -->
<div class="header-search">
<form action="#">
<div class="search-category">
<select>
<option value="0">All categories</option>
<option value="12">Laptop</option>
<option value="13">- - Hot Categories</option>
<option value="19">- - - - Dresses</option>
<option value="20">- - - - Jackets & Coats</option>
<option value="21">- - - - Sweaters</option>
<option value="22">- - - - Jeans</option>
<option value="23">- - - - Blouses & Shirts</option>
</select>
</div>
<input type="text" placeholder="Enter your search key ... ">
<button><i class="icon ion-android-search"></i></button>
</form>
</div>
</div> <!-- container -->
<div class="mobile-off-canvas-menu">
<div class="mobile-canvas-menu-top">
<ul class="menu-nav">
<li><i class="fal fa-repeat"></i> Compare (0)</li>
<h6 class="custom-title">Women is Clothes & Fashion</h6>
<p>Shop women is clothing and accessories and get inspired by the latest fashion trends.</p>
</div>
</div>
<div class="col-lg-4 col-md-12">
<div class="menu-block">
<h6 class="custom-title">Simple Style</h6>
<p>A new flattering style with all the comfort of our linen.</p>
</div>
</div>
<div class="col-lg-4 col-md-12">
<div class="menu-block">
</ul>
</li>
<li class="menu-item-has-children">
<span>Outerwear & Jackets</span>
<li>Bags & Cases</li>
</ul> <!-- menu content -->
</div> <!-- mobile main menu -->
</div> <!-- mobile off canvas menu -->
<div class="overlay"></div>
</div> <!-- mobile nav -->
</header>
CSS
/*===== header 3 =====*/
.header-3 {
background-color: #1c2454; }
.header-3 .header-nav {
background-color: #000;
border-bottom: 0; }
.header-3 .header-nav .header-nav-wrapper .header-static-nav p {
color: #fff; }
.header-3 .header-nav .header-nav-wrapper .header-static-nav p .text {
color: #fff; }
.header-3 .header-nav .header-nav-wrapper .header-menu-nav .menu-nav li + li {
margin-left: 30px; }
#media only screen and (min-width: 992px) and (max-width: 1199px) {
.header-3 .header-nav .header-nav-wrapper .header-menu-nav .menu-nav li + li {
margin-left: 20px; } }
.header-3 .header-nav .header-nav-wrapper .header-menu-nav .menu-nav li + li::before {
color: rgba(255, 255, 255, 0.4); }
.header-3 .header-nav .header-nav-wrapper .header-menu-nav .menu-nav li a {
color: #fff; }
.header-3 .header-nav .header-nav-wrapper .header-menu-nav .menu-nav li .dropdown button {
color: #fff; }
.header-3 .header-contact i {
color: #fff; }
.header-3 .header-contact .phone p {
color: #fff; }
.header-3 .mobile-toggle a {
color: #fff; }
.header-3 .mobile-account-cart .account-cart li .dropdown button {
color: #fff; }
.header-3 .mobile-account-cart .account-cart li .dropdown button i {
font-size: 24px; }
.header-3 .mobile-account-cart .account-cart li a {
color: #fff; }
.header-3 .header-menu {
background-color: #1c2454;
border-top: 1px solid rgba(255, 255, 255, 0.4); }
.header-3 .header-menu.sticky {
border-top: 0; }
I inherited this project, and the HTML was purchased from some template company. I didn't write the HTML - so any help would be greatly appreciated.
Thank you.
The sticky position needs space, and for that to work, the .header-area class needs to be sticky. Only add this rule to your media query! I just tried it, and sticky position worked like this:
.header-area {
position: sticky;
top: 0;
z-index: 9999;
}
You need to specify position: fixed to mobile navigation. The desktop nav has the same property but also has a custom animation sticky. You may also want to adjust the element below it because the menu is now fixed.
#media and (max-width: 600px) { /* Target only devices below 600px */
.header-area {
position: fixed;
z-index: 999; /* So that it is not under the other elements */
background: #1c2454; /* It was transparent */
}
.slider-area {
top: 85px; /* Can change according to your liking */
}
}
Output:

5 responsive floating divs not aligning properly on mobile/tablet view (<992px)

I have 5 side by side lists in my website's footer as follows:
<div class="row">
<div class="col-xs-12 footer-links">
<div class="links">
<h1 class="title">ABOUT US</h1>
<ul>
<li class="link"> About Company</li>
<li class="link"> Legal Documents</li>
<li class="link"> Careers</li>
<li class="link"> Contact Us</li>
<li class="link"> FAQs</li>
</ul>
</div>
<div class="links">
<h1 class="title">ACCOUNTS</h1>
<ul>
<li class="link">Register</li>
<li class="link">Compare Account Types</li>
<li class="link">Funding Options</li>
<li class="link">Islamic Account</li>
</ul>
</div>
<div class="links">
<h1 class="title">INSTRUMENTS</h1>
<ul>
<li class="link"> Currencies</li>
<li class="link"> Commodities</li>
<li class="link"> Metals</li>
<li class="link"> Shares</li>
<li class="link"> Bonds</li>
<li class="link"> Indices</li>
</ul>
</div>
<div class="links">
<h1 class="title">PLATFORMS</h1>
<ul>
<li class="link"> Meta Trader 4</li>
<li class="link"> MT4 Desktop</li>
<li class="link"> MT4 iOS</li>
<li class="link"> MT4 Android</li>
<li class="link"> MT4 Webtrader</li>
</ul>
</div>
<div class="links">
<h1 class="title">TRADING TOOLS</h1>
<ul>
<li class="link"> Expiration Dates</li>
<li class="link"> Market Hours</li>
<li class="link"> Holiday Calendar</li>
<li class="link"> Economic Calendar</li>
</ul>
</div>
</div>
What I would like to happen is that at any resolution below 992px, the lists will each take up 50% of the column creating 3 rows of 2 lists each except for the last (since I have 5 lists)
Here is my sass code: (maxMQ is just a mixin for a media query and $md-max-width is 992px)
.footer {
.links {
float: left;
display: inline-block;
width: calc(100% / 5);
#include maxMQ($md-max-width) {
margin-top: 30px;
width: 50%;
}
.title {
font-size: 14px;
margin-bottom: 5px;
padding-bottom: 7px;
display: inline-block;
border-bottom: 2px solid $highlight-blue;
}
ul {
margin: 0;
padding: 0;
display: block;
}
li {
margin-top: 5px;
font-size: 13px;
a {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}
}
}
The problem is that when I reduce resolution below 992px (mobile/tablet), the 3rd list skips a spot on the second row. so it looks something like this:
row 1: list list
row 2: list
row 3: list list
What I want is:
row 1: list list
row 2: list list
row 3: list
I have no idea why this is happening. I do know that when I remove the ul's from within the 'links' divs it works fine.
Any help would be greatly appreciated! Thanks!
This is due to the floating elements, the first element has more height than the second one and it's creating this issue on the second row.
To fix this and you can use flex and remove the floating:
.links {
float: left;
display: inline-block;
width: calc(100% / 5);
}
#media all and (max-width:992px) {
.footer-links {
display: flex;
flex-wrap:wrap;
}
.links {
margin-top: 30px;
width: 50%;
float: none;
}
.title {
font-size: 14px;
margin-bottom: 5px;
padding-bottom: 7px;
display: inline-block;
border-bottom: 2px solid $highlight-blue;
}
ul {
margin: 0;
padding: 0;
display: block;
}
li {
margin-top: 5px;
font-size: 13px;
}
li a {
color: #000 text-decoration: none;
cursor: pointer;
}
}
<div class="row">
<div class="col-xs-12 footer-links">
<div class="links">
<h1 class="title">ABOUT US</h1>
<ul>
<li class="link"> About Company</li>
<li class="link"> Legal Documents</li>
<li class="link"> Careers</li>
<li class="link"> Contact Us</li>
<li class="link"> FAQs</li>
</ul>
</div>
<div class="links">
<h1 class="title">ACCOUNTS</h1>
<ul>
<li class="link">Register</li>
<li class="link">Compare Account Types</li>
<li class="link">Funding Options</li>
<li class="link">Islamic Account</li>
</ul>
</div>
<div class="links">
<h1 class="title">INSTRUMENTS</h1>
<ul>
<li class="link"> Currencies</li>
<li class="link"> Commodities</li>
<li class="link"> Metals</li>
<li class="link"> Shares</li>
<li class="link"> Bonds</li>
<li class="link"> Indices</li>
</ul>
</div>
<div class="links">
<h1 class="title">PLATFORMS</h1>
<ul>
<li class="link"> Meta Trader 4</li>
<li class="link"> MT4 Desktop</li>
<li class="link"> MT4 iOS</li>
<li class="link"> MT4 Android</li>
<li class="link"> MT4 Webtrader</li>
</ul>
</div>
<div class="links">
<h1 class="title">TRADING TOOLS</h1>
<ul>
<li class="link"> Expiration Dates</li>
<li class="link"> Market Hours</li>
<li class="link"> Holiday Calendar</li>
<li class="link"> Economic Calendar</li>
</ul>
</div>
</div>
Or simply remove floating without adding flex but you need to fix white spaces issue to have them 50% width:
.links {
float: left;
display: inline-block;
width: calc(100% / 5);
}
#media all and (max-width:992px) {
.footer-links {
font-size: 0; /* remove white spaces */
}
.links {
margin-top: 30px;
width: 50%;
float: none;
font-size: initial; /* put back font as initial*/
vertical-align:top;
}
.title {
font-size: 14px;
margin-bottom: 5px;
padding-bottom: 7px;
display: inline-block;
border-bottom: 2px solid $highlight-blue;
}
ul {
margin: 0;
padding: 0;
display: block;
}
li {
margin-top: 5px;
font-size: 13px;
}
li a {
color: #000 text-decoration: none;
cursor: pointer;
}
}
<div class="row">
<div class="col-xs-12 footer-links">
<div class="links">
<h1 class="title">ABOUT US</h1>
<ul>
<li class="link"> About Company</li>
<li class="link"> Legal Documents</li>
<li class="link"> Careers</li>
<li class="link"> Contact Us</li>
<li class="link"> FAQs</li>
</ul>
</div>
<div class="links">
<h1 class="title">ACCOUNTS</h1>
<ul>
<li class="link">Register</li>
<li class="link">Compare Account Types</li>
<li class="link">Funding Options</li>
<li class="link">Islamic Account</li>
</ul>
</div>
<div class="links">
<h1 class="title">INSTRUMENTS</h1>
<ul>
<li class="link"> Currencies</li>
<li class="link"> Commodities</li>
<li class="link"> Metals</li>
<li class="link"> Shares</li>
<li class="link"> Bonds</li>
<li class="link"> Indices</li>
</ul>
</div>
<div class="links">
<h1 class="title">PLATFORMS</h1>
<ul>
<li class="link"> Meta Trader 4</li>
<li class="link"> MT4 Desktop</li>
<li class="link"> MT4 iOS</li>
<li class="link"> MT4 Android</li>
<li class="link"> MT4 Webtrader</li>
</ul>
</div>
<div class="links">
<h1 class="title">TRADING TOOLS</h1>
<ul>
<li class="link"> Expiration Dates</li>
<li class="link"> Market Hours</li>
<li class="link"> Holiday Calendar</li>
<li class="link"> Economic Calendar</li>
</ul>
</div>
</div>
Or you can simply add a min-height to your elements to be sure they have the same height:
.links {
float: left;
display: inline-block;
width: calc(100% / 5);
}
#media all and (max-width:992px) {
.links {
margin-top: 30px;
width: 50%;
min-height:170px; /* adjust this value with want you what*/
}
.title {
font-size: 14px;
margin-bottom: 5px;
padding-bottom: 7px;
display: inline-block;
border-bottom: 2px solid $highlight-blue;
}
ul {
margin: 0;
padding: 0;
display: block;
}
li {
margin-top: 5px;
font-size: 13px;
}
li a {
color: #000 text-decoration: none;
cursor: pointer;
}
}
<div class="row">
<div class="col-xs-12 footer-links">
<div class="links">
<h1 class="title">ABOUT US</h1>
<ul>
<li class="link"> About Company</li>
<li class="link"> Legal Documents</li>
<li class="link"> Careers</li>
<li class="link"> Contact Us</li>
<li class="link"> FAQs</li>
</ul>
</div>
<div class="links">
<h1 class="title">ACCOUNTS</h1>
<ul>
<li class="link">Register</li>
<li class="link">Compare Account Types</li>
<li class="link">Funding Options</li>
<li class="link">Islamic Account</li>
</ul>
</div>
<div class="links">
<h1 class="title">INSTRUMENTS</h1>
<ul>
<li class="link"> Currencies</li>
<li class="link"> Commodities</li>
<li class="link"> Metals</li>
<li class="link"> Shares</li>
<li class="link"> Bonds</li>
<li class="link"> Indices</li>
</ul>
</div>
<div class="links">
<h1 class="title">PLATFORMS</h1>
<ul>
<li class="link"> Meta Trader 4</li>
<li class="link"> MT4 Desktop</li>
<li class="link"> MT4 iOS</li>
<li class="link"> MT4 Android</li>
<li class="link"> MT4 Webtrader</li>
</ul>
</div>
<div class="links">
<h1 class="title">TRADING TOOLS</h1>
<ul>
<li class="link"> Expiration Dates</li>
<li class="link"> Market Hours</li>
<li class="link"> Holiday Calendar</li>
<li class="link"> Economic Calendar</li>
</ul>
</div>
</div>
Another easy fix for your situation is to clear floating after each last element of each row by using clear:left (but you need to adjust this if you change your logic, for example 3 per row instead of 2 per row):
.links {
float: left;
display: inline-block;
width: calc(100% / 5);
}
#media all and (max-width:992px) {
.links {
margin-top: 30px;
width: 50%;
}
/* Added this code*/
.links:nth-child(2n+1) {
clear:left;
}
/**/
.title {
font-size: 14px;
margin-bottom: 5px;
padding-bottom: 7px;
display: inline-block;
border-bottom: 2px solid $highlight-blue;
}
ul {
margin: 0;
padding: 0;
display: block;
}
li {
margin-top: 5px;
font-size: 13px;
}
li a {
color: #000 text-decoration: none;
cursor: pointer;
}
}
<div class="row">
<div class="col-xs-12 footer-links">
<div class="links">
<h1 class="title">ABOUT US</h1>
<ul>
<li class="link"> About Company</li>
<li class="link"> Legal Documents</li>
<li class="link"> Careers</li>
<li class="link"> Contact Us</li>
<li class="link"> FAQs</li>
</ul>
</div>
<div class="links">
<h1 class="title">ACCOUNTS</h1>
<ul>
<li class="link">Register</li>
<li class="link">Compare Account Types</li>
<li class="link">Funding Options</li>
<li class="link">Islamic Account</li>
</ul>
</div>
<div class="links">
<h1 class="title">INSTRUMENTS</h1>
<ul>
<li class="link"> Currencies</li>
<li class="link"> Commodities</li>
<li class="link"> Metals</li>
<li class="link"> Shares</li>
<li class="link"> Bonds</li>
<li class="link"> Indices</li>
</ul>
</div>
<div class="links">
<h1 class="title">PLATFORMS</h1>
<ul>
<li class="link"> Meta Trader 4</li>
<li class="link"> MT4 Desktop</li>
<li class="link"> MT4 iOS</li>
<li class="link"> MT4 Android</li>
<li class="link"> MT4 Webtrader</li>
</ul>
</div>
<div class="links">
<h1 class="title">TRADING TOOLS</h1>
<ul>
<li class="link"> Expiration Dates</li>
<li class="link"> Market Hours</li>
<li class="link"> Holiday Calendar</li>
<li class="link"> Economic Calendar</li>
</ul>
</div>
</div>
inline-block automatically adds some margin to the elements, I believe around 4px. So 50% plus that 4px will make it more than 100%, pushing down the elements. Try changing to just block instead.

Why is chrome not using use of all the width when using columns?

I have a problem with Chrome and columns.
I want to have sets of links each with a title that are organised into columns that will not be split between multiple columns.
I have managed to acheive this in firefox, ie and safari but chrome is not playing ball.
If display:inline-block is removed it nearly works except then everything looks messy.
Any help is greatly appreciated
.
footer {
padding: 0px;
margin: 8px 0px 0px 0px;
background-color: #f5f5f5;
border-top: 1px solid #ddd;
}
footer .footerlinks {
columns: 170px;
-webkit-columns: 170px;
-moz-columns: 170px;
padding: 0px 0px 20px 0px;
margin: 0px 0px 0px 0px;
}
footer .footerset {
-webkit-column-break-inside: avoid;
-moz-column-break-inside: avoid;
break-inside: avoid;
display: inline-block;
}
<footer>
<div class="container">
<div class="footerlinks">
<div class="footerset">
<h3>qwerty</h3>
<ul>
<li>fsfdsfsdfdsfdsfds
</li>
<li>feefrerefref
</li>
<li>fdsfdsfdsfdsfsdfdsfsdfds
</li>
<li>fdsfdsfdsfdsfsdfdsfd
</li>
<li>gdggdgfdvfdvffgbfdgfd
</li>
<li>gfdgdfgfdgfdgfdgfdgdf
</li>
</ul>
</div>
<div class="footerset">
<h3>gdgdfvfdvfdvfdvfdvdfvfd</h3>
<ul>
<li>vcxvcvxc
</li>
<li>vxcvcxvcxvcxvcxvcxvcxvcx
</li>
<li>fdsfdsfds
</li>
<li>vfdbfdsfd
</li>
<li>dfsbgsfngfsh
</li>
<li>bgsfvsd
</li>
<li>gfdgfdgfds
</li>
<li>gfdgdfgdfgdfgsd
</li>
<li>gfdgfdgfdgfdgfdgfdgfdgfdgdfsgfdgfd
</li>
<li>gfsgtrghtrgrwgtrrewgfdvdfbfsbfgbfsb
</li>
</ul>
</div>
<div class="footerset">
<h3>dfdsfsdfds</h3>
<ul>
<li>fdsfdsfdsfdsfsd
</li>
<li>fdsfdsfdsfsd
</li>
<li>fdsfdsfds
</li>
<li>fdsfdsfsdfdsfsd
</li>
<li>fsdfdsfdsfsdfds
</li>
<li>fsdfdsfdsfds
</li>
</ul>
</div>
<div class="footerset">
<h3>fdsfdsafdsafsda</h3>
<ul>
<li>fdsfdsafadsfsda
</li>
<li>fdsfdsfdsfdsfsdfdsfdsafds
</li>
<li>fdsfdsafdsfdsa
</li>
<li>fdsfdsfdsfdsfdadvfdfavree
</li>
<li>vdafdsafdsafdsaa
</li>
<li>fdsfdsafdsfdsfdsafdsafds
</li>
<li>fdsfdsafdsfsdn
</li>
</ul>
</div>
<div class="footerset">
<h3>fdseneral</h3>
<ul>
<li>dfadsfdafdsration
</li>
<li>fdsaountisrvices
</li>
<li>ssssccsasccounts
</li>
<li>saompaniescts
</li>
</ul>
</div>
</div>
</div>
</footer>
Why not do it like that??
footer {
padding: 0px;
margin: 8px 0px 0px 0px;
background-color: #f5f5f5;
border-top: 1px solid #ddd;
}
footer .footerlinks {
width: 100%;
box-sizing: border-box;
padding: 0px 0px 20px 0px;
margin: 0px 0px 0px 0px;
}
footer .footerset {
width: 33%;
float: left;
padding: 16px;
box-sizing: border-box;
}
footer .footerset:nth-child(4) {
clear: both;
}
<footer>
<div class="container">
<div class="footerlinks">
<div class="footerset">
<h3>qwerty</h3>
<ul>
<li>fsfdsfsdfdsfdsfds
</li>
<li>feefrerefref
</li>
<li>fdsfdsfdsfdsfsdfdsfsdfds
</li>
<li>fdsfdsfdsfdsfsdfdsfd
</li>
<li>gdggdgfdvfdvffgbfdgfd
</li>
<li>gfdgdfgfdgfdgfdgfdgdf
</li>
</ul>
</div>
<div class="footerset">
<h3>gdgdfvfdvfdvf</h3>
<ul>
<li>vcxvcvxc
</li>
<li>vxcvcxvcxvcxvcx
</li>
<li>fdsfdsfds
</li>
<li>vfdbfdsfd
</li>
<li>dfsbgsfngfsh
</li>
<li>bgsfvsd
</li>
<li>gfdgfdgfds
</li>
<li>gfdgdfgdfgdfgsd
</li>
<li>gfdgfdgfdgfdgfdgf
</li>
<li>gfsgtrghtrgrwgtrr
</li>
</ul>
</div>
<div class="footerset">
<h3>dfdsfsdfds</h3>
<ul>
<li>fdsfdsfdsfdsfsd
</li>
<li>fdsfdsfdsfsd
</li>
<li>fdsfdsfds
</li>
<li>fdsfdsfsdfdsfsd
</li>
<li>fsdfdsfdsfsdfds
</li>
<li>fsdfdsfdsfds
</li>
</ul>
</div>
<div class="footerset">
<h3>fdsfdsafdsafsda</h3>
<ul>
<li>fdsfdsafadsfsda
</li>
<li>fdsfdsfdsfdsfsdfdsfdsafds
</li>
<li>fdsfdsafdsfdsa
</li>
<li>fdsfdsfdsfdsfdadvfdfavree
</li>
<li>vdafdsafdsafdsaa
</li>
<li>fdsfdsafdsfdsfdsafdsafds
</li>
<li>fdsfdsafdsfsdn
</li>
</ul>
</div>
<div class="footerset">
<h3>fdseneral</h3>
<ul>
<li>dfadsfdafdsration
</li>
<li>fdsaountisrvices
</li>
<li>ssssccsasccounts
</li>
<li>saompaniescts
</li>
</ul>
</div>
</div>
</div>
</footer>

html list hover moves other items

I am making a Menu page and i want it to look like this. (I've set a default img for all items for now).
Pizza
pizza1 pizza2 pizza3
imgPizza1 imgPizza2 imgPizza3
Salad
etc
I am using next code:
<div id="MainContent_panelItems">
<br></br><br></br><br></br>
<p class="menuTitle">Pizza</p>
<hr>
</hr>
<ul class="foodItems">
<li style="height:100px;width:200px;">
<p>Pizza Diavola</p>
<img align="center" src="Images/orderedList1.png"></img>
</li>
<li style="height:100px;width:200px;">
<p>Pizza Quattro Formaggi</p>
<img align="center" src="Images/orderedList1.png"></img>
</li>
<li style="height:100px;width:200px;">
<p>Pizza1RoPizza1RoPizza1Ro</p>
<img align="center" src="Images/orderedList1.png"></img>
</li>
<li style="height:100px;width:200px;">
<p>Pizza2RoPizza2RoPizza2Ro</p>
<img align="center" src="Images/orderedList1.png"></img>
</li>
<li style="height:100px;width:200px;">
<p>Pizza3RoPizza3RoPizza3Ro</p>
<img align="center" src="Images/orderedList1.png"></img>
</li>
<li style="height:100px;width:200px;">
<p>Pizza4RoPizza4RoPizza4Ro</p>
<img align="center" src="Images/orderedList1.png"></img>
</li>
<li style="height:100px;width:200px;">
<p>Pizza5RoPizza5Ro</p>
<img align="center" src="Images/orderedList1.png"></img>
</li>
<li style="height:100px;width:200px;">
<p>Pizza6RoPizza6RoPizza6Ro</p>
<img align="center" src="Images/orderedList1.png"></img>
</li>
<li style="height:100px;width:200px;">
<p>Pizza7RoPizza7RoPizza7Ro</p>
<img align="center" src="Images/orderedList1.png"></img>
</li>
</ul>
<br></br><br></br><br></br>
<p class="menuTitle">Paste</p>
<hr>
</hr>
<ul class="foodItems">
<li style="height:100px;width:200px;">
<p>Spaghete Carbonara</p>
<img align="center" src="Images/orderedList1.png"></img>
</li>
</ul>
<br></br><br></br><br></br>
<p class="menuTitle">Salate</p>
<hr>
</hr>
<ul class="foodItems">
<li style="height:100px;width:200px;">
<p>Salată Caesar</p>
<img align="center" src="Images/orderedList1.png"></img>
</li>
</ul>
<br></br><br></br><br></br>
<p class="menuTitle">Băuturi</p>
<hr>
</hr>
<ul class="foodItems">
<li style="height:100px;width:200px;">
<p>Coca-Cola 0.5l</p>
<img align="center" src="Images/orderedList1.png"></img>
</li>
</ul>
</div>
CSS:
.foodItems li
{
display: inline;
float: left;
padding: 10px;
}
.foodItems li:hover
{
border-style:solid;
border-color: #333;
border-width: 1px;
}
p.menuTitle {
font-weight: bold;
}
it looks like this:
My problem is with the lines position and menuTitles and also when i hover over an item, the others move such in following picture:
LE:
The problem here is, border is set only on :hover, so the overall width gets affected and the whole layout gets messed up. What you need to do is, set the border-width to 1px in the normal state as well.
.foodItems li {
display: inline;
float: left;
padding: 10px;
border: 1px solid transparent;
}

Why will my body not accept my margins?

I am building a site for my school's robotics team. This is my first time ever coding in html/css. For some reason, my other pages use the margins quite nicely, but for this page specifically, my "margin-right" element does not work.
<!DOCTYPE>
<html>
<head>
<link rel="stylesheet" type="text/css" href="index_style.css">
<link href='http://fonts.googleapis.com/css?family=Roboto+Slab' rel='stylesheet' type='text/css'>
<title>Team 3774 Homepage</title>
</head>
<body>
<div id="page">
<div class="Banner">
<a class="Banner_Link" href="www.robotichive3774.com">
<img src="/Images/Banner.png" height="200" width="1350" border="0">
</a>
</div>
<div class="navbar">
<ul class="nav">
<li><a class="li_nav" href="/Home">Home</a></li>
<li><a class="li_nav" href="/Team Bio">Team Bio</a></li>
<li><a class="li_nav" href="/Our Robot">Our Robot</a></li>
<li><a class="li_nav" href="/Our Coach">Our Coach</a></li>
<li><a class="li_nav" href="/Gallery">Gallery</a></li>
<li><a class="li_nav" href="/Outreach">Outreach</a></li>
<li><a class="li_nav" href="/Youtube">Youtube</a></li>
</ul>
</div>
<div class="Team_Bio">
<div class="example">
<h2>Team Bio</h2>
<h1>Example</h1>
<ul>
<li class="li_info">Class</li>
<li class="li_info">Role</li>
<li class="li_info">Career Interests</li>
<li class="li_info">Other Clubs and Sports</li>
</ul>
</div>
<div class="Abanoub_Boules">
<div class="info_AB">
<h1>Abanoub Boules</h1>
<ul>
<li class="li_info">Senior</li>
<li class="li_info">Captian, Coder, Documenter</li>
<li class="li_info">CEO of a Biology Firm</li>
<li class="li_info">Coptic Society</li>
<li class="li_info">Technology Student Association</li>
<li class="li_info">President of Stem Clubs</li>
</ul>
</div>
<div class="picture_AB">
<img src="Abanoub.jpg" width="350px" height="350px">
</div>
</div>
<div class="Andre_Bernardo">
<div class="info_ABe">
<h1>Andre Bernardo</h1>
<ul>
<li class="li_info">Senior</li>
<li class="li_info">Engineer, 3D modeling</li>
<li class="li_info">Computer Science</li>
<li class="li_info">Tennis</li>
<li class="li_info">Technology Student Association</li>
</ul>
</div>
<div class="picture_ABe">
<img src="Andre.jpg" width="350px" height="350px">
</div>
</div>
<div class="Leo_Scarano">
<div class="info_LS">
<h1>Leo Scarano</h1>
<ul>
<li class="li_info">Senior</li>
<li class="li_info">Engineer, Coder</li>
<li class="li_info">Computer Science</li>
<li class="li_info">Technology Student Association</li>
</ul>
</div>
<div class="picture_LS">
<img src="Leo.jpg" width="350px" height="350px">
</div>
</div>
<div class="Mina_Hanna">
<div class="info_MH">
<h1>Mina Hanna</h1>
<ul>
<li class="li_info">Senior</li>
<li class="li_info">Engineer, Coder</li>
<li class="li_info">Pharmaceutics</li>
<li class="li_info">Coptic Society</li>
<li class="li_info">Technology Student Association</li>
</ul>
</div>
<div class="picture_MH">
<img src="Mina.jpg" width="350px" height="350px">
</div>
</div>
<div class="Kenneth_Rebbecke">
<div class="info_KR">
<h1>Kenneth Rebbecke</h1>
<ul>
<li class="li_info">Senior</li>
<li class="li_info">Engineer, Documenter</li>
<li class="li_info">Structual Engineering</li>
<li class="li_info">Technology Student Association</li>
</ul>
</div>
<div class="picture_KR">
<img src="Kenny.jpg" width="350px" height="350px">
</div>
</div>
<div class="Kristen_Kaldas">
<div class="info_KK">
<h1>Kristen Kaldas</h1>
<ul>
<li class="li_info">Senior</li>
<li class="li_info">Coder, Bookkeeper</li>
<li class="li_info">Biomedical Engineering</li>
<li class="li_info">Science Seminar</li>
<li class="li_info">Science Club</li>
<li class="li_info">Technology Student Association</li>
</ul>
</div>
<div class="picture_KK">
<img src="Kristen.jpg" width="350px" height="350px">
</div>
</div>
<div class="Melanie_Aguilar">
<div class="info_MA">
<h1>Melanie Aguilar</h1>
<ul>
<li class="li_info">Senior</li>
<li class="li_info">Secratary, Mascot</li>
<li class="li_info">Party Planner</li>
<li class="li_info">Yearbook</li>
</ul>
</div>
<div class="picture_MA">
<img src="Melanie.jpg" width="350px" height="350px">
</div>
</div>
<div class="Anish_Patel">
<div class="info_AP">
<h1>Anish Patel</h1>
<ul>
<li class="li_info">Junior</li>
<li class="li_info">Engineer, 3d modeling</li>
<li class="li_info">Mechanical Engineer</li>
<li class="li_info">Science Club</li>
<li class="li_info">Junior Classical League</li>
<li class="li_info">Certamn</li>
</ul>
</div>
<div class="picture_AP">
<img src="Anish.jpg" width="350px" height="350px">
</div>
</div>
<div class="Furhan_Ashraf">
<div class="info_FA">
<h1>Furhan Ashraf</h1>
<ul>
<li class="li_info">Junior</li>
<li class="li_info">Financial Advisor, Engineer</li>
<li class="li_info">Engineering/Undecided</li>
<li class="li_info">Science Club</li>
<li class="li_info">Technology Student Association</li>
</ul>
</div>
<div class="picture_FA">
<img src="Furhan.jpg" width="350px" height="350px">
</div>
</div>
<div class="Andrew_W">
<div class="info_AW">
<h1>Andrew Wojtkowski</h1>
<ul>
<li class="li_info">Senior</li>
<li class="li_info">Engineer, 3d Modeling</li>
<li class="li_info">Aerospace Engineer</li>
<li class="li_info">Varsity Hockey</li>
<li class="li_info">Technology Student Association</li>
</ul>
</div>
<div class="picture_AW">
<img src="Andrew.jpg" width="350px" height="350px">
</div>
</div>
<div class="Bryan_F">
<div class="info_BF">
<h1>Bryan Ferreira</h1>
<ul>
<li class="li_info">Senior</li>
<li class="li_info">Engineer, Documenter</li>
<li class="li_info">Computer Engineer/Civil Engineer</li>
<li class="li_info">Guitar</li>
<li class="li_info">Technology Student Association</li>
</ul>
</div>
<div class="picture_BF">
<img src="Bryan.jpg" width="350px" height="350px">
</div>
</div>
</div>
</div>
</body>
</html>
CSS
.Team_Bio
{
margin-left: 200px;
margin-right: 200px;
}
a.Banner_Link
{
padding:0 !important;
}
.Banner
{
height: 200px;
width: 1350px;
}
#page{
width: 1000px;
margin-left: 0px;
margin-right: 0px;
}
div
{
font-family: 'Roboto Slab', serif;
}
.body
{
margin-left: 200px;
margin-right: 200px;
margin-top: 50px;
margin-bottom: 100px;
}
.Banner img
{
vertical-align:top;
}
body
{
margin: 0;
}
.li_nav
{
float: left;
display:inline-block;
font-family: 'Roboto Slab', serif;
}
.nav
{
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
min-width: 1350px;
}
a:link, a:visited
{
display:inline-block;
width: 182.7px;
padding-top: 12px;
padding-right: 5px;
padding-bottom: 14px;
padding-left: 5px;
font-weight: bold;
color: #FFFFFF;
background-color: #990000;
text-align: center;
text-decoration: none;
font-family: 'Roboto Slab', serif;
}
a:hover, a:active
{
background-color: #B20000;
}
.Team_Bio
{
min-width: 1350px;
}
h2
{
font-size: 60px;
text-align: center;
}
.example
{
float: left;
width: 1350px;
height: 425px;
margin: 0 auto;
}
.Abanoub_Boules
{
float: left;
width: 1350px;
height: 500px;
margin: 0 auto;
}
The site is robotichive3774.com if you want to see exactly what I am talking about.
It's true, the HTML and CSS are a mess but as you said you're new to this.
The layout problem has to do with the widths of your team member sections inside that element. They're forcing it to stretch out.
I'd recode the CSS for the team members.
Start by removing the pixels widths on each team member's and set them to percentage based widths.
Make the team member's main element 100% wide so it just fills the container it's sitting in.
Then set their info and picture wrapping elements to 49% each.
Set the image inside the picture wrapping element to 100% and auto for the height.
Do all these widths etc in your CSS file.
That should fix you right up.
Lastly, if you're gonna do the floats put a "clearing div" after each team member so the next section if forced below the previous run. Otherwise things will run into each other.
Like this:
<div class="clear"></div>
.clear { clear: both; }
In the end, you should really simply your code. There's too many classes etc. All the team member sections could have the same class so you can apply global rules etc.