Solved

I need to change the color of a label

Posted on 2008-10-19
4
150 Views
Last Modified: 2012-05-05
I am using the following code to hide then show text, and I have both "Read More" and "Read Less" tags to help the user navigate.  But I find it difficult to differentiate them.

Can someone show me how to make them have different colors??

Thanks,
newbieweb

<a href="#" onclick="var block=document.getElementById('FullTextPaymentTerms');
this.innerHTML=(block.style.display=='none')?'... Read Less':'... Read More';
block.style.display=(block.style.display=='none')?'':'none';return false;">... Read More</a></FONT></P>

0
Comment
Question by:newbieweb
[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
  • 3
4 Comments
 
LVL 10

Expert Comment

by:Phatzer
ID: 22753122
This should work...
<style type="text/css">
.readmore { color: red; }
.readless { color: blue; }
</style>
 
<a href="#" onclick="var block=document.getElementById('FullTextPaymentTerms');
this.innerHTML=(block.style.display=='none')?'<span class=\'readless\'>... Read Less</span>':'<span class=\'readmore\'>... Read More</span>';
block.style.display=(block.style.display=='none')?'':'none';return false;"><span class=\'readmore\'>... Read More</a></FONT></P>

Open in new window

0
 
LVL 10

Expert Comment

by:Phatzer
ID: 22753144
Sorry, this should be better:

<a href="#" onclick="var block=document.getElementById('FullTextPaymentTerms');
this.innerHTML=(block.style.display=='none')?'<span class=\'readless\'>... Read Less</span>':'<span class=\'readmore\'>... Read More</span>';
block.style.display=(block.style.display=='none')?'':'none';return false;"><span class="readmore">... Read More</a></FONT></P>

Tell me how that goes.
0
 

Author Comment

by:newbieweb
ID: 22753149
I forgot to tell you.  This is for an eBay ad and they do not give me access to the header of the HTML file, just the body.

Could you do this in-line?

thanks,
newbieweb
0
 
LVL 10

Accepted Solution

by:
Phatzer earned 500 total points
ID: 22753155
Sure you can, means you'll need to change the CSS for '... Read more' twice though.

<a href="#" onclick="var block=document.getElementById('FullTextPaymentTerms');
this.innerHTML=(block.style.display=='none')?'<span style=\'color: red;\'>... Read Less</span>':'<span style=\'color: blue;\'>... Read More</span>';
block.style.display=(block.style.display=='none')?'':'none';return false;"><span style="color: blue;">... Read More<span></a></FONT></P>
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Text too large in Chrome 17 83
Html split(text) 2 49
center text in div with CSS3 2 30
Sticking text to shapes in Raphael.js 6 41
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.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

738 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