Menu list Orientation

I’ve started all over once again, one line at a time in the html followed by its related css attributes.

Is my doc type correct in the html? Transitional?

The menu does not line up to the 960px width of the .outer call as the two images do.

It’s just a little to the left under the second image in the html.

I think it’s in the #navcontainer portion of the CSS but I don’t know enough to know.

Once I get this menu alignment problem solved I will tackle adding sub menus. Yikes!

Okay one more time . . . horizontal or vertical menus. Which one, and WHY?

Thanks much . . . Rick

HTML"
<!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>Properties With Style Orange County Real Esate</title>
<link rel="stylesheet" href="css/stylesheet2.css" type="text/css" media="all"/>
</head>
<!-- 8/3/2011 -->

<body>
	 <div id="header"><img src="css/images/pwsheader.gif" width="960" height="60" alt="Properties With Style Header Image" /></div>
   	 <div class="plate"><img src="css/images/equestrainestate.jpg" width="960" height="300" alt="Coto de Caza Equestrian Estate"/></div>

				<div id="outer">
            
<!-- From ListMatic "Horizontal Buttons"-->
<div id="navcontainer">
	<ul id="navlist">   <!-- LOOK FOR IN css--ul#navlist-->
 		<li id="active"><a href="index.html" id="current">HOME PAGE</a></li>
   		<li><a href="#">SOUTH OC AREAS</a></li>
  		<li><a href="#">SEARCH HOMES</a></li>
 		<li><a href="#">IMPORTANT DATA</a></li>
 		<li><a href="#">FOR SELLERS</a></li>
 		<li><a href="#">FOR BUYERS</a></li>
 		<li><a href="#">PRICE HISTORY</a></li>
    	<li><a href="#">MARKET STATS</a></li>
 	</ul>
</div>
<!--end of navigation div -->
  
 

			</div><!--close outer DIV-->
</body>
</html>

CSS:


@charset "utf-8";  
/* CSS Document */
/* 8/3/2011 */


#header		{
		margin-left:auto;
		margin-right:auto;
		width:78%;
				 
			
}

html, body	{
		color:#000;
		background-image: url(images/blinds1.png);		background-attachment:fixed;
		font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
		font-size:100%;
		float:right;
		width:100%;
}


#outer		{
		max-width:1200px;
		min-width:600px;
		 
}

.plate		{
		margin-left:auto;
		margin-right:auto;
		width:78%;

}

p		{
		font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
		margin-left:auto;
		margin-right:auto
		font-size: 80%;
		width:78%;
		line-height: 1.1; 
		color: #6CF; 
		text-align: left;
		float:right;
					 			 
}

          
/* NAVIGATION STARTS HERE: FROM LISTMATIC */
#navcontainer{
		background: transparant; 
		margin: 0 auto;
		padding: 1em 0 0 0;
		font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
		text-transform: capitalize;
		text-align:center; 
			  
}

 /* to stretch the container div to contain floated list COMMENTING OUT NO CHANGES?*/
 #navcontainer:after{
 				content: ".";
 				display: block;
 				line-height: 1px;
 				font-size: 1px;
 				clear: both;

}

 ul#navlist		{
 				list-style: none;
 				padding: 0;
 				margin: 0 auto;
 				width: 960px;
				font-size: 0.6em;
 
 }

 ul#navlist li	{
 				display: block;
 				float: left;
 				width: 12%;
				margin: 0;
 				padding: 0;

 }

 ul#navlist li a {
 				display: block;
 				width: 100%;
 				padding: 0.5em;
				border-width: 1px;
 				border-color: #006 #333;
 				border-style: solid;
 				color: #777;
 				text-decoration: none;
				background: transparent;  /*#021A68  #f7f2ea; */
 }

 #navcontainer>ul#navlist li a { width: auto; }

 ul#navlist li#active a {
				background: transparent;
				color: #0FF;
 }

/* HOVER borders around each block button - text color indise block */
 ul#navlist li a:hover, ul#navlist li#active a:hover
 				{
 				color: #0FF;
 				background: transparent;
 				border-color: #aaab9c #fff #fff #ccc;
 }

/* END OF NAVIGATION LIST  */
            

/* eND css*/

Two thoughts at the outset, regarding this:

HTML"
<!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">

The HTML" needs to be deleted.

Why bother with a transitional doctype, and especially an obsolete XHTML doctype? Unless you’re forced to provide legacy support for HTML 3.2 elements and such, there’s never a need to use a transitional doctype.

I thought it was out of date.

Where do I acquire an updated doc type etc?

W3c has them but I don’t know which one to select.

I’m a neophyte with html & css.

Thanks

Rick

Lets see . . .

There is a css outer or wrapper or container, etc.

Then there is header . . .

Then there are images . . .

Then there are menus . . .

Then there is <p> . . .

Then there is content . . .

Then there is footer . . .

I saw something about if margin-right & margin-left were both auto and width was anything other than 100% that all content would be centered.

Just how is this accomplished given all of the citations above?

What is the natural flow?

Thanks Rick

Max was referring to a Strict Doctype for example:[FONT=Courier New]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

[/FONT]
Please don’t use adjacent hyphens within comment delimiters:

<!-- LOOK FOR IN cssul#navlist–>

It can do strange things to browser rendering; so don’t use any extra – within any normal standard <!-- Comment –>

Hi,

You seem to be doing weird things again.:slight_smile:

Your menu, header and plate elements are 960px wide yet you have a put a min-width of 600px on the outer. How are those elements supposed to fit inside?

Either you make everything fluid or you set the min-width equal to the largest fixed width element in that page. You can’t have it both ways. Either make it fluid or make it fixed or make it elastic within limits.

Looks like you your design is based on a 960px min-width so you will have to live with that unless you can change your header images so something smaller.

You have set the anchors to be 100% width but you have also added padding and borders so that will make them to big to fit.

The navcontainer looks redundant and you could have used the ul instead.

Something roughly like this (without knowing the desired look of course).


<!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=utf-8" />
<title>Properties With Style Orange County Real Esate</title>
<link rel="stylesheet" href="css/stylesheet2.css" type="text/css" media="all"/>
<style type="text/css">
@charset "utf-8";
/* CSS Document */
/* 8/3/2011 */

html, body {
    margin:0;
    padding:0;
}
body {
    color:#000;
    background: url(images/blinds1.png) fixed;
    font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
    font-size:100%;
    line-height:1.3;
}
#outer {
    max-width:1200px;
    min-width:960px;
    width:78%;
    margin:auto;
}
#header {
    margin:0;
    padding:0
}
#header img, .plate img {
    display:block
}
p {
    font-size: 80%;
    line-height: 1.1;
    color: #6CF;
}
ul#navlist {
    list-style: none;
    margin: 0 auto;
    padding: 1em 0 0 0;
    width: 100%;
    font-size: 0.6em;
    text-transform: capitalize;
    text-align:center;
}
/* to stretch the container div to contain floated list COMMENTING OUT NO CHANGES?*/
ul#navlist:after {
    content:".";
    display:block;
    height:0;
    clear:both;
    visibility:hidden;
}
/* 8 list items * 12% = 96% */
ul#navlist li {
    float: left;
    width: 12%;
    margin: 0;
    padding: 0;
}
ul#navlist li.first {
    margin-left:2%;
    display:inline;/* ie6 double margin fix*/
}
ul#navlist li a {
    display: block;
    padding: 0.5em;
    border-width: 1px;
    border-color: #006 #333;
    border-style: solid;
    color: #777;
    text-decoration: none;
    background: transparent;  /*#021A68  #f7f2ea; */
    zoom:1.0;
}
#navcontainer>ul#navlist li a {
    width: auto;
}
ul#navlist li#active a {
    background: transparent;
    color: #0FF;
}
/* HOVER borders around each block button - text color indise block */
 ul#navlist li a:hover, ul#navlist li#active a:hover {
    color: #0FF;
    background: transparent;
    border-color: #aaab9c #fff #fff #ccc;
}

/* END OF NAVIGATION LIST  */
            

/* eND css*/
</style>
</head>
<!-- 8/3/2011 -->
<body>
<div id="outer">
    <h1 id="header"><img src="css/images/pwsheader.gif" width="960" height="60" alt="Properties With Style Header Image" /></h1>
    <div class="plate"><img src="css/images/equestrainestate.jpg" width="960" height="300" alt="Coto de Caza Equestrian Estate"/></div>
    <ul id="navlist">
        <li id="active" class="first"><a href="index.html" id="current">HOME PAGE</a></li>
        <li><a href="#">South OC Areas</a></li>
        <li><a href="#">Search Homes</a></li>
        <li><a href="#">Important Data</a></li>
        <li><a href="#">For Sellers</a></li>
        <li><a href="#">For Buyers</a></li>
        <li><a href="#">Price Hoistory</a></li>
        <li><a href="#">Market Stats</a></li>
    </ul>
</div>
<!--close outer DIV-->
</body>
</html>


We’d probably need to see a picture of the design to offer better help.:slight_smile:

Just to re-iterate what others have said and add my own thoughts…

Tranny is for old/outdated/half-assed code, not for building new pages… go STRICT!

Your commenting style AND placement could trip rendering errors, especially if floats end up in there.

You probably have a div around navlist for no good reason. the UL is a perfectly good block level container all by itself.

Honestly, ease up on declaring widths… If you have to declare your outermost width more than twice, there may just be something horrendously wrong with your markup or site design approach.

Your plate image appears to be presentational, has no business in the markup – top image in it is likely also a presentational affectation of a HEADER, so get the text in there with a image replacement technique on it… Paul’s example is better since he uses a h1, but I’d still get that image out of the markup as it has no business being there – also since you should only ever have ONE h1 on a page, there’s no reason to put an ID on it there Paul :smiley:

Avoid using ID’s and/or classes that are the same as psuedo-classes or psuedo-states – id=“active” – you might as well say class=“div”… It’s confusing.

Though, I’d have to see the page rendered to say for sure, but I suspect you’ve been bitten by the “divs around everything with excess classes and ID’s for nothing” bug. It’s certainly NOT semantic markup.

Paul’s example is better since he uses a h1, but I’d still get that image out of the markup as it has no business being there – also since you should only ever have ONE h1 on a page, there’s no reason to put an ID on it there Paul :smiley:

Yes, I agree with those points and I would normally have used image replacement for the header image but was just trying to keep it basic for now until I saw where this was “heading” :slight_smile:

Your menu, header and plate elements are 960px wide yet you have a put a min-width of 600px on the outer. How are those elements supposed to fit inside?

The code is really a TARDIS.

didn’t realize I had the extra in there.

Thanks everyone!

You begin to see how really confused I am.

That’s because there is no flowing clarity.

You know . . . what comes first - the chicken or the egg? Then how to cook it!

I do understand the importance of !DOCTYPE but wasn’t sure which example to select.

“Your menu, header and plate elements are 960px wide yet you have a put a min-width of 600px on the outer. How are those elements supposed to fit inside?”

I read that the 960 grid system was well accepted. I also read that maximum width probably shouldn’t be wider that 1200px and less than 600px to allow for most browser compatibility. If I use a 960px grid then there is no viewport space on either side of the content, right?

How, or what is reasonable #outer declarations? Should I forget a minimum-width in the outer?

"Honestly, ease up on declaring widths… If you have to declare your outermost width more than twice, there may just be something horrendously wrong with your markup or site design approach."

This is another thing I’m not clear on. Measurements.

I read that for images the proper measurement is in pixels. All other stuff is either in em, or %, or fixed, etc.

Based on what I’ve read, % seem to be the most compatible, or maybe forgiving. Simple clarity on this would be excellent.

“You probably have a div around navlist for no good reason. the UL is a perfectly good block level container all by itself.”

I believed that there were too many width definitions but the examples I followed don’t talk about that, I’m sure because they believe that everyone understands this stuff.

I’d like to remain simple and use inherit as often as possible.

" . . . there may just be something horrendously wrong with your markup or site design approach."

Yes there is . . .

“so get the text in there with a image replacement technique on it…”

I’m not quite clear on using an h1 with an image in one declaration. How and where is the text to be positioned in relation to the image?

"Avoid using ID’s and/or classes that are the same as psuedo-classes or psuedo-states – id=“active” – you might as well say class=“div”… It’s confusing."

My Point EXACTLY!

"Though, I’d have to see the page rendered to say for sure, . . . "

You can always visit Properties With Style Orange County Real Esate the see where I’m at.

"You have set the anchors to be 100% width but you have also added padding and borders so that will make them to big to fit. "

What’s an anchor? I sail on the ocean often - I know what that anchor is. What’s it doing in html and css?

“Looks like you your design is based on a 960px min-width so you will have to live with that unless you can change your header images so something smaller.”

Again - is 1200 better or more professional? Graphically I’m capable as I made both of those in about 20 minutes.

I’m going to try Paul’s example and see if I can make sense out of it.

I’ll get back later this afternoon.

Thanks much everyone. I really do appreciate it.

Rick

Ok . . .Paul’s code seems to work well for the graphics and menu placement, although the menu is slightly left of center but not by much.

But once I place the <p> text below the menu, the text flows all the way to the left and right side of the screen. I’m trying to avoid this.

Why?

Here is the p{ code


p {
    font-size: 80%;
    line-height: 1.1;
    color: #6CF;
}

What I wish is for ALL content under the two graphics and the menu to mimic the same width as the two graphics, including the footer unless otherwise coded which I’m unable to do.

The #outer is

#outer {
    max-width:1200px;
    min-width:960px;
    width:78%;
    margin:auto;
}

Point blank - how to I set widths for text, or is that the incorrect way.

Here is the header and I don’t quite get it.

#header img, .plate img {
    display:block
}

What limits the size of display:block?

The footer also spans the entire screen left to right.

I can’t figure it out.

Rick

I read that the 960 grid system was well accepted. I also read that maximum width probably shouldn’t be wider that 1200px and less than 600px to allow for most browser compatibility. If I use a 960px grid then there is no viewport space on either side of the content, right?

How, or what is reasonable #outer declarations? Should I forget a minimum-width in the outer?

None of that has anything to do with the fact that you’re trying to stuff a 960 foot wide box inside a 600 foot wide box. Do you see it now? You don’t put big things inside small things. They don’t fit. Can you eat a whole elephant?

Point blank - how to I set widths for text, or is that the incorrect way.

Text will normally be limited to the size of the box you put it in, and when it gets too wide it should wrap. So like the width of a book page limits the width of any line of text on it.

P’s are blocks so you can set widths on them. But usually when I have text that I need to not be wider than something, that p holding the text is usually in some other box. So I let the width of that other box limit the text. You’re on the right track.

What limits the size of display:block?

Technically, a block is always in some other block (and if the block is the body element, its parent block is your screen). If you don’t float them or position them or do anything weird to them, a block is as wide as it can get and still fit in the box it’s in. Unless you actually manually set a width.

But the code you link to is special: they are making img’s into blocks. An image is normally inline (like text), but because it’s calling some image with pixel dimensions, it looks like a block (pictures are square). Paul is setting display: block on images prolly for a number of reasons, but mostly to make them act like a block since they look like a block. If you make an image a block, now you can for example center them like other blocks: with automargins.

No you are mistaken it is perfectly centred. You have 8 items at 12% making 96% width and it has a of 2% which means it is exactly centred. (It doesn’t mean it is 960px wide because that’s not how you sized it.)

But once I place the <p> text below the menu, the text flows all the way to the left and right side of the screen. I’m trying to avoid this.

No it doesn’t the text flows to the left and right of the container which is #outer.


<!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=utf-8" />
<title>Properties With Style Orange County Real Esate</title>
<link rel="stylesheet" href="css/stylesheet2.css" type="text/css" media="all"/>
<style type="text/css">
@charset "utf-8";
/* CSS Document */
/* 8/3/2011 */

html, body {
    margin:0;
    padding:0;
}
body {
    color:#000;
    background: url(images/blinds1.png) fixed;
    font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
    font-size:100%;
    line-height:1.3;
}
#outer {
    max-width:1200px;
    min-width:960px;
    width:78%;
    margin:auto;
}
#header {
    margin:0;
    padding:0
}
#header img, .plate img {
    display:block
}
p {
    font-size: 80%;
    line-height: 1.1;
    color: #6CF;
}
ul#navlist {
    list-style: none;
    margin: 0 auto;
    padding: 1em 0 0 0;
    width: 100%;
    font-size: 0.6em;
    text-transform: capitalize;
    text-align:center;
}
/* to stretch the container div to contain floated list COMMENTING OUT NO CHANGES?*/
ul#navlist:after {
    content:".";
    display:block;
    height:0;
    clear:both;
    visibility:hidden;
}
/* 8 list items * 12% = 96% */
ul#navlist li {
    float: left;
    width: 12%;
    margin: 0;
    padding: 0;
}
ul#navlist li.first {
    margin-left:2%;
    display:inline;/* ie6 double margin fix*/
}
ul#navlist li a {
    display: block;
    padding: 0.5em;
    border-width: 1px;
    border-color: #006 #333;
    border-style: solid;
    color: #777;
    text-decoration: none;
    background: transparent;  /*#021A68  #f7f2ea; */
    zoom:1.0;
}
#navcontainer>ul#navlist li a {
    width: auto;
}
ul#navlist li#active a {
    background: transparent;
    color: #0FF;
}
/* HOVER borders around each block button - text color indise block */
 ul#navlist li a:hover, ul#navlist li#active a:hover {
    color: #0FF;
    background: transparent;
    border-color: #aaab9c #fff #fff #ccc;
}

/* END OF NAVIGATION LIST  */
            

/* eND css*/
</style>
</head>
<!-- 8/3/2011 -->
<body>
<div id="outer">
    <h1 id="header"><img src="css/images/pwsheader.gif" width="960" height="60" alt="Properties With Style Header Image" /></h1>
    <div class="plate"><img src="css/images/equestrainestate.jpg" width="960" height="300" alt="Coto de Caza Equestrian Estate"/></div>
    <ul id="navlist">
        <li id="active" class="first"><a href="index.html" id="current">HOME PAGE</a></li>
        <li><a href="#">South OC Areas</a></li>
        <li><a href="#">Search Homes</a></li>
        <li><a href="#">Important Data</a></li>
        <li><a href="#">For Sellers</a></li>
        <li><a href="#">For Buyers</a></li>
        <li><a href="#">Price Hoistory</a></li>
        <li><a href="#">Market Stats</a></li>
    </ul>
        <p>Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. </p>
                <p>Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. </p>
</div>
<!--close outer DIV-->
</body>
</html>

What I wish is for ALL content under the two graphics and the menu to mimic the same width as the two graphics, including the footer unless otherwise coded which I’m unable to do.

It already does that without doing anything special!

Point blank - how to I set widths for text, or is that the incorrect way.

You don’t set widths for every bit of text. You allow them to stretch to the width of the container they are in. As you want the text the full width of the container then you don’t have to do anything more.

If you wanted columns or smaller blocks then you would wrap all the p elements in a parent div and size the div accordingly.

Here is the header and I don’t quite get it.

#header img, .plate img {
    display:block
}

What limits the size of display:block?

[quote]

The display:block changes the image from display:inline (their default) to display:block to kill any white space gaps that are in the html as you don’t need the images inline for those two elements. Inline images are treated as text and are placed on the baseline to allow room for descenders. When they are block elements they are placed on the bottom and do not have room allowed for descenders.

[quote]
The footer also spans the entire screen left to right.

No it won’t if you place inside #outer which is the container for all the content.

What’s an anchor? I sail on the ocean often - I know what that anchor is. What’s it doing in html and css?

Anchors are the term used for the <a href=“#”> elements because they anchor a url to some text or image.