Jayhawk
05-13-2005, 09:04 AM
This is a plea for help. I have bought into laying out sites with CSS and not using tables and Javascript menus and after two texts and more than a month of full-time effort there is something fundamental about CSS that I just "don't get." Elements are moving all over the map in ways that I am totally unable to predict, and the things that work in articles simply don't do for me what the article says they will do.
I am not a stupid person. I have been programming successfully in C/C++ for more than 20 years, and doing internet programming for more than 8 years using HTML and laying sites out with tables. I can honestly say that I have never in all that time had a customer who was anything less that happy with what I produced for them. So I do know more than a little bit about programming terms and technology.
Unless I make some kind of breakthrough of comprehension I am going to have to drop this project in favor of something that will get sites on the web and money into my bank account. It's not that my sites don't work well now or that my customers are not happy with them; I've just been rather wanting to be using more modern technique in producing them.
My "state of my knowledge" work is here (http://www.sonora-sw.com/eight/) and you will see that the menu "sort of" works between "Home" and "About Us."
The menubar is pushing the other <divs> down below where I wouild expect them to be, and I cannot understand why. Between the bottom of the image (and of the menubar) and the top of the "contents" <div> is a gap of approx 20px. I am correcting that by positioning that div and the footer with a "top: -22px;" but have no idea why that is needed. (I've posted this question a couple of times with no answer. I wouldn't start a new thread if this were my only question.)
It seems primitive and unreliable to me to be locating elements on the website by this kind of experimentation. "Well, guess at a location, see how it looks and then adjust based on the appearance."
The article was this one (http://www.alistapart.com/articles/taminglists/) CSS Design: Taming Lists: A List Apart.
The link on my menu is limited to the text because trying to make the whole <div> containing the link become active never behaved anything like the article said it would.
#button li a {
display: block;
width: 100%
}
html>body #button li a {
width: auto;
}
That trashed the menu bar display completely and nothing I could do would make it work. The "Home" item was centered and the other four disappeared as soon as I included the above lines in the CSS.
Trying to make a dropdown produced even less success. This code is supposed to prevent the sublist from being displayed when not "moused over:
li ul {
display: none;
position: absolute;
top: 1em;
left: 0;
}
But it does not. The sublist is displayed inline where the main menu should be and the main menu list is pushed down and mostly concealed behind the "content" div.
Can anyone offer input into what it is that I am missing? Help with these specific issues, but more important, what basic facet of CSS am I not getting?
The CSS for my page:
#outer {
border: 1px solid #0000B0;
width: 760px;
height: 490px;
background: #FFFFFF;
margin: auto;
}
#menubar {
position: relative;
top: -22px;
left: 8px;
}
#menubar ul {
margin-left: 0;
padding-left: 0;
display: inline;
}
#menubar ul li {
margin-left: 0;
margin-bottom: 0;
margin-right: 30px;
padding: 1px 10px 1px;
border: 1px solid #FFFFFF;
list-style: none;
display: inline;
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
font-weight: bold;
color: #FFFFFF;
}
#menubar ul li.here {
border: 1px solid #FFFF00;
color: #FFFF00;
}
#menubar li:hover {
border: 1px solid #FFFF00;
color: #FFFF00;
}
#menubar li a {
color: #FFFFFF;
text-decoration: none;
}
#menubar li a:hover {
color: #FFFF00;
}
#content {
position: relative;
top: -22px;
height: 400px;
width: 760px;
font: bold 10pt Arial, Helvetica, sans-serif;
color: #0000B0;
text-align: center;
}
#footer {
position: relative;
top: -22px;
height: 30px;
width: 760px;
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
font-weight: normal;
color: #0000B0;
text-align: center;
}
I am not a stupid person. I have been programming successfully in C/C++ for more than 20 years, and doing internet programming for more than 8 years using HTML and laying sites out with tables. I can honestly say that I have never in all that time had a customer who was anything less that happy with what I produced for them. So I do know more than a little bit about programming terms and technology.
Unless I make some kind of breakthrough of comprehension I am going to have to drop this project in favor of something that will get sites on the web and money into my bank account. It's not that my sites don't work well now or that my customers are not happy with them; I've just been rather wanting to be using more modern technique in producing them.
My "state of my knowledge" work is here (http://www.sonora-sw.com/eight/) and you will see that the menu "sort of" works between "Home" and "About Us."
The menubar is pushing the other <divs> down below where I wouild expect them to be, and I cannot understand why. Between the bottom of the image (and of the menubar) and the top of the "contents" <div> is a gap of approx 20px. I am correcting that by positioning that div and the footer with a "top: -22px;" but have no idea why that is needed. (I've posted this question a couple of times with no answer. I wouldn't start a new thread if this were my only question.)
It seems primitive and unreliable to me to be locating elements on the website by this kind of experimentation. "Well, guess at a location, see how it looks and then adjust based on the appearance."
The article was this one (http://www.alistapart.com/articles/taminglists/) CSS Design: Taming Lists: A List Apart.
The link on my menu is limited to the text because trying to make the whole <div> containing the link become active never behaved anything like the article said it would.
#button li a {
display: block;
width: 100%
}
html>body #button li a {
width: auto;
}
That trashed the menu bar display completely and nothing I could do would make it work. The "Home" item was centered and the other four disappeared as soon as I included the above lines in the CSS.
Trying to make a dropdown produced even less success. This code is supposed to prevent the sublist from being displayed when not "moused over:
li ul {
display: none;
position: absolute;
top: 1em;
left: 0;
}
But it does not. The sublist is displayed inline where the main menu should be and the main menu list is pushed down and mostly concealed behind the "content" div.
Can anyone offer input into what it is that I am missing? Help with these specific issues, but more important, what basic facet of CSS am I not getting?
The CSS for my page:
#outer {
border: 1px solid #0000B0;
width: 760px;
height: 490px;
background: #FFFFFF;
margin: auto;
}
#menubar {
position: relative;
top: -22px;
left: 8px;
}
#menubar ul {
margin-left: 0;
padding-left: 0;
display: inline;
}
#menubar ul li {
margin-left: 0;
margin-bottom: 0;
margin-right: 30px;
padding: 1px 10px 1px;
border: 1px solid #FFFFFF;
list-style: none;
display: inline;
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
font-weight: bold;
color: #FFFFFF;
}
#menubar ul li.here {
border: 1px solid #FFFF00;
color: #FFFF00;
}
#menubar li:hover {
border: 1px solid #FFFF00;
color: #FFFF00;
}
#menubar li a {
color: #FFFFFF;
text-decoration: none;
}
#menubar li a:hover {
color: #FFFF00;
}
#content {
position: relative;
top: -22px;
height: 400px;
width: 760px;
font: bold 10pt Arial, Helvetica, sans-serif;
color: #0000B0;
text-align: center;
}
#footer {
position: relative;
top: -22px;
height: 30px;
width: 760px;
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
font-weight: normal;
color: #0000B0;
text-align: center;
}