This question already has answers here:
How to align a <div> to the middle (horizontally/width) of the page [duplicate]
(27 answers)
Closed 6 years ago.
I have a <ul> with 6 images, no text. I can't seem to make it be in the center of the page. This is my code.
CSS
.logos{
margin:0 auto;
text-align:center;
display:table;
float: left;
}
HTML
<div class="logos" style="margin:0 auto;">
<ul class="logos">
<li class="logos"> <img src="imgs/logo1.gif"> </li>
<li class="logos"> <img src="imgs/logo2.gif"> </li>
<li class="logos"> <img src="imgs/logo3.gif"> </li>
<li class="logos"> <img src="imgs/logo4.gif"> </li>
<li class="logos"> <img src="imgs/logo5.gif"> </li>
<li class="logos"> <img src="imgs/logo6.gif"> </li>
</ul>
</div>
You need to change
.logos{
margin:0 auto;
text-align:center;
display:table;
float: left;
}
to
.logos{
margin:0 auto;
text-align:center;
display:table;
}
and the content will be in the middle of the page
Also you need to delete the div because is useless ,you set the same class to the ul and to div
Do it like this
.logo_wrapper {
width: 100%;
position: relative;
}
.logos {
position: absolute;
left: 50%;
transform: translateX(-50%);
padding: 0;
}
.logo {
display: inline-block;
margin: 0 auto;
text-align: center;
float: left;
}
<div class="logo_wrapper">
<ul class="logos">
<li class="logo">
<img src="imgs/logo1.gif">
</li>
<li class="logo">
<img src="imgs/logo2.gif">
</li>
<li class="logo">
<img src="imgs/logo3.gif">
</li>
<li class="logo">
<img src="imgs/logo4.gif">
</li>
<li class="logo">
<img src="imgs/logo5.gif">
</li>
<li class="logo">
<img src="imgs/logo6.gif">
</li>
</ul>
</div>
First of all remove the class name for div. ul and div have the same class name.
Give float:left to li
.logos{
margin:0 auto;
display:table;
}
.logos li{
float:left;
}
<div>
<ul class="logos">
<li class="logos"> <img src="imgs/logo1.gif"> </li>
<li class="logos"> <img src="imgs/logo2.gif"> </li>
<li class="logos"> <img src="imgs/logo3.gif"> </li>
<li class="logos"> <img src="imgs/logo4.gif"> </li>
<li class="logos"> <img src="imgs/logo5.gif"> </li>
<li class="logos"> <img src="imgs/logo6.gif"> </li>
</ul>
</div>
Related
I'm creating a menu, where if I hover over the li class="drop", then the visibility of my #competences-dropdown should become visible, but it doesn't wanna work for some reason. Can someone please help by telling what didn't I noticed?
.drop:hover #competences-dropdown {
visibility:visible;
}
#competences-dropdown {
background-color:rgba(51,51,51,0.8);
width:100%;
padding-right:100px;
position:absolute;
z-index:3;
visibility:hidden;
-webkit-transition:1s;
display:block;
}
<div id="menu">
<ul class="navigation">
<li>Forside</li>
<li class="drop">Kompetencer</li>
<li>Om Magento</li>
<li>Teamet</li>
<li>Cases</li>
<li>Blog</li>
<li>Kontakt</li>
</ul>
</div>
<div id="competences-dropdown">
<div class="row">
<div class="col-sm-12">
<ul class="dropdown">
<li><a href="">
<h1>WEBUDVIKLING</h1>
<img class="img-responsive" src="img/dropdown/webdev.png" alt="Webdev"/>
</a></li>
<li><a href="">
<h1>DESIGN</h1>
<img class="img-responsive" src="img/dropdown/design.png" alt="Design"/>
</a></li>
<li><a href="">
<h1>MARKETING</h1>
<img class="img-responsive" src="img/dropdown/marketing.png" alt="Marketing"/>
</a></li>
</ul>
</div>
</div>
</div>
of cousre it doesn't work as your css says:
.drop:hover #competences-dropdown {
visibility:visible;
}
which means #competences-dropdown is a child of .drop, which it is not.
so the solution would be making #competences-dropdown a child of .drop as follows, and everything should work fine:
.drop:hover #competences-dropdown {
visibility:visible;
}
#competences-dropdown {
background-color:rgba(51,51,51,0.8);
width:100%;
padding-right:100px;
position:absolute;
z-index:3;
visibility:hidden;
-webkit-transition:1s;
display:block;
}
<div id="menu">
<ul class="navigation">
<li>Forside</li>
<li class="drop">
Kompetencer
<div id="competences-dropdown">
<div class="row">
<div class="col-sm-12">
<ul class="dropdown">
<li>
<a href="">
<h1>WEBUDVIKLING</h1>
<img class="img-responsive" src="img/dropdown/webdev.png" alt="Webdev"/>
</a>
</li>
<li>
<a href="">
<h1>DESIGN</h1>
<img class="img-responsive" src="img/dropdown/design.png" alt="Design"/>
</a>
</li>
<li>
<a href="">
<h1>MARKETING</h1>
<img class="img-responsive" src="img/dropdown/marketing.png" alt="Marketing"/>
</a>
</li>
</ul>
</div>
</div>
</div>
</li>
<li>Om Magento</li>
<li>Teamet</li>
<li>Cases</li>
<li>Blog</li>
<li>Kontakt</li>
</ul>
</div>
Try to use
.drop:hover {
visibility:visible;
}
Maybe you should try opacity instead of visibility
Also do put the :hover always at the end of your code like this
.example #example:hover{}
And not
.example:hover #example{}
I have currently 4 widgets witch have their own sizes. I have placed them within a main div called #box I get them centered by reducing the width to about 60% and having margin left and right on auto. If I zoom out in my browser the widget blocks moves more to the left and does not stay centered.
<div id="Box"><!--Start Div Box-->
<div id="TA_certificateOfExcellence580" class="Certificate Certificate-one">
<ul id="Lnnr78SGL0" class="TA_links 4fJwNUzU0uDT">
<li id="phnjh3wZ" class="Yi5zwOy1yHP">
<a target="_blank" href="https://www.tripadvisor.co.za">
<img src="https://www.tripadvisor.co.za/img/cdsi/img2/awards/CoE2014_WidgetAsset-14348-2.png" alt="TripAdvisor"
class="widCOEImg" /></a>
</li>
</ul>
</div>
<div id="TA_certificateOfExcellence654" class="Certificate Certificate-two">
<ul id="FVuBAHp" class="TA_links CPqPZ6">
<li id="dYmcZAj7eGOi" class="FKHiRxci">
<a target="_blank" href="https://www.tripadvisor.co.za">
<img src="https://www.tripadvisor.co.za/img/cdsi/img2/awards/CoE2014_WidgetAsset-14348-2.png" alt="TripAdvisor"
class="widCOEImg" /></a>
</li>
</ul>
</div>
<div id="TA_certificateOfExcellence588" class="Certificate Certificate-three">
<ul id="E4oUIOq5y" class="TA_links JWgIqGH4nEMg">
<li id="R3Oc1SU8Y" class="bXEYi56LVvek">
<a target="_blank" href="https://www.tripadvisor.co.za">
<img src="https://www.tripadvisor.co.za/img/cdsi/img2/awards/CoE2014_WidgetAsset-14348-2.png" alt="TripAdvisor"
class="widCOEImg" /></a>
</li>
</ul>
</div>
<div id="TA_certificateOfExcellence396" class="Certificate Certificate-four-last">
<ul id="ENh9NKezEOIt" class="TA_links j9dirUfR">
<li id="LKMj2Zk" class="Z16i8koQq">
<a target="_blank" href="https://www.tripadvisor.co.za/Attraction_Review-g312578-d2284717-Reviews-Felleng_Day_Tours-Johannesburg_Greater_Johannesburg_Gauteng.html">
<img src="https://www.tripadvisor.co.za/img/cdsi/img2/awards/CoE2015_WidgetAsset-14348-2.png" alt="TripAdvisor"
class="widCOEImg" /></a>
</li>
</ul>
</div>
</div><!--End Div Box-->
#Box
{
background-color:#CCCCCC;
width:60%;
margin-left:auto;
margin-right:auto;
}
Image before zooming browser out
Image after zooming out
The problem is that the container of your images itself is indeed centred, but the images are aligned to the left of that container. If you gave the #box a different background color, you'd see that immediately.
Try giving the #Box element a center, and then center the inside elements as well.
Since you are using <div> elements, I'd go for float: left and giving each element a specific width property. I'd rather go with an inline-block element because it's easier to center, and because you only have images which are naturally inline-block, but this is not what you have implemented.
Check out this fiddle: https://jsfiddle.net/abvt8ekj/
And the snippet:
.container {
background-color: #ee55cc;
}
#Box{
background-color:#CCCCCC;
width:60%;
margin-left:auto;
margin-right:auto;
}
#Box:after {
display: block;
content: "";
clear: both;
}
.Certificate {
width: 25%;
float: left;
overflow: hidden;
}
.Certificate ul,
.Certificate li {
margin: 0;
padding: 0;
}
<div class="container">
<div id="Box"><!--Start Div Box-->
<div id="TA_certificateOfExcellence580" class="Certificate Certificate-one">
<ul id="Lnnr78SGL0" class="TA_links 4fJwNUzU0uDT">
<li id="phnjh3wZ" class="Yi5zwOy1yHP">
<a target="_blank" href="https://www.tripadvisor.co.za">
<img src="https://www.tripadvisor.co.za/img/cdsi/img2/awards/CoE2014_WidgetAsset-14348-2.png" alt="TripAdvisor"
class="widCOEImg" /></a>
</li>
</ul>
</div>
<div id="TA_certificateOfExcellence654" class="Certificate Certificate-two">
<ul id="FVuBAHp" class="TA_links CPqPZ6">
<li id="dYmcZAj7eGOi" class="FKHiRxci">
<a target="_blank" href="https://www.tripadvisor.co.za">
<img src="https://www.tripadvisor.co.za/img/cdsi/img2/awards/CoE2014_WidgetAsset-14348-2.png" alt="TripAdvisor"
class="widCOEImg" /></a>
</li>
</ul>
</div>
<div id="TA_certificateOfExcellence588" class="Certificate Certificate-three">
<ul id="E4oUIOq5y" class="TA_links JWgIqGH4nEMg">
<li id="R3Oc1SU8Y" class="bXEYi56LVvek">
<a target="_blank" href="https://www.tripadvisor.co.za">
<img src="https://www.tripadvisor.co.za/img/cdsi/img2/awards/CoE2014_WidgetAsset-14348-2.png" alt="TripAdvisor"
class="widCOEImg" /></a>
</li>
</ul>
</div>
<div id="TA_certificateOfExcellence396" class="Certificate Certificate-four-last">
<ul id="ENh9NKezEOIt" class="TA_links j9dirUfR">
<li id="LKMj2Zk" class="Z16i8koQq">
<a target="_blank" href="https://www.tripadvisor.co.za/Attraction_Review-g312578-d2284717-Reviews-Felleng_Day_Tours-Johannesburg_Greater_Johannesburg_Gauteng.html">
<img src="https://www.tripadvisor.co.za/img/cdsi/img2/awards/CoE2015_WidgetAsset-14348-2.png" alt="TripAdvisor"
class="widCOEImg" /></a>
</li>
</ul>
</div>
</div><!--End Div Box-->
</div>
If you don't want to specify a width to your main box, you can use the text-align property :
text-align:center;
Here's a Fiddle with a little demo : https://jsfiddle.net/valentinho14/cst30wuc/
Try instead of using the div called #box be in the center of the page, put another div inside #box1 and align that second div in the center.
Example:
<!DOCTYPE html>
<html>
<head>
<style>
#box1{
background-color:black;
}
#box2{
margin:auto;
background-color:green;
width:50px;
height:50px;
display:block;
align:center;
}
</style>
</head>
<body>
<div id = "box1">
<div id = "box2"></div>
</div>
</body>
</html>
That did it for me, and even if you zoom in or out the div will stay in the center. Just put the images into the second div. Take care.
you can try doing it with flexbox like this it will always stay in the center!
and if you dont want the list-style-type dont forget to put padding-left:0px; to the ul's because by default ther is a padding :40px;
#Box{
display:flex;
justify-content:center;
}
<div id="Box"><!--Start Div Box-->
<div id="TA_certificateOfExcellence580" class="Certificate Certificate-one">
<ul id="Lnnr78SGL0" class="TA_links 4fJwNUzU0uDT">
<li id="phnjh3wZ" class="Yi5zwOy1yHP">
<a target="_blank" href="https://www.tripadvisor.co.za">
<img src="https://www.tripadvisor.co.za/img/cdsi/img2/awards/CoE2014_WidgetAsset-14348-2.png" alt="TripAdvisor"
class="widCOEImg" /></a>
</li>
</ul>
</div>
<div id="TA_certificateOfExcellence654" class="Certificate Certificate-two">
<ul id="FVuBAHp" class="TA_links CPqPZ6">
<li id="dYmcZAj7eGOi" class="FKHiRxci">
<a target="_blank" href="https://www.tripadvisor.co.za">
<img src="https://www.tripadvisor.co.za/img/cdsi/img2/awards/CoE2014_WidgetAsset-14348-2.png" alt="TripAdvisor"
class="widCOEImg" /></a>
</li>
</ul>
</div>
<div id="TA_certificateOfExcellence588" class="Certificate Certificate-three">
<ul id="E4oUIOq5y" class="TA_links JWgIqGH4nEMg">
<li id="R3Oc1SU8Y" class="bXEYi56LVvek">
<a target="_blank" href="https://www.tripadvisor.co.za">
<img src="https://www.tripadvisor.co.za/img/cdsi/img2/awards/CoE2014_WidgetAsset-14348-2.png" alt="TripAdvisor"
class="widCOEImg" /></a>
</li>
</ul>
</div>
<div id="TA_certificateOfExcellence396" class="Certificate Certificate-four-last">
<ul id="ENh9NKezEOIt" class="TA_links j9dirUfR">
<li id="LKMj2Zk" class="Z16i8koQq">
<a target="_blank" href="https://www.tripadvisor.co.za/Attraction_Review-g312578-d2284717-Reviews-Felleng_Day_Tours-Johannesburg_Greater_Johannesburg_Gauteng.html">
<img src="https://www.tripadvisor.co.za/img/cdsi/img2/awards/CoE2015_WidgetAsset-14348-2.png" alt="TripAdvisor"
class="widCOEImg" /></a>
</li>
</ul>
</div>
</div><!--End Div Box-->
i have a problem with a menu i am making, i want it to be something like:
<icon> <icon> <icon>
Title Longer Title
Title
now i have it like this:
<icon>
<icon> longer <icon>
Title Title Title
I made the menu using lists like this (Copy from actual code)
<ul>
<li>
<img src="images/buton1.png" class="butonmeniu"><h2 class="meniufont" >Info utile</h2>
</li>
</ul>
and the css styles are like this
.meniufont{
font-family:'Open Sans', sans-serif;
font-size:15px;
margin-right:10px;
text-align: center;
font-weight:normal;
color:#434446;
}
.butonmeniu{
display:block;
}
Thanks alot, if you have any questions please ask. Thank you.
li {
display: table-cell;
vertical-align: top;
width: 90px;
padding: 5px;
}
<ul>
<li>
<img src="http://placephant.com/80/80" class="butonmeniu"><h2 class="meniufont" >Info utile</h2>
</li>
<li>
<img src="http://placephant.com/80/80" class="butonmeniu"><h2 class="meniufont" >Info utile Into utile</h2>
</li>
</ul>
Your li are using display:inline-block
Add vertical-align:top to the li as the default there is baseline.
.meniufont {
font-family: 'Open Sans', sans-serif;
font-size: 15px;
font-weight: normal;
color: #434446;
}
.butonmeniu {
display: block;
}
li {
display: inline-block;
text-align: center;
margin: 0 10px;
vertical-align: top;
}
<div class="menu">
<ul>
<li>
<a href="#">
<img src="http://www.fillmurray.com/g/20/20" class="butonmeniu">
<h2 class="meniufont">Title</h2>
</a>
</li>
<li>
<a href="#">
<img src="http://www.fillmurray.com/g/20/20">
<h2 class="meniufont textjos">Longer <br>Title</h2>
</a>
</li>
<li>
<a href="#">
<img src="http://www.fillmurray.com/g/20/20">
<h2 class="meniufont">Title</h2>
</a>
</li>
</ul>
</div>
Sup!
I toyed around with what I thought you were trying to achieve.
See this pen : Codepen Link
#nav { list-style : none;}
.nav-item {
display: inline-block;
width: 100px; /* Make it whatever you want */
}
.meniufont{
font-family:'Open Sans', sans-serif;
font-size:15px;
margin-right:10px;
text-align: center;
font-weight:normal;
color:#434446;
}
.butonmeniu{
display:block;
margin: auto;
width: 100%;
}
<ul id="nav">
<li class="nav-item">
<a href="#">
<img src="http://placehold.it/350x150" class="butonmeniu"><h2 class="meniufont" >Info utile</h2>
</a>
</li>
<li class="nav-item">
<a href="#">
<img src="http://placehold.it/350x150" class="butonmeniu"><h2 class="meniufont" >Info utile</h2>
</a>
</li>
<li class="nav-item">
<a href="#">
<img src="http://placehold.it/350x150" class="butonmeniu"><h2 class="meniufont" >Info utile</h2>
</a>
</li>
</ul>
<body>
<div class="nav">
<div class="container">
<ul>
<li>Home
</li>
<li>Browse
</li>
<li>About the Artist
</li>
<li>Contact
</li>
<li>Help
</li>
<li>
<a href="https://www.facebook.com/gary.nauman">
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcTIxiKzqYh3OHT8LXw268axd6OfuFqgOqxNAr2kWqBL0xeRVfRFuw" alt="https://www.facebook.com/gary.nauman" width="42" height="42" border="0">
</a>
</li>
<li>
<a href="https://garynauman.wordpress.com/">
<img src="http://cdn.mysitemyway.com/etc-mysitemyway/icons/legacy-previews/icons-256/black-ink-grunge-stamps-textures-icons-social-media-logos/097743-black-ink-grunge-stamp-textures-icon-social-media-logos-wordpress.png" alt="https://garynauman.wordpress.com/"
width="42" height="42" border="0">
</a>
</li>
</ul>
</div>
</div>
<div id="art">
<img src="C:\Documents and Settings\USER1\My Documents\Downloads\gknproject\goodtidings.jpg" width="400" height="400" align="middle" class="image" style="padding-left:400px" style="padding-top:50px" />
<hr width="40%">
<img src="C:\Documents and Settings\USER1\My Documents\Downloads\gknproject\coffee.jpg" width="200" height="200" class="image" />
</div>
I need the images to not be right under the nav bar, I've been searching for about an hour and haven't found anything. How can I move the images down with CSS?
I think this will work for you
nav,
.container {
width: 60%;
margin-left: auto;
margin-right: auto;
}
.container ul li {
display: inline-block;
list-style-type: none;
}
ul.menu,
ul.icons {
display: inline-block;
}
#art {
padding-top: 70px;
display: inline-block;
width: 100%;
}
img.image1 {
width: 400px;
height: 400px;
margin-left: auto;
margin-right: auto;
}
img.image2 {
width: 200px;
height: 200px;
padding-left: 20px;
}
hr {
width: 350px;
margin-top: 20px;
}
img,
hr {
display: block;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<body>
<nav>
<div class="container">
<ul class="menu">
<li>Home
</li>
<li>Browse
</li>
<li>About the Artist
</li>
<li>Contact
</li>
<li>Help
</li>
</ul>
<ul class="icons">
<li>
<a href="https://www.facebook.com/gary.nauman">
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcTIxiKzqYh3OHT8LXw268axd6OfuFqgOqxNAr2kWqBL0xeRVfRFuw" alt="https://www.facebook.com/gary.nauman" width="42" height="42" border="0">
</a>
</li>
<li>
<a href="https://garynauman.wordpress.com/">
<img src="http://cdn.mysitemyway.com/etc-mysitemyway/icons/legacy-previews/icons-256/black-ink-grunge-stamps-textures-icons-social-media-logos/097743-black-ink-grunge-stamp-textures-icon-social-media-logos-wordpress.png" alt="https://garynauman.wordpress.com/"
width="42" height="42" border="0">
</a>
</li>
</ul>
</div>
</nav>
<div id="art">
<img class="image1" src="C:\Documents and Settings\USER1\My Documents\Downloads\gknproject\goodtidings.jpg" />
<hr>
<img class="image2" src="C:\Documents and Settings\USER1\My Documents\Downloads\gknproject\coffee.jpg" />
</div>
</body>
</html>
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.