CSS drop down menu error - css

I have made a dropdown CSS menu and honestly can't figure out why it's getting indented...
Here is the screenshot:
If you see it is all aligned to the right no matter how I set the width.. :(
Here is the CSS:
(included all CSS but menu is: #mainMenu)
#charset "UTF-8";
/* CSS Document */
/* Background styling of all forms (should set is here) */
form#payment {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
background-color:#f7fca3;
padding: 10px;
}
form {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
background-color:#d6f5df;
padding: 10px;
}
/*styling for text inputs and password of homepage */
input[type="text"]#profile, textarea#profile, input[type="password"]#profile {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
margin-bottom: 5px;
display: block;
padding: 4px;
border: solid 1px #35b459;
width:365px;
}
input[type="text"], textarea, input[type="password"]#inputArea {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
margin-bottom: 5px;
display: block;
padding: 4px;
border: solid 1px #35b459;
width:300px;
}
p {
font-family:Arial, Helvetica, sans-serif;
color:#231f20;
}
h1 {
font-family:Arial, Helvetica, sans-serif;
color:#231f20;
}
h2 {
font-family:Arial, Helvetica, sans-serif;
color:#231f20;
}
h3 {
font-family:Arial, Helvetica, sans-serif;
color:#231f20;
}
/* Split homepage in two */
#span1 {
width: 330px; float: right;
}
#span2 {
width: 390px; float: left;
}
/* Homepage note */
#note {
border-style:dashed;border-color:red;
}
/* Registration button link style */
.regbutton a:hover {
color:#ff;
text-decoration:none;
}
.regbutton a {
color:#ff;
text-decoration:none;
}
.regbutton a:visited{
color:#ff;
text-decoration:none;
}
div#steps {
background-color:#f7fca3;
}
.regbutton
{
position:absolute;
color:#ff;
background:#E76600;
font-family:Arial, Helvetica, sans-serif;
padding:6px;
text-align:center;
left:550px;
bottom:30px;
}
.header{
position:relative;
width:650px;
align:center;
height:200px;
}
.logo{
position:absolute;
align:left;
left:30px;
top:50px
}
.menu{
position:relative;
align:center;
top:150px;
}
.content{
width:800px;
position:relative;
align:center;
}
#holder{
width:100%;
}
.homecontent{
position:relative;
width:700px;
top:20px;
height:500px;
}
a>div { display: none; }
a:hover>div { display: block; }
a span {display: none;}
a:hover span#hovImg {
position: relative;
right: 0px;
bottom: 0px;
display: block;
}
#mainMenu,
#mainMenu ul {
list-style: none;
}
#mainMenu {
float: left;
}
#mainMenu > li {
float: left;
}
#mainMenu li a {
display: block;
height: 2em;
line-height: 2em;
padding: 0 1.5em;
text-decoration: none;
}
#mainMenu ul {
position: absolute;
display: none;
z-index: 999;
}
#mainMenu ul li a {
width: 80px;
}
#mainMenu li:hover ul {
display: block;
}
/* Main menu
--*/
#mainMenu {
font-family: Arial;
font-size: 12px;
background: #2f8be8;
}
#mainMenu > li > a {
color: #fff;
font-weight: bold;
}
#mainMenu > li:hover > a {
background: #f09d28;
color: #000;
}
/* Submenu
--*/
#mainMenu ul {
background: #f09d28;
}
#mainMenu ul li a {
color: #000;
}
#mainMenu ul li:hover a {
background: #ffc97c;
}

ul elements have left padding by default in almost all browsers. Creating a JS Fiddle (http://www.jsfiddle.net) would be very helpful here. But try setting your
#mainMenu ul{
padding: 0;
margin: 0;
}

It is probably because of this, you are using CSS short-hand :
padding: 0 1.5em; /* Top-Bottom(0), Left-Right(1.5em) */
In
#mainMenu li a {
display: block;
height: 2em;
line-height: 2em;
padding: 0 1.5em; <------ Here
text-decoration: none;
}

First of all, what browser are you viewing it in? I also suggest using firebug or some sort of
add-on that helps you view the box method, as you can see if that is what's causing the problem in terms of margin, padding. and border issues. I'd like to see your html file and I can help your problem more efficiently. I also think it is a padding issue, though...
Try:
#mainMenu li a {
display: block;
height: 2em;
line-height: 2em;
padding-right:.2em; /* <-- */
text-decoration: none;
}

Related

Issues with CSS(Small but can't figure it out)

My code is the following:
wrapper, wrapper2, content, footer, nav {
display: block;
}
html {
width: 100%;
height:100%;
margin:0;
padding:0;
background-image:url('../images/gdmm.jpg');
font-family: 'TitilliumWeb-ExtraLight';
font-weight:900;
}
body{
margin:0;
}
#font-face {
font-family: 'TitilliumWeb-SemiBold';
src: url('../TTfont/TitilliumWeb-SemiBold.eot');
src: local("Grandesign Regular"), url("../TTfont/TitilliumWeb-SemiBold.ttf") format("truetype"); /* non-IE */
font-family: 'TitilliumWeb-ExtraLight';
src: url('../TTfont/TitilliumWeb-ExtraLight.eot');
src: local("Grandesign Regular"), url("../TTfont/TitilliumWeb-ExtraLight.ttf") format("truetype"); /* non-IE */
}
h1 {
font-weight: bold;
font-size: 32px;
margin-left:auto;
border-bottom: 1px dashed rgb(221, 221, 221);
font-weight: 300;
line-height: 1.4;
padding: 2px 25px;
font-family: 'TitilliumWeb-SemiBold';
}
h1, h2, h3, h4, h5, h6 {
font-family: "Titillium Web","Source Sans Pro",Helvetica,Arial,serif;
}
#pagewrap{
width: 100%;
margin: 0 auto;
}
#content{
width:1024px;
height:768px;
border-width:5px;
margin-top:100px;
margin-left:auto;
margin-right:auto;
word-wrap:break-word;
background: rgba(252, 252, 255, 0.8);
overflow:hidden;
box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.5);
word-wrap:break-word;
}
#contentinner{
width:980px;
height: 600px;
background-color: rgb(252, 252, 255);
margin-top:30px;
margin-left:auto;
margin-right:auto;
box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.2);
word-wrap:break-word;
}
#text{
font-size: 1.2rem;
font-weight: 300;
line-height: 1.6;
padding: 5px 10px;
word-wrap:break-word;
}
#navwrapper{
width: 100%;
height:50px;
background-color:#005b96;
padding:0;
text-align: center;
float:none;
margin:0;
text-decoration: none;
}
#navonderwrap{
width: 100%;
height:30px;
background-color:#FFFFFF;
padding:0;
text-align: center;
float:none;
margin:auto;
}
nav{
display: inline-block;
overflow: hidden;
word-spacing: 1em;
text-align: center;
margin:auto;
}
#navonder{
display: inline-block;
overflow: hidden;
word-spacing: 1em;
text-align: center;
margin:auto;
}
nav ul{
margin-right:20px;
padding:0;
width:auto;
}
nav ul li{
display:table-cell;
margin-right:20px;
}
nav li
{
display:inline;
}
nav li a
{
font-family:Arial;
font-size:14px;
float:left;
padding:0px;
border-bottom:1px;
text-decoration: none;
}
nav li a:hover {
display: block;
float: left;
background-color:#FFF;
padding-bottom:10px;
}
My issue is that when you hover on the menu it pushes the entire thing down all I want is it to look as if it has the same color as the one below, I can't figure out why.
Thanks in advance!
this comes from the padding-bottom:10px you apply.
In addition to that you say display the link as a block and you make it float... so you can remove the display:block; it is useless in that case.
In it's default state the <a> has no padding, but in it's hover state it has padding-bottom: 10px;.
In order to make it look like it joins the white bar below, you'll need to add:
nav ul {
margin-bottom: 0; /* to reset the default */
}
nav li a {
font-family: Arial;
font-size: 14px;
float: left;
/* padding: 0px; REMOVE */
padding-bottom: 10px; /* ADD */
border-bottom: 1px;
text-decoration: none;
}
nav li a:hover {
/*display: block; REMOVE (unnecessary) */
/* float: left; REMOVE (because it's already set on default state) */
background-color: #FFF;
/* padding-bottom: 10px; REMOVE (because it's already set on default state */
}
nav li a {
padding: 10px; //Add
}
nav li a:hover {
background-color: #FFFFFF;
display: block;
float: left;
padding-bottom: 10px; /// Remove this
}
Remove padding bottom

CSS: Can't make space for sidebar

I'm trying to have my ads show up on the the right side of a page. I have set the width of the content & navigation to 75%.
div.comments, div.navigation {
margin-left:1.5em;
margin-right:1.5em;
width: 75%;
}
#content {
margin: 1em 0px;
width: 75%;
float: left;
padding-top: 1.1em;
}
the side bar is set to 200px. Which is much less than 25% on most screen.
But the content still is taking up some extra space display here in the orange.
I cannot figure where this is coming from. I've spent the last hour using google developer tool to resolve it. Below is style.css. The page can be found at gazzetesm.com. The Our Partner's Page style is what I am trying to achieve.
style.css
/*
Theme Name: Gonzo Daily
Theme URI: http://greatgonzo.net/projects/gonzodaily
Description: Gonzo Daily is flexible-width three-column theme for WordPress. It has a newspaper-like front page, featuring three columns of text for browsers that support CSS columns (currently only Firefox, more to come)<br /><br />Wordpress Widgets ready.<br /><br />The font used in the header is Gputeks by gluk, licensed under SIL Open Font License.
Version: 1.4
Author: Milen Petrinski - Gonzo
Author URI: http://greatgonzo.net/
Tags: black, two-columns, three-columns, right-sidebar, flexible-width
*/
/**
* Eric Meyer's Reset stylesheet - http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/
*/
html,body,div,span,applet,object,iframe,
h1,h2,h3,h4,h5,h6,p,blockquote,pre,
a,abbr,acronym,address,big,cite,code,
del,dfn,em,font,img,ins,kbd,q,s,samp,
small,strike,strong,sub,sup,tt,var,
dl,dt,dd,ol,ul,li,
fieldset,form,label,legend,
table,caption,tbody,tfoot,thead,tr,th,td {
margin:0;
padding:0;
border:0;
font-size:100%;
font-family:inherit;
vertical-align:baseline;
}
/*
* Created by gluk with FontForge 1.0 (http://fontforge.sf.net)
* This Font Software is licensed under the SIL Open Font License, V.1.1.
* This license is available with a FAQ at: http://scripts.sil.org/OFL.
* Copyright (c) 2008, gluk,(gluksza#wp.pl) with Reserved Font Name Gputeks.
*/
#font-face {
font-family: "Gputeks";
src:url(fonts/Gputeks-Regular.ttf);
font-style: normal;
font-weight: normal;
}
/*
* Created by gluk with FontForge 1.0 (http://fontforge.sf.net)
* This Font Software is licensed under the SIL Open Font License, V.1.1.
* This license is available with a FAQ at: http://scripts.sil.org/OFL.
* Copyright (c) 2008, gluk,(gluksza#wp.pl) with Reserved Font Name Gputeks.
*/
#font-face {
font-family: "Gputeks";
src:url(fonts/Gputeks-Bold.ttf);
font-style: normal;
font-weight: bold;
}
/**
* GLOBALS
*/
html {
background: #fff;
text-align:center;
}
body {
background: #fff;
text-align:justify;
margin:0 auto 0 auto;
padding:0;
max-width:95%;
line-height:1;
color:black;
font-family:Georgia,"Lucida bright","Times new roman",Georgia,"lucida bright",serif;
font-size:11pt;
}
h1, h2 {
font-size:1.8em;
text-align:left;
font-family: "Palatino Linotype", Palatino, Palladio, "URW Palladio L", "Book Antiqua", Baskerville, "Bookman Old Style", "Bitstream Charter", "Nimbus Roman No9 L", Garamond, "Apple Garamond", "ITC Garamond Narrow", "New Century Schoolbook", "Century Schoolbook", "Century Schoolbook L", Georgia, serif;
font-weight:normal;
font-style:normal;
}
h3 {
text-align:left;
font-size:1.2em;
font-weight:bold;
line-height:1.1em;
font-style:italic;
margin-bottom: 1.4em;
}
h4 {
font-size: 1em;
line-height:1.5em;
font-weight:normal;
font-style:normal;
}
hr {
display:none;
}
a {
text-decoration:none;
color:#633B18;
font-weight:inherit;
font-style:inherit;
}
a:visited {
color:#633B18;
}
a:hover {
text-decoration:underline;
color:#AE3000;
/*text-shadow: #666 2px 2px 5px;*/
}
a:focus {
color:#AE3000;
/*outline-width:.1em;*/
}
p {
line-height:1.5em;
margin-bottom:1.5em;
}
li {
line-height:1.5em;
}
ul, ol {
margin-bottom:10px;
list-style:none;
}
table {
border-collapse:collapse;
border-spacing:0;
}
caption, th, td {
text-align:left;
font-weight:normal;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content:"";
}
blockquote, q {
quotes:"" "";
}
blockquote {
margin:0;
padding:1.15em .5em 1.25em 1.5em;
color:#999;
font-family:Georgia,"Lucida bright","Times new roman",serif;
font-size:1.2em;
font-style:italic;
line-height: 1.25em;
}
blockquote * {
line-height: 1.25em;
margin-bottom:0;
}
abbr {
border-bottom: 1px dotted #633B18;
}
img {
border:none;
}
strong {
font-weight:bold;
font-style: inherit;
}
em {
font-style:italic;
font-weight:inherit;
}
.alignleft {
float:left;
margin: 0 1em 1em 0;
}
img.alignleft {
float:left;
margin-right:1em;
}
img.alignright {
float:right;
margin-left:1em;
}
img.alignright {
float:right;
margin-left:1em;
}
.aligncenter {
display: block;
margin-left: auto;
margin-right: auto;
}
a img.alignright {float:right; margin:0 0 1em 1em}
a img.alignleft {float:left; margin:0 1em 1em 0}
a img.aligncenter {display: block; margin-left: auto; margin-right: auto}
code {
font-family:courier,"courier new", monospace;
}
pre {
display:block;
font-family:courier,"courier new", monospace;
font-size:1em;
line-height:1.5em;
background-color:#eeeeee;
padding:1.5em 1.5em;
margin-top:0em;
margin-bottom:1.5em;
overflow:auto;
}
/**
* HEADER
*/
#header {
padding: 0 1.5em;
text-align:left;
border-bottom:2px solid #AE3000;
}
#header h1, #header p.title {
color:#AE3000;
font-size:2.2em;
font-weight:bold;
font-family: Gputeks, "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", "Bitstream Vera Sans", "Liberation Sans", Verdana, "Verdana Ref", sans-serif;
text-align:left;
line-height:2;
/*letter-spacing: 0.1em;*/
margin:0;
}
#header h1 a, #header p.title a {
color:inherit;
text-decoration:none;
}
#header div.description {
color:#999;
text-transform:uppercase;
float:right;
margin-top: -2em;
}
/**
* MAIN NAVIGATION
*/
ul#navigation {
float:right;
margin:0;
margin-top:-2em;
}
ul#navigation li {
display: inline-block;
font-size: 2em;
font-weight:bold;
font-family: Gputeks, "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "Bitstream Vera Sans", "Liberation Sans", "DejaVu Sans", Verdana, "Verdana Ref", sans-serif;
margin:0;
margin-left:.5em;
line-height:1;
text-transform:lowercase;
word-spacing: -.2em;
}
ul#navigation li a {
}
ul#navigation li a:hover {
text-decoration:none;
}
/**
* First post on index page
*/
div.latest {
padding: 2em 1.5em 1.5em 1.5em;
margin-bottom:1em;
border-bottom:2px solid #AE3000;
}
div.latest h2 {
font-size: 5em;
color: #000;
line-height: 1em;
}
div.latest h2 a:link,
div.latest h2 a:visited,
div.latest h2 a:active {
color:inherit;
}
div.latest p.details_small {
margin:0;
}
div.latest div.post_content {
margin-top:1.5em;
-moz-column-count: 3;
-moz-column-gap: 1em;
-webkit-column-count: 3;
-webkit-column-gap: 1em;
column-count: 3;
column-gap: 1%;
}
div.post_content > p:first-child:first-line {
font-variant: small-caps;
font-weight:bold;
}
div.post_content > p:first-child:first-letter {
display:block;
float:left;
font-size:2.5em;
line-height: 1em;
padding:0;
margin:0;
padding-top: .2em;
margin-right: .2em;
}
div.latest img {
padding:2px;
background:#AE3000;
border:10px solid #ccc;
max-width:90%;
height: auto;
}
/**
* FIRST MAIN COLUMN
*/
#content {
margin: 1em 0px;
width:79%;
float:left;
padding-top:1.1em;
}
#content.home {
padding-top:0em;
background: none;
border:none;
}
#content.single, #content.archive {
padding-top:0em;
}
#content div.post {
margin: 0 0em 0em .5em;
padding: 0em 1em 1em 1em;
color:#000;
}
#content div.list {
margin: 0 0em 1.6em .5em;
padding: 0em 1em 0em 1em;
color:#000;
border:none;
background:none;
}
#content div.post div.more {
padding-top:.2em
}
#content h1 {
color: #000;
font-size:3em;
line-height: 1em;
margin: 0em 0em .5em .5em;
}
#content div.post h1 {
font-size:3em;
margin: 0em 0em .5em 0em;
}
#content div.list h2 {
font-size:1.4em;
line-height:1.1em;
padding-top:.1em;
margin-bottom:.3em;
}
#content div.post h2 {
margin-bottom: .5em;
}
#content div.post h3 {
margin-bottom: 0;
}
#content div.post h2,
#content div.post h3,
#content div.post h4
{
color: #000;
}
#content div.post h2 a:visited,
#content div.post h3 a:visited,
#content div.post h4 a:visited
{
color:#633B18;
}
#content div.post h2 a:hover,
#content div.post h3 a:hover,
#content div.post h4 a:hover
{
color:#AE3000;
}
#content p.tag-cloud {
margin-top:3em;
}
#content p.tag-cloud a {
color: #000;
}
#content ul, div.latest ul {
list-style-type:square;
padding-left:3em;
}
#content ol, div.latest ol {
list-style-type:decimal;
padding-left:3em;
}
#content img {
padding:2px;
background:#AE3000;
border:10px solid #ccc;
max-width:90%;
margin:10px;
}
#content img.noborder {
border:0px;
padding:0;
background: none;
}
.navigation div {
line-height:1.5em;
margin-bottom:1em;
}
.navigation .prev {
float:left;
width:40%;
}
.navigation .next {
float:right;
width:40%;
text-align:right;
}
.details_small {
font-size:1em;
color:#999;
margin:0;
}
div.list .details_small {
margin-top:-0.2em;
}
div.list p {
margin-bottom:0;
}
.details_small a {
color:#999;
text-decoration:underline;
}
p.date {
text-align:right;
font-size:1em;
color:#999;
}
span.gravatar {
display:block;
float:left;
}
span.gravatar img {
border: 5px solid #999;
}
div.column {
float:left;
}
div.left {
padding-right:0;
width:40%;
}
div.right {
padding-left:0;
padding-right:0;
width:48%;
}
/**
* COMMENTS
*/
div.comments, div.navigation {
margin-left:1.5em;
margin-right:1.5em;
width: 75%;
}
h2#comments{
margin-top:.2em;
margin-bottom:1.5em;
padding-bottom:0em;
font-weight:normal !important;
}
ol.commentlist {
list-style-type: none !important;
list-style-position: inside;
padding-left:0px !important;
margin-left:0px;
padding-bottom:.1em;
}
.commentlist li {
margin-bottom:1.5em;
padding-bottom:.5em;
padding-top:.8em;
border-top:1px solid #999;
}
.commentlist li.author {
border-top:1px solid #AE3000;
}
.commentlist li p {
margin-bottom:0em;
}
.commentlist li p.comment-data {
margin-bottom:1.5em;
}
.commentlist li p.comment-author {
font-size:1.5em;
line-height:1em;
font-family:Georgia,"Lucida bright","Times new roman",serif;
font-style:italic;
/*font-weight:bold;*/
/*font-variant:small-caps;*/
margin-bottom:0em;
}
.commentlist ul li,
.commentlist ol li {
margin-bottom:0;
padding-bottom:0;
border-bottom:0;
}
.commentlist ul {
padding-left:1.5em;
list-style-type:square;
}
.commentlist ol {
padding-left:1.5em;
/*list-style-type:lower-alpha;*/
}
p.nocomments {
padding-bottom:.5em;
border-bottom:1px solid #999;
font-weight:bold;
font-size:1.5em;
line-height:1em;
}
.allowed-tags {
display:none;
}
.commentlist li span.comment_number {
display:none;
float:right;
font-size:40px;
color: #999;
margin-top:.3em;
font-family: Verdana, Helvetica, sans-serif;
}
.commentlist li span.avatar {
display:block;
float:right;
margin:-2px 0px 0 0;
width:60px;
height:60px;
text-align:right;
}
#content .commentlist li span.avatar img.avatar {
display:block;
width:48px;
height:48px;
padding: 2px;
border: 1px solid #999 !important;
background: #eee;
}
#content .commentlist li.author span.avatar img.avatar {
border: 1px solid #AE3000 !important;
}
h2#respond {
margin-bottom:1.5em;
}
/**
* FORMS
*/
#commentform {
margin-bottom:1.5em;
padding-bottom:0em;
border-bottom:1px solid #999;
}
textarea {
width:99%;
}
/**
* RIGHT SIDEBARS
*/
.sidebar {
padding:0px;
float:right;
margin: 0.5em 0 0 0;
}
#sidebarFrame {
float:right;
padding:1em 0px;
width: 200px;
margin: 0 auto;
display: block;
}
.sidebar{
width: 98%;
margin: 0 auto;
}
.sidebar h2 {
font-size:1.3em;
line-height:1.2em;
border-bottom: 1px solid #000;
margin-bottom:.2em;
}
.sidebar ul {
margin-right:1.5em;
}
.sidebar ul li {
margin: 0;
margin-bottom:0.4em;
padding-bottom:.5em;
}
.sidebar h2 {
margin:.2em 0 -.2em 0;
border: none;
padding-bottom:.2em;
}
.sidebar ul {
margin:0 1.5em .2em 0;
padding:0 0 .5em 0;
}
.sidebar ul li {
border:1px solid #999999;
padding:1em 10px .5em 10px;
margin:0;
margin-bottom: 1em;
line-height:1.5em !important;
}
.sidebar ul li:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.sidebar ul li ul,
.sidebar ul li ul li {
border: none;
padding:0;
margin:0;
}
.sidebar img {
float:left;
margin:.3em .5em 0 0;
}
.sidebar .vcard img.photo {
border: 1px solid #999;
background: #eee;
}
.sidebar ul,
.sidebar ul li ul li,
.sidebar ul li ul li ul {
border-bottom:0;
margin:0;
padding-bottom:0;
}
.sidebar ul li ul {
font-size:.9em;
}
.sidebar ul li ul li,
.sidebar ul li ul li {
border-bottom:1px dotted #999;
line-height: 1.7em;
padding:.1em 0;
}
.sidebar ul li ul li:last-child {
border-bottom:none;
}
.sidebar ul li ul li ul {
margin-bottom:0;
padding-left:10px;
border-left:1px solid #aaa;
}
.sidebar a {
/*color: #999;*/
}
.sidebar a:hover {
/*color: #99000e;*/
}
/**
* FOOTER
*/
#footer {
padding:10px;
border-top:2px solid #AE3000;
clear:both;
text-align:left;
font-size:.9em;
}
#footer p {
margin-left:67%;
padding-left:.5em;
padding-top:1.5em;
}
#footer p:first-child {
float:left;
width:65%;
margin-left:0px;
padding-left:1em;
padding-right:0;
padding-top:1.5em;
}
ins.adsbygoogle
{
display:block !important;
margin
}
Your #content says it's width is set # 79%.
Instead of floating three containers to the left (which is causing this issue) I would put them all in another container and float it to the left:
<div class="floatme">
<div id="#container">..</div>
<div class="..">..</div>
<div class="..">..</div>
</div>
or remove the float from the top 3 and just float the comment to the right.
Try moving your HTML around a little. In particular, move the div with id "sidebarFrame" immediately after the div with id "content". When I did this in FireBug, the layout shows up as you describe it.
Your columns are not aligning because your .comments and .navigation elements are block level elements, which will not allow the .sidebarFrame to fill in the empty space. try putting those two elements inside of the left floated #content section, or wrap #content, .comments and .navigation in a left floated element.

CSS issue with top margin in safari

I can't get a top margin to show in safari. CSS works fine and the #divcontainer has a top margin and is centered in firefox and other browsers but not in safari.
I would like a 10px space to show above the container which will hold all other content.
Here is the CSS:
/* CSS Document */
body {
color: #000000; /*This sets all text to Black*/
/*background-color: #FFFFFF; /*This sets the bacground to white*/
margin: 100px auto; /*This sets the margin to zero*/
padding:0;
font-size:12px;
font-family:Verdana, Arial, Helvetica, sans-serif;
text-align:center;
}
p {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}
h1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #000099;
}
h2 {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #000099;
}
h3 {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #000099;
}
.redtext {
color: #FF0000;
}
a {
color: #009900;
}
a:link {
color: #000099;
text-decoration: underline;
}
a:visited {
color: #666666;
text-decoration: none;
}
a:hover {
text-decoration: none;
background-color: #CCCCCC;
}
a:active {
text-decoration: none;
}
.menu {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #000000;
}
.menu a:link {
color: #336600;
text-decoration: none;
}
.menu a:visited {
color: #666666;
text-decoration: none;
}
.menu a:hover {
color: #990000;
text-decoration: none;
}
.menu a:active {
color: #666666;
text-decoration: none;
}
div#container {
width: 960px;
height:760;
overflow:auto;
/*margin-left:0 auto; /* the auto value on the sides, coupled with the width, centers the layout */
}
div#outer {
margin-left: auto;
margin-right: auto;
width: 960px;
}
div#header {
position:relative;
text-align: center;
width: auto;
}
div#nav {
width: auto;
padding: 10px;
margin-top: 1px;
position:relative;
}
div#main {
position:relative;
width: auto;
}
div#footer {
position:relative;
width:auto;
padding: 15px;
margin: 0px;
}#nav {
position: relative;
padding:20px;
width: auto;
}
You'll probably want to set the margin: 10px auto; on the #container. Usually, I do this:
body {
text-align: center;
padding: 0;
margin: 0;
}
#container {
width: 960px;
height: 760px;
text-align: left;
margin: 10px auto;
}
...assuming the #container div is the first element, that should work out.
You may also want to try out one of the css reset files out there.

css background repeat is not working

I have a css class called navigation which will hold some link and when i'll add some extra link it will go from left to right and then again it'll come to bottom of the LHS. i use background-repeat: repeat-y; and height:auto; but the image is not repeating instead of a white background is coming. I'm working on IE8. the css codes are given below:
#navigation {
background: url(../images/custom/lite/navigation_bg.gif);
border-top: 7px solid #455660;
height: auto;
background-repeat:repeat-y;
}
#navigation ul,
#add-page {
float: left;
}
#navigation a {
color: #FFF;
display: block;
font: 14px/56px Arial,Helvetica,sans-serif;
font-weight:bold;
height: 50px;
padding: 0 24px;
text-decoration: none;
}
#navigation a:hover {
color: #000;
}
#navigation .selected a {
color:#000
}
#navigation .selected a {
font-size: large;
text-transform: uppercase;
}
#reuben, you given float in your ul so you have clear it #navigation
like this:
#navigation {
overflow:hidden;
}
may that's help you
What does your HTML look like? You say you have a class called navigation but your selector syntax is that of an ID.
For your CSS to work as shown here, you should have something like
<div id="navigation">...</div>
change your css to the below:
.navigation {
background: url(../images/custom/lite/navigation_bg.gif);
border-top: 7px solid #455660;
height: auto;
background-repeat:repeat-y; }
.navigation ul,
#add-page {
float: left; }
.navigation a {
color: #FFF;
display: block;
font: 14px/56px Arial,Helvetica,sans-serif;
font-weight:bold;
height: 50px;
padding: 0 24px;
text-decoration: none; }
.navigation a:hover {
color: #000; }
.navigation .selected a {
color:#000 }
.navigation .selected a {
font-size: large;
text-transform: uppercase; }

Navigation bounces on first and last li link in IE 6 only

I'm having a weird problem with my navigation in IE 6. Only the first and last links of the navigation bounce when hovered over.
Why would this be happening?
My CSS file:
#navigation {
width: 930px;
height: 30px;
background-color: #f1faff;
text-align:center;
}
#navigation ul {
margin: 0px;
padding: 0px;
list-style: none;
line-height: 30px;
}
#navigation ul li {
display: inline;
}
#navigation ul li a {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: bold;
color: #0067b4;
display: inline;
text-decoration: none;
text-transform: uppercase;
padding: 7px 50px;
}
#navigation ul li a:hover {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: bold;
color: #5e5e5e;
display: inline;
text-decoration: none;
text-transform: uppercase;
padding: 7px 50px;
}
#navigation ul li a.first {
padding-left: 8px;
margin: 0px;
overflow: hidden;
border: 0px;
}
#navigation ul li a.last {
padding-right: 8px;
margin: 0px;
overflow: hidden;
border: 0px;
}
The site where this is happening is available at http://www.paysonsecure.com/protekskiracing/
I would add this to your global-ie6.css
#navigation ul { display: inline-block; }
Thanks gutierrezalex!! I had the same problem and it works adding {display: inline-block;} at my styles..it works for any browser:
ul.menu li a{
text-decoration:none;
color:black;
display:block;
padding:0;
margin:0;
display:inline-block;
}
ul.menu li a:hover{
background-color:#5cc2ed;
color:#ffffff;
display:inline-block;
}

Resources