Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to create a multicolored href tag

Posted on 2013-01-16
3
Medium Priority
?
221 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 1600 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
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 …
Suggested Courses
Course of the Month21 days, 3 hours left to enroll

810 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