About CSS
Posted by: adodupan
Date: August 23, 2011 04:30AM

userContent.css

::-moz-selection{
background-color: rgb(106, 149, 55) !important;
color: rgb(255, 255, 255) !important;
}

This code changes the color of the selected detail.
I try to use this code in the XUL file, but it does not work.

example.css and example.xul in example.jar

textbox::-moz-selection{
background-color: rgb(106, 149, 55) !important;
color: rgb(255, 255, 255) !important;
}

or

.example::-moz-selection{
background-color: rgb(106, 149, 55) !important;
color: rgb(255, 255, 255) !important;
}

with class="example"

Maybe someone knows what i am missing here?

Re: About CSS
Posted by: gordon451
Date: August 28, 2011 08:04PM

Hi adodupan -

I just ran your CSS past the jigsaw.W3C CSS validator. It's what I thought:
Quote

The pseudo-element ::-moz-selection can't appear here in the context css21 [-moz-selection]

OTOH, removing one of the ":" gives:
Quote

Unknown pseudo-element or pseudo-class :-moz-selection

Can't help you further without some more context.

Gordon.

____________________
Gigabyte H61M-USB3-B3 r2.0, I5-2400 3.10GHz, 4GB RAM; W7HPx64 SP1, Lotus SmartSuite 9.8, K-Meleon74, Opera 12.17, IE9, Eudora 6.2, Foxit Reader 5.3.1.0606, PaintShop Pro 6.02, Avast! 10.0.2206

____________________
Early to bed and early to rise makes a bloke crook, broke and stupid.

Re: About CSS
Posted by: adodupan
Date: August 29, 2011 04:52AM

Gordon,
The ::-moz-selection (::selection) pseudo-element applies to the portion of a document that has been highlighted (e.g. selected with the mouse) by the user.
Also read this.

Put this code in the file userChrome.css

::-moz-selection{
background-color: rgb(106, 149, 55) !important;
color: rgb(255, 255, 255) !important;
}

Effect:





Selected details are green.
I need the same effect in the xul file (in textbox). Any solution?

Guenter, please contact me via email.



Edited 1 time(s). Last edit at 08/30/2011 03:42AM by adodupan.

Re: About CSS
Posted by: guenter
Date: August 29, 2011 05:10AM

You have a mail with address from sterndaler/yahoo.com.
look also at http://kmeleon.sourceforge.net/forum/profile.php?1,5

I think that user.css has a bug.

Re: About CSS
Posted by: gordon451
Date: August 29, 2011 08:03PM

Hi adodupan -

Thanks for the context. I tried the snippet in my userContent.css, but it would only work on page text, not in text-boxes. (I do remember a thread in the Opera forums about getting css things to work in text-boxes, and it was not encouraging. Sometimes they would work! Half the problem is that inside the text-box is not actually part of the web page surprised smiley)

Having said that, I'm afraid that (for me) XUL is a little bit deeper than a parking-lot puddle -- I'm used to working on web pages rather than the innards of a browser tongue sticking out smiley -- although I cannot see any reason why well-formed script should not result in well-formed code which should work. It may get back to the text-box thing in the Opera forum I mentioned.

@Guenter - How would user.css have a bug? Or would that be in the browser itself?

Gordon.

____________________
Gigabyte H61M-USB3-B3 r2.0, I5-2400 3.10GHz, 4GB RAM; W7HPx64 SP1, Lotus SmartSuite 9.8, K-Meleon74, Opera 12.17, IE9, Eudora 6.2, Foxit Reader 5.3.1.0606, PaintShop Pro 6.02, Avast! 10.0.2206

____________________
Early to bed and early to rise makes a bloke crook, broke and stupid.

Re: About CSS
Posted by: guenter
Date: August 29, 2011 08:10PM

Quote
gordon451

@Guenter - How would user.css have a bug? Or would that be in the browser itself?

Yes a browser bug. I dimply remember that there was a problem.

Attachments: example2.png (26.1 KB)  
Re: About CSS
Posted by: adodupan
Date: August 29, 2011 11:24PM

Guys, thanks for the help.
This code is obviously not working, i'll have to look for a another way.

Guenter, can you download images (example1,2.png) from their current location and attach them to the About CSS topic?
If you can, please, do it.



Edited 2 time(s). Last edit at 08/30/2011 03:44AM by adodupan.

Attachments: example1.png (26 KB)  
Re: About CSS
Posted by: guenter
Date: August 30, 2011 02:18AM

Done.

I wonder why Phorum did not let me attach both pictures to a single post? sad smiley

They were small enough AFAIK.



Edited 2 time(s). Last edit at 08/30/2011 02:23AM by guenter.

Re: About CSS
Posted by: gordon451
Date: August 30, 2011 03:23PM

Ta-DAAAAA! Found it! smiling smiley

OK. It's a My.Opera forum, but the message is the same. Look in here.

The basics are that "...form elements are undefined in the W3C CSS2.1 specification." and "All input form elements are "boxes", but only defined by the User Agent. This means that these boxes are not accessible to the CSS renderer, and their treatment is not defined in the CSS specs (at least at v2.1...)".

But read the full post for the gory details.

Gordon.

____________________
Gigabyte H61M-USB3-B3 r2.0, I5-2400 3.10GHz, 4GB RAM; W7HPx64 SP1, Lotus SmartSuite 9.8, K-Meleon74, Opera 12.17, IE9, Eudora 6.2, Foxit Reader 5.3.1.0606, PaintShop Pro 6.02, Avast! 10.0.2206

____________________
Early to bed and early to rise makes a bloke crook, broke and stupid.

Re: About CSS
Posted by: adodupan
Date: August 31, 2011 12:25PM

Hey gordon, your Ta-DAAAAA! is worth more than a solution to this sel-problem :)
Some links are useful (opera forum). Thank you.

K-Meleon forum is powered by Phorum.