K-Meleon

Cascading Style Sheets (CSS) control how a web page looks. Nearly all web designers use CSS. K-Meleon lets users change how a page looks on their own computer with user stylesheets. These do not affect the content (HTML) or the scripting, only the page's appearance. K-Meleon offers several ways to implement user stylesheets.

Creating a user stylesheet

The simplest way to create a user stylesheet is:

  1. Go to Edit > Configuration > User-Defined Stylesheet to open userContent.css in a text editor. (Everything between the /* */ is a comment and will not affect web pages. By default, your CSS file should only contain comments.)
  2. Copy and paste CSS code into the usercontent.css file.
  3. Save the file.
  4. Restart K-Meleon.
  5. Your CSS rules will apply to all sites you visit now.


Recommended method

The recommended way is to use K-Meleon's ad-blocking stylesheet. The only difference between adblock.css and userContent.css is the ad-blocking stylesheet can be toggled on and off. The steps are almost the same. To use the ad-blocking stylesheet:

  1. Go to Edit > Configuration > Ad-Blocking Stylesheet to open 'adblock.cssin a text editor.
  2. To delete any existing CSS code select all (Ctrl+A) text and press Delete.
  3. Copy and paste CSS code into the adblock.css file.
  4. Save the file.
  5. Restart K-Meleon.
  6. Toggle your stylesheet by going to Tools > Privacy > Block Advertisement in the main menu, creating a toolbar button, or making a keyboard shortcut.


Keyboard shortcut

To create a keyboard shortcut:

  1. Go to Edit > Configuration > Accelerators to open accel.cfg in a text editor.
  2. Copy and paste the code below at the end of the file, save the file, and restart K-Meleon:

# Toggle user stylesheet.
CTRL SHIFT U = macros(KM_ToggleAdblock)


Toolbar button

There are several ways to create a button to toggle the ad-blocking stylesheet. The quickest way is to add it to the privacy bar:

  1. Go to Edit > Configuration > Toolbars to open toolbar.cfg in a text editor.
  2. Find (Ctrl+F) the Privacy Bar section of the config file.
  3. You should see a list of similar entries like Cookies and Java that the privacy bar can block.
  4. Copy and paste the code below between these to create a new entry. Then, Save adblock.css, restart K-Meleon, and activate the privacy bar's toolbar at View > Toolbars > Privacy Bar.

        !User CSS{
        macros(KM_ToggleAdblock)
        Turn on the user stylesheet.
        check.png[0,32,32]
        }

Stylesheets

Cookie warnings

Cookie warnings pop up on most websites today. Current regulations require websites to notify you of their use of cookies. If you block or clear cookies, websites will show you these popups every single time. Daniel Kladnik's extension I Don't Care About Cookies will hide most of these popups. You can use the extension's CSS without the extension itself:

To hide cookie warnings, just copy and paste the CSS rules from I Don't Care About Cookies into your stylesheet.

Banner Ads

User stylesheets can hide some types of ads like banners. Most ads now use more complex scripting, so this technique makes more sense if you are browsing with javascript disabled or using an extension like NoScript to whitelist scripts. There are several online CSS files to hide ads. You can use any of these in K-Meleon, and even combine them into your adblock.css:

On the K-Meleon wiki


For more stylesheets, please check the styles repository at this link: http://userstyles.org

K-Meleon

(c) 2000-2010 kmeleonbrowser.org. All rights reserved.
design by splif.