How to write a word in two colours?

  • Thread starter Daniel Pfeiffer
  • Start date
D

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:

<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
makepp.sourceforge.net/1.19/), 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
 
R

Roy A.

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:

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

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

Daniel Pfeiffer

la 09.06.2007 14:27 Roy A. skribis:
Daniel Pfeiffer skrev:

Fine, use that construct.


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top