Solved

How to create a multicolored href tag

Posted on 2013-01-16
3
211 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Make Line Items Look Good Over Mobile 2 52
I wonder how people fake their ip address? 3 34
Html test in IIS 4 20
how to use a switch statement with heredoc 11 17
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

815 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

11 Experts available now in Live!

Get 1:1 Help Now