LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-12-2012, 04:38 AM   #1
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: Arch + X.org + IceWM
Posts: 1,204

Rep: Reputation: Disabled
Local CSS file in Firefox


Hi. I want to change fonts on some websites for me in Firefox. I created userContent.css file and then I go to some page, open css file and take class of "p" or "div". Then I write a rule for this in userContent.css. For example page http://www.osnews.com/ . It has

Code:
<div class="newscontent1">				
  <a href="/topics/9"><img src="http://www.osnews.com/images/icons/9.gif" alt="Linux" align="left" class="timg" title="Linux" /></a>
  Here's a topic guaranteed to start controversy. Which Linux distribution is best? It all depends on your criteria for judging. Even then the topic is highly subjective. Here are a few nominees for "best distro" in specific categories.
</div>
I want to change font in this class so I add to userContent.css:

Code:
.newscontent1 {
  font-family: mono;
}
saved changes and reloaded OSNews page. No changes on the page... I read some local CSS examples and they look as simple as I did. And AFAIK local CSS file has higher privileges than remote. Mine doesn't work. What am I doing wrong?

Last edited by Mr. Alex; 11-12-2012 at 07:32 AM.
 
Old 11-12-2012, 06:19 AM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,245

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
This style is set by webmaster as "important", so to override you also need to set it "important" (to be more than webmaster's), like that:
Code:
.newscontent1 {
  font-family: mono !important;
}
 
1 members found this post helpful.
Old 11-12-2012, 06:47 AM   #3
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 656

Rep: Reputation: 160Reputation: 160
When you reload the page, the persistent information seems to override your CSS- as it should . This is expected behaviour and anyway local css lasts only for the current session.

OK
 
Old 11-12-2012, 07:40 AM   #4
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: Arch + X.org + IceWM
Posts: 1,204

Original Poster
Rep: Reputation: Disabled
Thumbs up Solved

eSelix, thanks, solved.
Is there a way to specify particular website for which the rule must be applied (and for no other)?
Some websites just have "<p></p>" without class or anything else unique.

Last edited by Mr. Alex; 11-12-2012 at 07:56 AM.
 
Old 11-12-2012, 11:34 AM   #5
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,245

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Yes, you can write your rules inside this special syntax
Code:
@-moz-document url-prefix("http://somesite.com/")
  {
  p
    {
    font-family: my-better-font !important;
    }
  }
Instead "url-prefix" (where taking into acoount are all addresses started with specified text) you can use "domain" (so only domain need to match), "url" (where exact address must match) or "regexp" to specify regular expression.
 
1 members found this post helpful.
  


Reply

Tags
css, firefox, fonts, local


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Making GTK3 themes – Part 2: The gtk.css and gtk-widgets.css file LXer Syndicated Linux News 0 07-24-2012 02:50 PM
[SOLVED] Browsing for local file segfaults Firefox wpost Linux - Software 1 05-06-2012 06:50 PM
Firefox 2.0 not rendering CSS correctly jaycam Linux - Newbie 4 05-08-2008 09:08 PM
Firefox font issue when css px is used instead of pt arobinson74 Linux - Software 0 11-14-2006 05:47 PM
Limited CSS support in firefox? NonSumPisces Linux - Software 5 07-06-2004 09:16 PM


All times are GMT -5. The time now is 01:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration