Click to See Complete Forum and Search --> : ul margin-left
I am using a submenu below the header and would like it to be within 10px of the left margin of the container. Whatever I do it will not move further left.
here is the snippet dealing with the ul
.menusub ul {display: block;
width: 100px;
margin-left: 0px;
padding: 0;}
.menusub li {list-style: none;
margin: 0px 0px 0px 0px;
padding: 0;
font-family: Arial, Helvetica, sans-serif;
color: #C17B21;
font-size: 1em;
font-weight: bold;
text-decoration: none;}
yet on the page the ul is about 70px from the left margin
Wiz Creations
07-28-2006, 08:44 AM
Can you post the rest of the css and the html?
the css
/* CSS Document */
html { margin: 0;
padding: 0;
font: 100%;}
body { font-family: Geneva, Arial, Helvetica, sans-serif;
background-color: #693204;
text-align: center;
margin: 0;
padding: 0;}
div#container {width: 800px;
height: 100%;
margin: 0 auto;
padding: 0;
text-align: left;
background: #FFCF7C;
border-left: 18px solid #C17B21;
border-right: 18px solid #C17B21;}
div#content {width: 100%;
overflow: auto;}
div#content_main {float: left;
margin-left: 5px;
margin-top: 20px;
text-align: left;}
div#content_sub {width: 160px;
float: left;
padding: 0;
margin-left: 0;
margin-top: 20px;
text-align: left;
border:1px dotted #808}
div#header {background: url(images/header_bg1.jpg) no-repeat;
text-align: left;
border-bottom: 12px solid #C17B21;}
div#header h1 {font-family: Arial, Verdana, sans-serif;
font-size: 2em;
color: #FEE473;
font-style: italic;
font-variant: small-caps;
position-top: absolute 20px;
margin-left: 1.5em;}
div#nav {width: 700px;
text-align: center;}
div#nav ul {list-style: none;
margin: 1em;
margin-left: 1.5em;
padding: 0;}
div#nav li {display: inline;
font-family: Arial, sans-serif;
font-size: 1em;
font-weight: bold;
letter-spacing: .15em;
padding: 0 10px 0 15px;}
div#nav li a:link {font-family: Arial, sans-serif;
color: #522F04;
font-size: 1em;
font-weight: bold;
letter-spacing: .15em;
text-decoration: none;}
div#nav li a:visited {font-family: Arial, sans-serif;
color: #A44E06;
font-size: 1em;
font-weight: bold;
letter-spacing: .15em;
text-decoration: none;}
div#nav li a:hover {font-family: Arial, sans-serif;
color: #FCFDBD;
font-size: 1em;
font-weight: bold;
letter-spacing: .15em;
text-decoration: none;
border-top: 5px dotted #FCFDBD;}
.menusub ul {display: block;
width: 100px;
margin-left: 0px;
padding: 0;
border:2px solid #808}
.menusub li {list-style: none;
margin: 0px 0px 0px 0px;
padding: 0;
font-family: Arial, Helvetica, sans-serif;
color: #C17B21;
font-size: 1em;
font-weight: bold;
text-decoration: none;
border:1px solid #808}
.menusub li a:link {font-family: Arial, Helvetica, sans-serif;
color: #C17B21;
font-size: 1em;
font-weight: bold;
text-decoration: none;
}
.menusub li a:visited {font-family: Arial, Helvetica, sans-serif;
color: #FAAA1E;
font-size: 1em;
font-weight: bold;
text-decoration: none;}
.menusub li a:hover {font-family: Arial, Helvetica, sans-serif;
color: #EA9B1E;
font-size: 1em;
font-weight: bold;
text-decoration: none;
background-color: #FAE9B6;
border-top: 2px dashed #EA9B1E;
border-bottom: 2px solid #EA9B1E;}
p {color: #301724;
font-size: 1em;
line-height: 1.1em;
margin-right: 5px;}
ul {font-size: .85em;
font-weight: bold;
color: #AC5301;
list-style-type: circle;}
.space {margin-bottom: 10px;}
the html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Sandwich Monthly Meeting NEW</title>
<link href="new-smm.css" rel="stylesheet" type="text/css" media="all" />
</head>
<body>
<div id="container">
<div id="header">
<h1>Sandwich Monthly Meeting</h1>
<div id="nav">
<ul>
<li><a href="index.html">HOME</a></li>
<li><a href="falmouth.html">FALMOUTH</a></li>
<li><a href="sandwich.html">SANDWICH</a></li>
<li><a href="yarmouth.html">YARMOUTH</a></li>
</ul>
</div>
</div>
<div id="content_sub">
<ul class="menusub">
<li><a href="smmhistory.html">Meeting History</a></li>
<li><a href="earlyquakers.html">Early Quakers</a></li>
<li><a href="quakerintro.html">Intro to Quakers</a></li>
<li><a href="worship.html">Quaker Worship</a></li>
<li><a href="silencespeech.html">Silence Speech</a></li>
</ul>
</div>
<div id="content_main">
<p>Sandwich Monthly<span class="style2"></span> meeting cordially invites you to join us for worship.</p>
<p>It is the oldest, continuously organized, monthly meeting of the
Religious Society of Friends - Quakers - in the United States. </p>
<p>Sandwich Monthly Meeting consists of three Preparative Meetings and a Worship Group. </p>
<p>
<ul>
<li>Upper Cape - West Falmouth</li>
<li>Mid-Cape - East Sandwich</li>
<li>Lower Cape - Yarmouth</li>
<li>Outer Cape - Lower Cape Worship Group</li>
</ul>
</p>
<p>All three Meetings meet for worship on First Day - Sunday - at 10:00 a.m.</p>
<p>The Lower Cape Worship Group meets on Tuesday from 5:30 - 6:30 p.m.</p>
<p class="space">Children Program - First-Day School are held at East Sandwich - 10:00 a.m. - Third Sunday of the Month. Adults are welcome</p>
<p>All 3 Prepatory Meetings are unprogrammed. If you need help understanding unprogrammed Quaker worship please read Quakers and Worship, and the article Silence and Speech. These should help you to understand Quaker Worship.</p>
<p>Sandwich Monthly Meeting is part of
<a href="sandwichquarter.htm" target="_blank">Sandwich Quarterly
Meeting</a> and <a href="http://www.neym.org">New
England Yearly Meeting</a></p>
<p>NEYM 2004 Keynote Address </p>
</div>
</div>
</body>
</html>
Sure hope you can help. the border around the submenu is to help me see the outline of the ul block.
Wiz Creations
07-28-2006, 10:14 AM
First off, there are a few errors in the css. You can use a CSS Validator (http://jigsaw.w3.org/css-validator/) to see. You left out some semi-colons, and you have invalid attributes/pseudo classes.
I have no idea what is wrong with it though. I messed around with it for 30 minutes and it still gets pushed to the right. My guess is that you have contradicting css attributes applied causing it not to work properly.
WebJoel
07-28-2006, 11:15 AM
You're trying to apply the style to the menusub li. Apply to the menusub itself.
Here is a boiled-down version:
<style type="text/css">
#content_sub {
width:140px;
float: left;
padding: 0;
margin-left: 0;
margin-top: 20px;
text-align: left;
border:3px dotted #808;}
.menusub {list-style-type: none;
margin: 0;
padding: 5px;
font-family: Arial, Helvetica, sans-serif;
color: #C17B21;
font-weight: bold;
text-decoration: none;
border:1px solid #808}
</style>
</head>
<body>
<div id="content_sub">
<ul class="menusub">
<li><a href="smmhistory.html">Meeting History</a></li>
<li><a href="earlyquakers.html">Early Quakers</a></li>
<li><a href="quakerintro.html">Intro to Quakers</a></li>
<li><a href="worship.html">Quaker Worship</a></li>
<li><a href="silencespeech.html">Silence Speech</a></li>
</ul>
</div>
This gets rid of that parculiar 70-pixels (or whatever amount?) space to the left of the list-items outta there.