Can't get these divs to display inline - html

I have a website located here.
I am having a hard time displaying some tags as inline. There are no breaks in the HTML, and no clear attributes. There's something missing here, but I don't know what.
Basically, I want them set up like this...
[logoimage][slider][logotitle]
I have changed the slider size by percentage, and tried wrapping everything in a new div and adding the "in-line block" attribute.
Here's my HTML...
<div id="top">
<div id="logo">
<img id="logoimage" src="images/logo_mpire_management.png" width="80" height="56" alt="logo"></div> <!-- Logo image -->
<section id="slideshow"> <!-- Slideshow Start -->
<div class="html_carousel">
<div id="slider">
<div class="slide">
<img src="images/slideshow/sliderimage1.jpg" width="3000" height="783" alt="2 Chainz"/><!-- Replace these images with your own but make sure they are 3000px wide and 783px high or the same ration -->
</div><!--/slide-->
<div class="slide">
<img src="images/slideshow/sliderimage2.jpg" width="3000" height="783" alt="French Montana"/><!-- Replace these images with your own but make sure they are 3000px wide and 783px high or the same ration -->
</div><!--/slide-->
<div class="slide">
<img src="images/slideshow/sliderimage3.jpg" width="3000" height="783" alt="2 Pistols"/><!-- Replace these images with your own but make sure they are 3000px wide and 783px high or the same ration -->
</div><!--/slide-->
<div class="slide">
<img src="images/slideshow/sliderimage4.jpg" width="3000" height="783" alt="Juicy-J"/><!-- Replace these images with your own but make sure they are 3000px wide and 783px high or the same ration -->
</div><!--/slide-->
<div class="slide">
<img src="images/slideshow/sliderimage5.jpg" width="3000" height="783" alt="Kendrick Lamar"/><!-- Replace these images with your own but make sure they are 3000px wide and 783px high or the same ration -->
</div><!--/slide-->
<div class="slide">
<img src="images/slideshow/sliderimage6.jpg" width="3000" height="783" alt="Artist Name"/><!-- Replace these images with your own but make sure they are 3000px wide and 783px high or the same ration -->
</div><!--/slide-->
</div><!--/slider-->
<!--<div class="clearfix"></div>-->
</div><!--/html_carousel-->
</section> <!-- Slideshow End -->
<div id="logo">
<h1 id="logotitle">MPIRE Booking</h1> <!-- Logo text -->
</div><!--/logo-->
<nav> <!-- Navigation Start -->
<ul>
<li>Home</li>
<li>Services</li>
<li>Booking</li>
<li>Contact</li>
</ul>
</nav> <!-- Navigation End -->
</div><!--/top-->
Here's my CSS... (for the divs you see above)
(Click here for the full style sheet)
#top{
height:20px;
}
#logo {
margin-top:1%;
text-decoration:none;
}
#logo a:hover { color: #8f1929; text-decoration: none; }
#logoimage{
width:200px;
height: 141px;
padding-right:10px;
float:left;
}
#logotitle{
margin-top: 50px;
float:right;
font-family: Broadway, Arial, Helvetica, sans-serif;
font-weight:normal;
font-size:200%;
text-shadow: 0 1px 1px #FFF;
text-decoration: none;
}
nav {
float:right;
width:100%;
display:block;
height:40px;
}
nav ul li{
display:block;
width:25%;
float:left;
text-align:center;
}
nav ul li a{
font-family:Lato, Helvetica, Arial, sans-serif;
width:90%;
text-decoration:none;
text-transform:uppercase;
font-weight:400;
line-height:250%;
display:block;
color:#FFFFFF;
}
nav ul li a:hover{
color:#8f1929;
}
nav ul li p{
font-family:Lato, Helvetica, Arial, sans-serif;
width:90%;
text-decoration:none;
text-transform:uppercase;
font-weight:400;
line-height:250%;
display:block;
color:#8f1929;
}
.html_carousel {
}
.html_carousel div.slide {
position: relative;
}
.html_carousel div.slide img {
width: 30%;
height: auto;
border-radius:15px;
}
.clearfix {
float: none;
clear: both;
}
#slideshow{
width:100%;
margin-top:0%;
}
.clearfix {
float: none;
clear: both;
}

There are several weird things on your code, like huge width properties such as 3000px for slides and even 14326px (!) on your <div id="slider"> that leave no room for the logotitle. Please, check them all.
And the floating properties: that float:right div for the logotitle makes no sense. If it had room enough it would be ok with another float:left as it comes the last one.
Here you have an example with left-floated elements creating a horizontal inline layout: www.w3schools.com/css/tryit.asp?filename=trycss_float5

Try adding this class
.slide
{
display:inline-block;
}

Related

Adding an Image for Button on a Navigation Bar in CSS/HTML

I need to use an image for my navigation buttons inside of my navigation bar. Right now, I have it set as a color, and when hovered over, it changes color.
However, instead of a color, I need an image. I have sized the button image to the exact height and width as I have set it inside of my css.
For each of the ul's: About Me, Photo Edits, Video Edits, Writing, I must have a button. I have the image and it is correct on its width and height.
Here is my HTML code:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CHANGE ME!</title>
<link href="css/styles_finished.css" rel="stylesheet" type="text/css" media="all">
<link href="css/mainnav.css" rel="stylesheet" type="text/css" media="all">
</head>
<body>
<!--Start Container for Whole Site-->
<div id="container">
<!--Start Header Content-->
<div id="header">
<div id="logo">
<a href="index.html"><img src="images/logo.png" width="350" height="80" alt="My
Logo" border="0" /></a></div>
</div><!--End Header Content-->
<!--Start Navigation ontainer-->
<div id="wrapper">
<div id="navMenu">
<ul>
<li>About Me
</li>
</ul>
<ul>
<li>Photo Edits
</li>
</ul>
<ul>
<li>Video Edits
</li>
</ul>
<ul>
<li>Writing
<ul>
<li>Samples</li>
<li>Recognition</li>
</ul> <!--end inner UL-->
</ul><!--End main ul-->
<br class="clearFloat" />
</div> <!--End Navigation Container-->
</div> <!--End wrapper div-->
<!--Start Media Area-->
<div id="media">
<h1>Images/Rich Media</h1>
<p>(470 x 550)</div>
<div id="text">
<h1>Main Body Text</h1>
<p>(470 x 400)</p>
</div><!--End Text Area Here-->
<!--Start Footer Here-->
<div id="footer">
<h1>Footer (50 x 1024)</h1>
<p>
Voo2Do Public Task List
Sitemap Public Image
Wireframe Public Image
</p>
</div> <!--End Footer Here-->
</div><!--End Container for whole site-->
<div id="w3"><!--Start HTML 5 Validation Button Here-->
<p>
<img src="images/valid_html5.gif" alt="Valid HTML 5" height="31" width="88" style="border:0px;" /></p></div><!--End HTML 5 Validation Button Here-->
</body>
</html>
And here is my CSS Code for the Navigation Bar:
#navMenu {
margin:0;
padding:0;
}
#navMenu ul {
margin: 0;
padding:0;
line-height: 30px;
}
#navMenu li {
margin: 0;
padding:0;
list-style:none;
float: left;
position: relative;
background-color: #C0C0C0;
}
#navMenu ul li a {
text-align: center;
text-decoration: none;
height: 35px;
width: 254px;
display:block;
color: #FFF;
border: 1px solid #FFF;
text-shadow: 1px 1px 1px #000;
}
#navMenu ul ul {
position:absolute;
visibility: hidden;
top:32px;
}
#navMenu ul li:hover ul {
visibility:visible;
}
#navMenu li:hover {
background: #09f;
}
#navMenu ul li:hover ul li a:hover {
background: #CCC;
color: #000;
}
#navmenu a:hover {
color:#000;
}
.clearFloat {
clear:both;
margin:0;
padding:0;
}
I have tried to put url(images/navbutton.jpg) inside #navMenu and that didnt work. No matter what selection I put the image under, nothing happens. And then on top of all that, I also have to have a rollover image for my buttons that is different from my background image. So i'm having two images. One image will be the button, and the second image will appear when hovered over. I'm going cross-eyed, ugh. Can someone please help me?
note I am not using JS or JQ.
Just add the images in HTML instead of CSS, and then style them.
Assuming you don't want the labels "About Me, Photo Edits, Video Edits, Writing"...Just add add this inside your <a> tags:
<img src="/images/about-me.jpg" alt="About Me">
Then in your CSS just target the image:
#navMenu ul li a img { width: 254px; height: 35px; }
You then just need to add any styles for positioning.
For the hover effect, just add another image right next to the first one, add a class to it and then in CSS apply display: none; to that image. On hover of the <a> tag, just display: none; the first image and display: block; the second image.
You will also need to add relative positioning to the containing <a> tag and absolute positioning to the images so that they can sit on top of each other for when you hover on and off of them.
If you would like more specific info please create a codepen or jsfiddle with your current state of things.

Disappearing content when using sub-menu (menu and sub-menu fighting over targets)

What I'm essentially trying to create is a website with multiple image galleries. There is a menu on the left that lets you select from the different galleries. After clicking a menu item, a gallery appears beside it on the right. Each gallery has a large image displayed with smaller thumbnails below it. Clicking a thumbnail changes the large image above it.
The problem I'm encountering is that both menus (the gallery selector on the left & the thumbnails/large image) are using the same method of hiding and displaying content. I achieve this through targets (with a display:block and display:none in the css classes).
As you can probably guess, because they are both hogging up that target, things aren't working as intended. When you click a thumbnail, it causes the larger menu target to change, and thus it disappears. Here is the code to illustrate the issue.
JSFiddle (with the gallery inside the menu)
Another JSFiddle (separated to show them working independent of each other)
What's the best way to go about creating a menu within a menu like this? Is there a way I can have 2 different ids targeted at the same time? (thus making sure the display:none doesn't go into effect for the menu while selecting thumbnails)
I'm trying to create this system with just HTML and CSS, so I'd prefer to make this work without javascript if possible. I've been racking my brain for hours though, so at this point I just want it to work. If that means adding JS to my site, I'm certainly open to any solutions. Thank you very much for your responses!
HTML:
<div class="nav">
<h3>Menu Item 1</h3>
<h3>Menu Item 2</h3>
</div>
<div class="tab-content" id="Menu1">
<div class="main">
<center><h3>This is Menu 1</h3></center>
<div class="image-gallery">
<div class="big-image">
<img id="Red" src="http://www.venus.com/productimages/dept_swatches/crimson_sm.jpg" width="100" height="50" />
<img id="Yellow" src="http://www.msubillings.edu/urelations/img/blockgold.gif" width="100" height="50" />
</div>
</div>
<div class="image-gallery">
<ul>
<li><img src="http://i.imgur.com/8KZSfT5.gif" width="64" height="64" /></li>
<li><img src="http://i.imgur.com/pV56FNe.png" width="64" height="64" /></li>
</ul>
</div>
</div>
</div>
<div class="tab-content" id="Menu2">
<div class="main">
<center><h3>Menu 2! Menu 2!</h3></center>
</div>
</div>
CSS:
.main {
background: #222224;
color: #FFF;
position: relative;
height:300px;
width:80%;
padding:0px;
float:right;
overflow:auto;
}
.nav {
position: relative;
height:300px;
width:20%;
float:left;
padding:0px;
background: #a2bbc6;
}
.tab-content{
display: none;
}
.tab-content:target {
display: block;
}
.image-gallery{
width: 400px;
padding:25px;
border:solid 0px #c5c5c5;
}
.image-gallery .big-image{
width:100px;
height:50px;
}
.image-gallery .big-image img{
display:none;
margin:0 auto;
}
.image-gallery .big-image img:target {
display:block;
}
.image-gallery ul{
margin-top:14px;
list-style-type: none;
}
.image-gallery li{
margin-bottom: 6px;
opacity: 0.4;
}
.image-gallery li:hover{
opacity: 1;
}
After some more digging and experimentation, I managed to come up with a solution to this. It's using Javascript (so I'm still open to a pure CSS solution if you have one).
I'm still working out the formatting, but the functionality now does exactly what I wanted it to do. If anyone else has a similar problem, check this out:
JSFiddle (Working Menus)
Also came up with a slightly more complex version with sub-menus inside the outer menus (since that's my end goal with the site). It'll require some clever nesting to keep all of that information straight, but it's technically capable with this method:
JSFiddle (With sub-menus)
Code for the regular menus below.
HTML:
<div class="nav"><p id="toggle">
<span style="color:blue">Menu 1</span>
<span style="color:green"> Menu 2 </span>
<span> Menu 3 (blank) </span>
</p></div>
<div id="left">
<div class="main">
<center><h3>This is Menu 1</h3></center>
<div class="image-gallery">
<div class="big-image">
<img id="Red" src="http://www.venus.com/productimages/dept_swatches/crimson_sm.jpg" width="100" height="50" />
<img id="Yellow" src="http://www.msubillings.edu/urelations/img/blockgold.gif" width="100" height="50" />
</div>
</div>
<div class="image-gallery">
<ul>
<li><img src="http://i.imgur.com/8KZSfT5.gif" width="64" height="64" /></li>
<li><img src="http://i.imgur.com/pV56FNe.png" width="64" height="64" /></li>
</ul>
</div>
</div>
</div>
<div id="right">
<div class="main">
<center><h3>Menu 2! Menu 2!</h3></center>
</div>
</div>
<div id="far"> There's nothing here yet </div>
CSS:
#right { display:none; }
#far { display:none; }
.main {
background: #222224;
color: #FFF;
position: relative;
height:300px;
width:80%;
padding:0px;
float:right;
overflow:auto;
}
.nav {
position: relative;
height:300px;
width:20%;
float:left;
padding:0px;
background: #a2bbc6;
}
.tab-content{
display: none;
}
.tab-content:target {
display: block;
}
.image-gallery{
width: 400px;
padding:25px;
border:solid 0px #c5c5c5;
}
.image-gallery .big-image{
width:100px;
height:50px;
}
.image-gallery .big-image img{
display:none;
margin:0 auto;
}
.image-gallery .big-image img:target {
display:block;
}
.image-gallery ul{
margin-top:14px;
list-style-type: none;
}
.image-gallery li{
margin-bottom: 6px;
opacity: 0.4;
}
.image-gallery li:hover{
opacity: 1;
}
Javascript:
$('#toggle > span').click(function() {
var ix = $(this).index();
$('#left').toggle( ix === 0 );
$('#right').toggle( ix === 1 );
$('#far').toggle( ix === 2 );
});
Hope this helps someone else out!

CSS coding issue with my logo and inline block nav not lining up

I am new to CSS but loving it so far. But, I've hit a road block with my code. I'm almost there but need some proper guidance.
I have provided my website where I'm attempting to place my logo to the left side of my nav. I want the site content CENTERED with a width of 960px and 0px from the top (against the top of the browser). I am using the CSS display: inline with li selectors to try to achieve my goal.
I'm trying to also get the inline nav to be right up against the logo. I'm also trying to mimic the logo's top 4px border with the CSS a:hover selector on the nav. I want this to be at the margin-top: 0px in the browser.
Here's the link to my almost correct logo/nav layout:
http://multimediaxchange.com/vls/index.php?page=home
Here's my CSS CODE:
.topbar {
width:960px;
height:87px;
text-align:center;
}
.topbar-inner {
width:960px;
margin:0 auto 0 auto;
text-align:center;
}
.logo {
margin-top:0px;
display:inline;
}
img {
float:left;
border: 0;
padding: 0;
margin: 0;
}
.menu {
display:inline;
margin-top:0px;
}
.menu > ul > li {
display:inline-block;
position:relative;
border-top:4px solid #FFF;
margin-right:0px;
padding-top:40px;
min-width:80px;
}
.menu > li {
display:inline-block;
list-style:none;
margin-top:50px;
}
.menu li a {
color: #000;
display: block;
text-decoration:none;
}
.menu li:hover {
border-top-color: #039;
}
.menu li:hover a {
color:#039;
}
body {
font-family:Arial, Helvetica, sans-serif;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.content {
height:500px;
padding:0px 20px 20px 20px;
text-align:left;
font-size:12px;
}
.footer {
border-top:1px solid #DFDFDF;
width:960px;
margin: 0 auto;
font-size:11px;
text-align:center;
}
Here's the HTML Code:
<?php
// Load Setup document:
include('_config/setup.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php echo $page_title; ?></title>
<link rel="stylesheet" type="text/css" href="_css/styles.css">
</head>
<body>
<div class="topbar">
<div class="topbar-inner">
<div class="logo"><img src="/vls/_images/mylogo.png" height="87" width="287"/></div>
<!-- logo -->
<div class="menu"><?php include('_template/nav_main.php'); ?></div>
<!-- menu -->
</div>
<!-- topbar-inner -->
</div>
<!-- topbar -->
<div class="bdy_hdr"><?php get_page_name($dbc, $pg); ?></div>
<div class="content"><?php get_page_body($dbc, $pg); ?></div>
<div class="footer"><?php include('_template/footer.php'); ?></div>
</body>
</html>
Thanks!
everything is right but you need to add this property margin:0 auto; not to the topbar-inner class but to the topbar class, and this like like this. so change present
.topbar {
width:960px;
height:87px;
text-align:center;
}
to
.topbar {
width:960px;
height:87px;
text-align:center;
margin:0 auto;
}
The secrets are in the .topbar class. Remove the text-align:center, and instead add a margin:0 auto. Should look like this:
.topbar {
width:960px;
height:87px;
margin:0 auto;
}
The text-align:center prevents the <ul> from being centered in the remaining space after the image floats, so the top border looks seamless.
The margin:0 auto centers the whole kaboodle.
Add this line:
.menu ul {
margin:0;
}
and it will be on the top of the browser. My comments about a lot of extra junk still apply though :)
EDIT
Here's your page, with the "minimalist" markup and styling I'm talking about. There's one or two minor tricks a beginner may not know, but you should easily understand pretty much everything.
Just slice out all the crap extra divs, basically, and you can chase down problems quicker, target elements easier, have a lighter page (in bytes, that is) and generally add a bit of elegance to your solutions.
This rebuild does everything the original did, in half the space.
HTML:
<body>
<div class="topbar">
<img src="logo.png" height="87" width="287"/>
<ul class='menu'>
<!-- Not great practice to stagger </li> like this,
but a good way to avoid rogue padding. -->
<li>Home
</li><li>Staffing
</li><li>Jobs
</li><li>Training
</li><li>GSA
</li><li>Why Us
</li><li>Clients
</li><li>Contact</li>
</ul>
</div>
...the rest of your page...
</body>
CSS:
body {
font-family:Arial, Helvetica, sans-serif;
margin:0;
}
.topbar {
width:960px;
height:87px;
margin:0 auto;
}
.topbar img {
float:left;
border: 0;
}
ul.menu {
margin:0 0 0 287px;
padding:0;
}
ul.menu li {
display:inline-block;
position:relative;
border-top:4px solid #FFF;
list-style:none;
padding-top:40px;
min-width:80px;
}
ul.menu li a {
color: #000;
display: block;
text-decoration:none;
}
ul.menu li:hover {
border-top-color: #039;
}
ul.menu li:hover a {
color:#039;
}
It is a good practice to put your divs inside a container, something like this:
<div id="container">
<div class="topbar">
<div class="topbar-inner">
<div class="logo">
<img src="/vls/_images/mylogo.png" height="87" width="287"/>
</div>
<div class="menu">
<?php include('_template/nav_main.php'); ?>
</div>
</div>
</div>
<div class="bdy_hdr">
<?php get_page_name($dbc, $pg); ?>
</div>
<div class="content">
<?php get_page_body($dbc, $pg); ?>
</div>
<div class="footer">
<?php include('_template/footer.php'); ?>
</div>
</div>
Then do just this in your CSS:
.topbar{
margin:0 auto;
}
I suggest you to give a width to .bdy_hdr, .content and .footer and then do the same with them, i.e:
.bdy_hdr,
.content,
.footer{
width:960px;
margin:0 auto;
}

Coding <ul> <li> menu to fit within main <div>

EDIT: I have found this code, which appears to be sorta working the way I want it to. You can check it out live at EDIT - I still can't get it to sit within my #main div though! I've tried using both 100% and 990px within #menu span for width - neither seem to work.
<div id="menu">
<ul>
<li>Menu item 1</li>
<li>Menu item 3</li>
<li>Menu item 2</li>
</ul>
<span></span>
</div>
#menu {
text-align: justify;
}
#menu * {
display: inline;
}
#menu span {
display: inline-block;
position: relative;
width: 100%;
height: 0;
}
END EDIT
I have a menu I'm having some issues with - mainly horizontal issues :)
Basically, when you view the website in Chrome, the menu is centered the way I want it to be.
When you view the website in FireFox, the menu is 5-10px short on the right side.
And when you view it in Internet Explorer, the menu is not sitting left and is overflowing off of the right side of the page.
View it for yourself at: EDIT (Keep in mind, index2.php here, not the original index)
So my question is:
How can I style/code this menu correctly to fit within my parent div?
I did look through previous topics with similar questions, however, was unable to make anything work. Thank you in advance :)
HTML:
<!DOCTYPE html>
<html>
<head>
<title>EDIT </title>
<link rel="stylesheet" href="style.css" type="text/css">
<style>
#sliderwrapper {width:635px;}
#control {
text-align:right;
margin-top:5px;
}
#control a {
background:#87e7fa;
padding:0 5px;
color:#FFFFFF;
text-transform:uppercase;
text-decoration:none;
margin-left:5px;
}
#control a.active {background:#265db9;}
#control a span {visibility:hidden;}
.sexyslider-control span {display:none;}
.sexyslider-title {
font-weight:bold;
color: #FFFFFF;
}
</style>
</head>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.sexyslider.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#slider").SexySlider({
width : 981,
height : 500,
delay : 3000,
strips : 18,
autopause : false,
<!--navigation : '#navigation',--!>
control : '#control',
direction : 'left',
effect : 'fade'
});
});
</script>
<body>
<div id="wrapper">
<div id="header"><img src="images/header.gif" alt="" /></div>
<div id="main">
<ul>
<h2><li>Home</li>
<li>Meet Our Team
<li>Office Information</li>
<li>First Visit</li>
<li>Dental Topics</li>
<li>Office Tour</li>
<li>Contact Us</li></h2>
</ul>
<div id="sliderwrapper" class="clearfloat">
<div id="slider" style="width:100%">
<img src="images/slide1.jpg" alt="" "/>
<img src="images/slide4.jpg" alt="" "/>
<img src="images/slide2.jpg" alt="" " />
<img src="images/slide3.jpg" alt="" "/>
<img src="images/slide4.jpg" alt="" "/>
<img src="images/slide5.jpg" alt="" "/>
<img src="images/slide6.jpg" alt="" "/>
</div>
<div id="control" style="margin-top:10px; margin-right:-347px;"></div>
</div>
</div>
<div id="footer"><img src="images/footer.gif" alt=""/></div>
</body>
</html>
CSS:
body {
margin:0;
padding:0;
background-color: #87e7fa;
font-size:100%;
text-align:center;
}
#wrapper {
margin:0 auto;
padding:0;
text-align:center;
background:url('images/bg.gif') repeat-y;
width:1200px;
}
#header {
width:1200px;
height:358px;
}
#main {
width:990px;
height:100%;
margin:0 auto;
text-align:left;
}
#footer {
clear:both;
width:1200px;
height:354px;
}
h2 {
font-family:soos_font;
text-decoration:none;
text-shadow:1px 1px 0 rgba(0,0,0, 0.4);
}
ul
{
list-style-type:none;
margin:10 0;
padding:0;
}
li
{
display:inline;
width:100%;
margin:0 auto;
}
a:link,a:visited
{
font-weight:bold;
color:#FFFFFF;
background-color:#87e7fa;
text-align:center;
padding:7px;
text-decoration:none;
text-transform:uppercase;
border-radius:5px;
margin:0 auto;
}
a:hover,a:active
{
background-color:#3650a2;
}
I have update you css
css
#main {
width:990px;
height:100%;
margin:0 auto;
text-align:center;
}
#main ul{
list-style-type:none;
margin:0;
padding:0;
}
#main li{
display:inline-block;
/*width:100%;*/
margin:0 3px;
}
html
<div id="main">
<ul>
<li>Home</li>
<li>Meet Our Team
<li>Office Information</li>
<li>First Visit</li>
<li>Dental Topics</li>
<li>Office Tour</li>
<li>Contact Us</li>
</ul>
<br style="clear:both;"/>
</div>
here is the jsFiddle File
Also don't wrap li in to h2, this is not a valid code.

centering a list within a 100% div

Im working on responsive code just now and for some reason i cant get 2 lists to display in the center of the div that's 100% width for mobile view. Is there something that im missing out in the css code below that might be causing this to not to display centered?
both lists have classes of .social-media and .top-nav
*** HTML ******
<div id="gezzamondo">
<div class="header">
<img class="logo" src="images/gezzamondo-logo.jpg" alt="Web designer Glasgow | Gezzamondo" title="Web designer Glasgow | Gezzamondo" />
<ul class="top-nav">
<li>About</li>
<li>Work</li>
<li>Contact</li>
</ul>
<ul class="social-media">
<li><img src="images/twitter-social.jpg" alt="Gezzamondo on Twitter" title-"Gezzamondo on Twitter"/></li>
<li><img src="images/behance-social.jpg" alt="Gezzamondo on Behance" title="Gezzamondo on Behance"/></li>
<li class="last"><img src="images/dribbble-social.jpg" alt="Gezzamondo on Dribbble" title="Gezzamondo on Dribbble"/></li>
</ul>
</div><!-- close header -->
</div><!-- close gezzamondo -->
** CSS ****
body {
background-color:#C09;
font-family: 'Ubuntu', sans-serif;
margin:0;
padding:0;
}
img{
max-width:100%:
}
#gezzamondo{
width:100%;
margin:0 auto;
}
.header{
background-color:#FFF;
height:215px;
width:100%;
text-align:center;
}
#gezzamondo .logo{
width:183px;
height:83px;
margin:0 auto;
margin-top:20px;
}
#gezzamondo .top-nav{
list-style: none;
font-size:20px;
font-weight:300;
margin:0 auto;
}
#gezzamondo ul.top-nav li{
float:left;
margin-right:30px;
}
#gezzamondo ul.top-nav li a{
text-decoration:none;
color:#333333;
}
#gezzamondo .social-media{
position: absolute;
list-style: none;
width:162px;
margin:0 auto;
background-color:#06F;
}
#gezzamondo .social-media li img{
height:44px;
width:44px;
}
#gezzamondo .social-media li{
float:left;
margin-right:15px;
}
#gezzamondo .social-media li.last{
float:left;
margin-right:0px;
}
#gezzamondo ul.top-nav li a:hover{
border-bottom:7px #FF0099 solid;
color:#333333;
}
you are setting the position to absolute in #gezzamondo .social-media, just remove the position and it should center.
I've used the code you supplied, it looks a mess to in jsfiddle (example code is not complete etc). I think this should do it for you, or at least get you closer. What I did was basically wrap the social ul in two divs. center-social spans the full width and center-s trys to provide an idea of a width so the uls can be centered. Try it out on your actual page and it should display correctly. It's only applied on the social ul in the example.
<div id="center-social">
<div id="center-s">
<ul class="social-media">
<li><img src="images/twitter-social.jpg" alt="Gezzamondo on Twitter" title-"Gezzamondo on Twitter"/></li>
<li><img src="images/behance-social.jpg" alt="Gezzamondo on Behance" title="Gezzamondo on Behance"/></li>
<li class="last"><img src="images/dribbble-social.jpg" alt="Gezzamondo on Dribbble" title="Gezzamondo on Dribbble"/></li>
</ul>
</div>
</div>