Welcome to WebmasterWorld Guest from 35.172.195.49

Forum Moderators: open

Message Too Old, No Replies

userContent.css styles for a specific domain

Getting latest declaration to work.

     
9:59 pm on May 22, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 29, 2003
posts:1676
votes: 0


I have been calling for styles for a specific page of a specific website. No problem so far.

Now - I am adding styles for a specific domain of another site. The first still works, but the second does not.

Where have I slipped up? What to do?

@-moz-document url(https://www.example.com/decrypt.php) {
div, p {
background-color: #fff;
}
p {
font-size: 180%!important; line-height: 170%;
}
}
@-moz-document url(http://www.example.com) {
body {
background-color: #000!important;
}
}

2:00 am on May 28, 2006 (gmt 0)

Senior Member from CA 

WebmasterWorld Senior Member encyclo is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 31, 2003
posts:9074
votes: 6


I believe using
@-moz-document url
will only affect the specific page, so if you ask for just the domain without the obligatory trailing slash, it won't work even for just the home page.

You should try specifying the rule for the whole domain:

@-moz-document [b]domain[/b](example.com) {

Or you can use the

url-prefix
syntax instead:

@-moz-document [b]url-prefix[/b](http://www.example.com/) {

The difference between the two is that the first will cover the domain and all subdomains too, whilst the second only for the specific prefix.

Hope that helps!

2:31 pm on May 28, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 29, 2003
posts:1676
votes: 0


I believe using @-moz-document url will only affect the specific page, so if you ask for just the domain without the obligatory trailing slash, it won't work even for just the home page.

Thanks. Although I had wound up trying inumberable combinations unsuccessfully, in this case I think that the trailing slash was the start of going off track. After a little more jiggering, all userContent.css declarations are now working. We have a couple for specific pages, and another for an entire domain.

I first started using userContent.css to help with the retrieval of submitted form data that we use a third party service for. The results are provided in an XXsmall font-size. It's not a problem to bump up the font-size in the browser, but often we want to print these results; and it would be nice if we could read them as well:)) This has been a good way of forcing the font-size to something that is both readable, and printable.

What are some good resources for learning a bit more about this? I originally had a surprisingly difficult time finding very much.