?
Solved

How to create a multicolored href tag

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
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 learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses

762 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