|
Posted by Andrι Gillibert on 11/10/07 17:06
Mark wrote about a top margin of h2 and a bottom margin of p:
> However, for some reason, IE5 and IE6 do not apply this margin, so the
> text is directly adjacent to the subnav and the footer.
Why would it? You didn't specify any H2 or P margin in your CSS. The CSS
recommandation doesn't require any specific default (or user) CSS.
> Is this because I have done something to trigget an IE bug?
No, there're no bug involved here. However, it doesn't matter much. If you
*really* want to have the same layout in all browsers (without user CSS),
then, you should explicitly specify margins.
> I have given mbody a minimum height to prevent the container from
> becoming too short on pages with sparse content.
But you fixed the height to 300px.
To avoid problems, use 'min-height', not 'height'.
(IE may not support it, because IE isn't conforming to the CSS
recommandation)
>
> Finally, I saw this technique somewhere as a way to have a graphical
> logo while still having a h1 element for SEO purposes:
>
> <h1><a href="homepage"><span>My company name</span></a></h1>
>
> You put display:block on the a, give it a fixed pixel width to match
> your logo image, then use the logo as a background for the a element.
> You then put a display:none on the a span to hide the text.
>
It's a CSS hack. Typical of people who think that author's CSS (without
user CSS) is the only way to see/render/use HTML documents.
As all CSS hacks, it works only for two or three extremely specific cases,
but is broken in the general case.
For example, when I activate one of the accessibility layout user CSS of
my browser (Opera), background images are disabled (by an !important rule)
so that I see a hole in place of your logo.
Is it a SEO? Not sure, but I could think that some hypotetical search
engine could give a low rank to background images as they're decorations,
but not part of the content of a site. A CSS-unaware search engine may
simply ignore the image as it's not contained in the HTML code.
To be SE friendly, please, just write normal non-obfuscated HTML code, as
people did before SE existed. SE were designed to work with existing code.
No need to adopt a specific coding style (but POSH) to be viewed by SE.
Logically, the logo isn't a background image, it's part of the content of
the page, so you should specify it as an image, with the IMG element.
e.g. Use:
<h1><img src="path/to/logo" alt="My company name"></h1>
Most of the problems are due to the fact that you lie by claiming it's a
background image.
> As well as this, I've noticed that some sites use text-indent: -9999px
> on the span instead of display:none but this has the side effect that
> the dotted border you get when clicking the logo in Firefox stretches
> all the way to the left edge of the viewport (although the hotspot is
> still constrained to the image).
The text-indent hack surely is much worse.
--
If you've a question that doesn't belong to Usenet, contact me at
<tabkanDELETETHISnaz@yahoDELETETHATo.fr>
[Back to original message]
|