Solved

How to create a multicolored href tag

Posted on 2013-01-16
3
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Find out what you should include to make the best professional email signature for your organization.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

734 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