Page 1 of 1

TEXT SELECTION QUESTION

Posted: Wed Mar 21, 2007 2:13 pm
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

Re: TEXT SELECTION QUESTION

Posted: Wed Mar 21, 2007 3:21 pm
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.

Re: TEXT SELECTION QUESTION

Posted: Wed Mar 21, 2007 3:26 pm
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

Re: TEXT SELECTION QUESTION

Posted: Thu Mar 22, 2007 7:41 am
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

Re: TEXT SELECTION QUESTION

Posted: Thu Mar 22, 2007 12:07 pm
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.

Re: TEXT SELECTION QUESTION

Posted: Fri Mar 23, 2007 7:02 am
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

Re: TEXT SELECTION QUESTION

Posted: Fri Mar 23, 2007 12:45 pm
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.