TEXT SELECTION QUESTION

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Locked
kovver

TEXT SELECTION QUESTION

Post by kovver »

Hello,

does anyone know how to make the following trick happen:

I want, when i select a part of the content text with the cursor, only the text to change color, while leaving the background the same? how is this done?

thanks in advance!

David - www.kovver.com - www.anthros.net
heatherfeuer

Re: TEXT SELECTION QUESTION

Post by heatherfeuer »

Your wysiwyg editor should have a button to change text color.  Select the text you want to have in a different color.  While the text is highlighted click on the tool button and select the color you want.  This will change text color only on the fly.

In FCKEditor, the icon is a T with a color bar.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: TEXT SELECTION QUESTION

Post by RonnyK »

I thought he meant when the text was selected in the browser!

The span-element can be used to style parts of paragraphs differently through CSS.


Ronny
kovver

Re: TEXT SELECTION QUESTION

Post by kovver »

RonnyK wrote: I thought he meant when the text was selected in the browser!

The span-element can be used to style parts of paragraphs differently through CSS.


Ronny
thanks ronny, thats what i ment. but can you give me an example in css code...

maybe for www.kovver.com

thanks in advance!
David
heatherfeuer

Re: TEXT SELECTION QUESTION

Post by heatherfeuer »

I'm sorry I misunderstood.  The only way I know of  to do what you want is using javascript in conjunction with your css style.  So you would have a css class called ".select" that might look like this:

Code: Select all

.select {
background-color: inherit;
color: blue;
}
Then you would need to add a little javascript that would look like this:
some text some text

I'd have to open Dreamweaver and work with it to get the right code for the event, but it is doable.
kovver

Re: TEXT SELECTION QUESTION

Post by kovver »

i want to ipplement it in a cmsms design. should the javascript be put in the main template? and how would the javascript look like?? because i want this trick to happen on all selected text in browser.

for example like in here were you select text under the image!!!:

http://www.younggogetter.com/2007/01/22 ... galleries/

how??? please.

thanks,

David - www.kovver.com
Last edited by kovver on Fri Mar 23, 2007 7:12 am, edited 1 time in total.
heatherfeuer

Re: TEXT SELECTION QUESTION

Post by heatherfeuer »

I'm sorry, but I can't help you there.  I suspect that if you searched around on the net, you'd find the javascript code.  Or perhaps email the person who owns that website.  I use wordpress for my journal, when I have a moment I'll have to check and see if that's a wordpress plugin.
Locked

Return to “Layout and Design (CSS & HTML)”