Solved

How to create a multicolored href tag

Posted on 2013-01-16
3
209 Views
Last Modified: 2013-03-19
I used the following to create 4-color menu item on a PHP page on website Panachallenge.com.

What is an elegant way to reduce this code to one href instead of four and still retain separate color control for each word? Also the words should appear with no spaces between them, like this HelpKeepUsOnline. On the site there are spaces.

echo "&nbsp; &#183; &nbsp;\n" . "<a href='/paypal/donate.php' class='menu'  style='color: #00FF33'>Help</a>\n" .  "<a href='/paypal/donate.php' class='menu'  style='color: #33CC00'>Keep</a>\n" . "<a href='/paypal/donate.php' class='menu'  style='color: #00FF33'>Us</a>\n" . "<a href='/paypal/donate.php' class='menu'  style='color: #33CC00'>Online</a>\n";
0
Comment
Question by:adande3
  • 2
3 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38785031
<a href='/paypal/donate.php' class='menu'><span style='color: #00ff33'>Help</span><span style=color: #33cc00'>Keep</span><span style=color: #00ff33'>Us</span><span style=color: #33cc00'>Online</span></a>

Cd&
0
 

Author Comment

by:adande3
ID: 38785204
<a href='/paypal/donate.php' class='menu'><span style='color: #00ff33'>Help</span><span style='color: #33cc00'>Keep</span><span style='color: #00ff33'>Us</span><span style='color: #33cc00'>Online</span></a>

The above is the corrected code. There were three missing single quotes in the code posted by COBOLdinosaur.

COBOLdinosaur - please edit your solution to include the missing three apostrophes so I can give you the full 400 points. Thanks so much for your quick response!
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 400 total points
ID: 38787733
A comment can't be edited after another comment is posted, so I'll just re-post with the single quotes.

<a href='/paypal/donate.php' class='menu'><span style='color: #00ff33'>Help</span><span style='color: #33cc00'>Keep</span><span style='color: #00ff33'>Us</span><span style='color: #33cc00'>Online</span></a>


BTW, points as a motivator is overrated.  Experts who have been here a long time quit worrying about them after hitting about 100,000 and finding out you can't buy beer with them. ;^)

Cd&
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now