How to write a word in two colours?
am 08.06.2007 00:16:04 von Daniel Pfeiffer
On http://makepp.sourceforge.net/1.50/ i try to make the first four letters of
makepp (Perl-ish) blue, so as to match the logo a little. What succeeds
nicely is this:
makepp
The drawback is that Google doesn't count this as one word, and hence rates
this page lower than other pages (like the outdated
makepp.sourceforge.net/1.19/), containing just "makepp" :-( So I want to do
this like
makepp
such that the word is there even without CSS. Ideally I'd like
.makepp:first-letter(4) { color: #0090e0; }
For apparent lack of such a feature I tried nested class application:
.hide { display: none; }
.ucmakepp:before { content: "Make"; color: #0090e0; }
.makepp:before { content: "make"; color: #0090e0; }
.ucmakepp:after, .makepp:after { content: "pp"; }
Makepp
makepp
This works nicely, but it's very cludgy, and Google might still notice I'm
hiding the word.
The cleanest approach seems a reverse overlap:
.makepp { color: #0090e0; }
.makepp:after { content: "pp"; color: black; position: relative; z-index:
1; left: -2em; }
But it varies with browsers, neither relative nor absolute work well, and I
seem to have to move back whatever the width of "pp" may be (certainly less
than 2em), rather than being able to say "keep the right edge here".
Is there any portable simple way of solving this?
thanks -- Daniel
Re: How to write a word in two colours?
am 09.06.2007 14:27:46 von royarneskar
Daniel Pfeiffer skrev:
> On http://makepp.sourceforge.net/1.50/ i try to make the first four letters of
> makepp (Perl-ish) blue, so as to match the logo a little. What succeeds
> nicely is this:
>
> makepp
Fine, use that construct.
> The drawback is that Google doesn't count this as one word, and hence rates
> this page lower than other pages ...
You're just assuming that? I believe Google is counting that as one
word. Just try it yourself. I've tried it, an it seems to be true. I
also believe it's true for all other search engines.
Span is an inline element. I think search engines is removing inline
tags before indexing your site. After all you can search for sentences
with bold text inside.
The makepp construct will work just
fine.
Re: How to write a word in two colours?
am 10.06.2007 21:09:57 von Daniel Pfeiffer
la 09.06.2007 14:27 Roy A. skribis:
> Daniel Pfeiffer skrev:
>> On http://makepp.sourceforge.net/1.50/ i try to make the first four letters of
>> makepp (Perl-ish) blue, so as to match the logo a little. What succeeds
>> nicely is this:
>>
>> makepp
>
> Fine, use that construct.
>
>> The drawback is that Google doesn't count this as one word, and hence rates
>> this page lower than other pages ...
>
> You're just assuming that? I believe Google is counting that as one
> word. Just try it yourself. I've tried it, an it seems to be true. I
> also believe it's true for all other search engines.
Yes, I'm assuming that because the far shorter 1.19 (with less mentions of
makepp, but which don't have this fancy markup) documentation is Google's
preferred result.
Btw. I have a sitemap to get the priorities right, and it's referenced in
robots.txt, but Google doesn't pick it up. Instead they want me to register a
Gmail account, to be able to tell them I have a sitemap :-(((
best regards
Daniel