How to write a word in two colours?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
On 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:

   <i><span class="makepp">make</span>pp</i>

The drawback is that Google doesn't count this as one word, and hence rates
this page lower than other pages (like the outdated, containing just "makepp" :-(  So I want to do
this like

   <i class="makepp">makepp</i>

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"; }

   <i class="ucmakepp"><span class="hide">Makepp</span></i>
   <i class="makepp"><span class="hide">makepp</span></i>

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?

Daniel Pfeiffer skrev:
Quoted text here. Click to load it

Fine, use that construct.

Quoted text here. Click to load it

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 <i><span class="makepp">make</span>pp</i> construct will work just

Re: How to write a word in two colours?

la 09.06.2007 14:27 Roy A. skribis:
Quoted text here. Click to load it

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

Site Timeline