Duane Lambe / 2003-10-28 16:44:
Please, give us a screenshots of the problem in the future with
highlighting of every place you think is incorrect. Not all of us
Ah, my fault, sorry bout that - wasn't sure if this was a
sshot-friendly group, and I was pressed for time (what else is new?).
I'm not sure if you understood correctly. You should NOT post any
attachments to this newsgroup, but you should save screenshots of
the page next to the page and provide URLs.
That was exactly it - I am a dolt. :) Thanks very much for that... I
wasn't aware - but I'm not surprised - that browsers had different
margin settings... actually, it seems that IE is the different one,
compared to at least Moz, and I assume Opera, as per another post.
The interesting part is that some browsers use padding instead of
margin for indenting body text by default. That's why you always
have to define both for html and body elements.
You should really use cascading to get rid of unnecassary repeating
repeating repeating of the same CSS declarations.
I've tried a few things in the CSS file to consolidate the more common
elements into a "catch-all", but it never worked for me. Would you
have a link that I could read, that shows a quick example? I'm sure I
just don't understand the syntax. The buttons especially share tons of
the same stuff, and I'd love to clean that up.
I don't have any such links at hand, but I'll wrap an example:
You have stuff like:
..button01 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-style: normal;
line-height: normal;
color: #000000;
font-variant: normal;
text-align: center;
cursor: pointer;
position: absolute;
background-color: #B9C8D2;
top: 50px;
left: 10px;
width: 120px;
text-decoration: none;
height: 15px;
border-top: 1px #00557D;
border-right: 1px #00557D;
border-bottom: 1px solid #00557D;
border-left: 1px solid #00557D;
}
..button01:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-style: normal;
line-height: normal;
color: #FFFFFF;
font-variant: normal;
text-align: center;
cursor: pointer;
position: absolute;
background-color: #00557D;
top: 50px;
left: 10px;
width: 120px;
text-decoration: none;
height: 15px;
border-top: 1px #00557D;
border-right: 1px #00557D;
border-bottom: 1px solid #00557D;
border-left: 1px solid #00557D;
}
.....
.....
for many different button styles. Instead you should merge the
selectors and use cascading and allow default values to inherit like
this:
html {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 1em;
}
..button01,
..button02,
..button03,
..button04,
..button05,
..button06 {
color: #000000;
text-align: center;
cursor: pointer;
background-color: #B9C8D2;
text-decoration: none;
height: 15px;
line-height: 15px;
border: solid 1px #00557D;
position: absolute;
top: 50px;
}
..button01 { left: 10px; }
..button02 { left: 131px; }
..button03 { left: 252px; }
.....
..button01:hover,
..button02:hover,
..button03:hover,
..button04:hover,
..button05:hover,
..button06:hover {
background-color: #00557D;
}
The idea is to define font related stuff only in the root element
(html) and let the setting inherit to other elements. Then you
define all common settings for all buttons with a single rule block
where you just write all the selectors separated with comma. Then
you list the exceptions. The better selector you use, the less you
have to write.
But you should really fix the markup first.
http://validator.w3.org/
helps.
For example, I'd suggest using markup like
....
<div class="buttons">
<a href="xxx" id="b1">link 1 label</a>
<a href="yyy" id="b2">link 2 label</a>
</div>
(note that id values must be unique!) combined with style like
div.buttons a {
... /* all styles that apply to all buttons */
}
#b1 {
... /* exceptions for button 1 */
}
#b2 {
... /* exceptions for button 2 */
}
etc etc.
It's not that hard. If this all sounds unclear, then I'd suggest
reading the CSS selectors spec at
http://www.w3.org/TR/css3-selectors/
--
Mikko