corner Document Styles: [BBL] A+ A- A corner
 

Customize Your Web, Stylishly

Table of Contents

Are You Prepared?

Stylish

Stylish is a Mozilla Firefox extension which allows easy installation, management and authoring of userstyles.

Userstyles

Userstyles are Cascading Style Sheet (CSS) rules which change the appearance of webpages in your web browser. Userstyles can be written and used in most modern web browsers, including Google Chrome (Chromium), Firefox, Safari, Internet Explorer (IE), Opera, and anything based upon Mozilla.

screenshot K-Meleon is a Mozilla based web browser, and can use userContent.css. You can write userstyles in Mozilla-based browsers, so long as you know what types of CSS the browser understands. K-Meleon can read CSS Level 2.

 

Is Stylish Installed?

Stylish doesn't appear to be installed, but this text will always be shown unless JavaScript is enabled, and you follow these instructions:

Firefox
screenshot
Access your about:config page, and type "stylish" in the Filter box.
Right-Click the line: extensions.stylish.install.allowedDomains
Select, "Modify".
screenshot
Keep the value already there. Add a space, for separation, and add honestlyillustrated.com after it.
Do not include "www." or any sub-domain.
Click, "Ok".
 
Others

In a Mozilla based web browser where Stylish has been installed, you may attempt the Firefox instructions given above. Otherwise, simply continue reading the document to learn about userstyles.

Prerequisite Knowledge Top of this page.

Authoring userstyles, with or without the Stylish Firefox extension, is not particularly easy. Doing so without knowledge of the web design concepts involved will be incredibly difficult. This tutorial does not assume you are fully studied in all of the web design technologies. If you become confused while learning to userstyle with Stylish Firefox extension, refer to this section of the tutorial to find the definitive texts in these subjects.

Cascading Stylesheets:
CSS: Cascading Stylesheets (CSS) is a method of defining rules for display behavior in a markup document like HTML web pages.
Don't Make Me Think
Usable designs for normal people who want to use them. This book gives visual examples and easy explanations that help you undo what web designers are doing wrong.
CSS: The Missing Manual
Essential tutorials explaining new CSS properties and what you can do with them. Learn to easily make sophisticated interfaces, with the correct CSS for each job.
The Web Designer's Idea Book
Themes, trends, and styles; the best of over 20,000 websites. A showcase of some of the most creative website designs available, presented beautifully, for you to browse when you need inspiration for what to do next.
Beginning HTML5 and CSS3
Stay ahead of the game with this comprehensive introduction to the next wave of web design technologies.
Document Object Model:
DOM: Document Object Model (DOM) is a program memory structure into which a markup document is loaded by a browser. It's what allows CSS and JavaScript to easily influence the page, dynamically.
Markup Languages:
HTML: Hypertext Markup Language (HTML) is the most common markup found in the Web. It defines the structure of a document telling software how to load the data into DOM, and provides named nodes which software may use to select pieces of the document data.
XML: Extensible Markup Language (XML) is used to describe data structures, and is paired with XSLT (extensible stylesheet language transformations) which describes the XML tags with which you are describing data relationships.
XHTML: Extensible Hypertext Markup Language (XHTML) is a type of HTML which uses XML to define HTML, forcing HTML to be written as HTML is supposed to be.
XUL: Extensible User Interface Language (XUL) is an XML markup language which Mozilla Firefox uses to describe user interfaces.
Programming:
JavaScript: JavaScript (JS) is a programming language used in web sites to create interactivity, and is also used to build Mozilla Firefox, and Firefox Extensions. You need to know that userstyles are affected by JavaScript code present on the styled page(s). JavaScript is used to modify page content, which could include CSS.
Firefox Extensions:
Stylish: Stylish, a Mozilla Firefox extension, is the primary subject of this tutorial.
Greasemonkey: Similar to Stylish, Greasemonkey is a Mozilla Firefox extension which can be used to inject your own JavaScript into web pages when you view them in your web browser. This can change the behavior, style, and content of the pages. You can load userstyles as userscripts, so that you only require Greasemonkey to be installed in your Firefox profile.

Suggested Tools Top of this page.

  Firefox Extensions Which Integrate With Stylish:
These extensions share special features with Stylish, when installed alongside it.
DOM Inspector: Stylish adds a "Copy Selector" menu to DOMi's treeview context menu.
It's All Text: Provides an "Edit", or "It's All Text!", button next to multiline text input areas. Configurable to open a change monitored text file in system default or custom text editor. You will find such a button in the Stylish editor.
Rainbow Picker: A color picker, offering a color spectrum and palette.
Firefox Extensions:
These are useful when writing userstyles with Stylish Firefox extension.
Chrome List: Browse the current profile chrome directories.
Edit Config Files: A convenient toolbar menu with a list of the important configuration files, and the option for those files to be opened in your favorite text editor.
FireBug: Includes DOM node inspection, with many more relevant debugging features.
Inspect Context: Adds an "Inspect" item to all context menus (right-click), which invokes DOM Inspector for the node you have right-clicked.
Inspector Widget: This one provides a toolbar button which, when clicked, allows the next click to invoke DOM Inspector for the clicked GUI element. This is useful, since Inspect Context, doesn't put the menuitem into all context menus.
Quick Restart or Toolbar Buttons: Either of these, or one like them, include a "Restart" button and/or hot-key. These are "easy buttons" for applying changes to FireFox preferences.
Session Manager: Recover properly from crashes, returning to the entire set of previous open pages, after restart.
Web Developer Toolbar and XML Developer Toolbar: Offer many useful perspectives from which to investigate a page. Isolate the parts you're studying.
Text Editors:
When writing userstyles in Stylish Firefox extension, with It's All Text Firefox extension also installed, you may wish to use one of these text editors for editing your userstyle.
jEdit: Free/Open Source.
kDiff: Free/Open Source. Not an editor. This is used to observe differences in multiple file versions.
Metapad: Free/Open Source, Windows.
Nexus TextView: Free/Open Source, Windows.
NotePad++: Free/Open Source.
NotesPad: Free, Windows.
Programmer's Notepad: Free/Open Source. They also have a version of it written in Python.
Ultra-Edit 32: Commercial, Windows.
Vim: Free/Open Source.
Comparison of Text Editors: Wikipedia entry.
Web-Applications & Services:
Selectoracle: Given some CSS code, this translates the selectors into verbose English or Spanish sentences.

Mozilla's CSS Defaults Top of this page.

You will learn how Firefox renders GUI (they call it, "chrome") and pages, by studying the prerequisite knowledge. A key clue is how markup languages are given their default behaviors. Some of the behavior is hard-coded into the software, since it is efficient to do that for some things. There is, however, a set of CSS files which define style defaults.

The default *.css files are in your Firefox program directory.
They are Firefox resources.
"resource://" links do nothing when clicked, which is explained below. Right-click the links and select, "Copy Link Location", then open a new tab and paste it into the location bar.
The most important files are probably:
forms.css: Styles that draw form widgets.
html.css: What else?
quirk.css: Fall-back styles for attempting to properly render erroneous or non-standard syntax.
ua.css: User Agent styles. This is the meta-style. Along with its rules, it imports "html.css", "xul.css", and "quirk.css".
xul.css: XUL dialog and document window widget styles.
Eric Meyer has written two pages, relevant to this.
Really Undoing html.css
Fractionally Restoring html.css

CSS Basics Top of this page.

Cascading Stylesheets are given their name due to the ways they behave. A stylesheet defines the way in which some other document (an HTML file, in our case) should be rendered for display. In userstyles, we are using CSS to modify existing styles. This fact can immediately show you what is meant by, "cascading". Add to this understanding, the facts that web sites may define style inside the HTML document and inside the HTML tags, and in multiple separate stylesheets (as .css files). Also, remember that the web browser may use CSS to define the default size, shape, appearance, and behavior of HTML tags.

In this way, you may see that rules are needed to decide the effect of two or more styles targeting the same element of an HTML document. Sometimes it is inefficient to replace a previously defined style with an entirely separate new one. For that, CSS allows the style rules to stack upon each other in ways which may cause them to combine with or negate each other. This stacking behavior is influenced by the order in which CSS rules are read by the web browser, the complexity of the selector used to target the affected element(s), and other factors which you will discover in due time.

When written outside of the selected HTML tag, a CSS rule is formatted as is illustrated in the following diagram. When written inside of an HTML tag, the entire CSS rule is written on one line, the selector is omitted because the tag is already selected by the author, and the open/close curly brackets are replaced by the style="" attribute of the HTML tag.

CSS Rule Diagram

Example Style explains what each piece of a CSS rule is meant to do, and how to use them in Stylish userstyles.

Example Style Top of this page.

@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("userstyles.org"),
               url("http://blog.userstyles.org"),
               url-prefix("http://userstyles.org/forum")
{
  body
  {
    background: #999999 !important;
    color: #000000 !important;
  }
}

Whitespace is not consistent in most CSS or HTML code. The software which reads it is supposed to ignore whitespace. This is so that human writers of markup and style can use whitespace as their eyes demand, for legibility.

Most important are the { brackets }, ( parenthesis ), "double-quotes", and semi-colons; they are telling the parser where each statement is, and how to understand it.

Namespace

@namespace url(http://www.w3.org/1999/xhtml);
Part of: Example Style

You can see in section 6.1.1 of the CSS 3 Specification, that namespaces are used with selectors to explain different selector types, and to preserve the differences while mixing types in a single document. This is done so that we can do things like using XML inside of an HTML document, and then tell CSS how to style the XML differently than the HTML.

You can see this principle being used inside of Firefox, in xul.css. There are namespace declarations, such as:
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
@namespace html url("http://www.w3.org/1999/xhtml"); /* namespace for HTML elements */
@namespace xbl url("http://www.mozilla.org/xbl"); /* namespace for XBL elements */

There is no 'xul' prefix between '@namespace' and 'url()', so any selector without a namespace prefix will be in the XUL namespace. To define a selector as being in HTML or XBL namespace, you need only prefix the selector correctly.

@-moz-document

@-moz-document domain("userstyles.org"),
               url("http://blog.userstyles.org"),
               url-prefix("http://userstyles.org/forum")
Part of: Example Style

@-moz-document is a Mozilla Extension at-rule, used primarily in userstyles, which controls where a set of CSS rules are allowed to take effect. It takes a single parameter, which lets you select domains or subdomains. In CSS 3, there is still no way to do wildcard or negation on these. There can be multiple entries in the list, comma separated.

{
Part of: Example Style

Opens the document style.

Selectors Top of this page.

  body
Part of: Example Style

"body", is the node selector for applying this rule set. In this case, the <body> HTML tag is selected. Remember selector namespacing when choosing selectors in a document which may have multiple namespaces, and be sure you know which default namespace you are working in. Typically, in userstyles, we are working only in HTML and XUL namespaces. However, we do have to declare which one we are using; at the top of every userstyle sheet.

For IDs, use #someid, for Classes, use .someclass.
[class="someid"]or [id="someid"] Will be useful to remember, when someone (Google GMail) has used RFC Invalid ID and Class naming.

Example tag: <input id="before-screenshot-none" name="before screenshot" type="radio" value=""></input>
See it in DOM, in this screenshot, on the rightside.
You could select such a node (tag) like this:

input[id="before-screenshot-none"] Has to be an input with an id of before-screenshot-none.
[id="before-screenshot-none"] Any with that id.
#before-screenshot-none Same as [id="before-screenshot-none"] in meaning, but if they appeared together, applied to the same page (even if in separate files), CSS considers #before-screenshot-none to be more important, so uses it. That's called precedence.
[id] Anything with an id.
input Any inputs.
[id$="screenshot-none"] Any id that ends with screenshot-none.
[id$="before"] Any id that starts with before.
[id*="screenshot"] Any id that contains screenshot.
#before-screenshot-none[type] Needs that id, and any type attribute.

On the left side of the screenshot, a bit below the input, there's a tr with a th and td. The th and td are direct descentdants (child nodes) of the tr.
You can use tr > td to select any td with a tr direct parent, or tr span to select any span children with a tr parent.
tr span label That would select any labels that have a tr then span parent.
tr>span > label This wouldnt select the label in the screenshot since i didnt include the td.
th + td To select adjacent siblings.

To use adjacent siblings correctly, you must pay attention to the nesting order of the tags. In CSS, adjacent means "directly above or below this tag, at the same nesting depth." So, table rows are not adjacent to their children table cells. Table rows, <tr>, are adjacent to other table rows.

Then there's pseudo-classes, such as in: th:first-child+td which selects a td if there's a th just above it that is the first child node of its parent (In the screenshot, "#text" is not a node/tag, it is showing that there is text content in the node, relative to where DOMi is printing the "#text" place-holder).


:before
:after
:only-child If you notice on a webpage html is the parent for body and head. :only-child wont select either of them since body and head are siblings of each other.
:first-line
:first-letter
:empty Doesnt have any children or content.
:hover Mouseover.
:active Clicked, then released (or dragged).
:focus Accepting input, the keyboard cursor is inside it.
:-moz-any-link Any links (-moz prefix is often used in Mozilla Extentions of CSS).
:link An anchor tag, which has an "href", Hyper-Reference, property.
:visited Visited links.
* Everything.

[id]:not(input) Anything with an id but not inputs. This is a special pseudo-class, called negation. :not(.someclass) :not([type="blah"]) :not(:first-child)
a[href^="javascript:"]:not([href^="javascript:if\(confirm\(\"You"]):after The \ back-slashes escape the characters after them, because they are part of the content of the selector, instead of part of the selector syntax, CSS needs to be told that in this way. As is usual with back-slash escaping, two of them, "\\", will mean one actual \.

Selector Specificity Top of this page.

Selector specificity is a numeric ranking of the selector used to target an entity, so that more specific selectors take precedence over less specific ones. This can be used in userstyles when you want to make minor modifications to an existing userstyle, without replicating the entire CSS in yours.

In such a case, you are creating an, "addon userstyle", where your new userstyle is an, "addon", to the original, meaning that both userstyles must be loaded in a browser to produce the desired effect. The addon userstyle must use more specific selectors than the original, so that the addon rules apply on top of the originals rather than some other way.

For instance, if the style you wish to modify looks like this:

@-moz-document url("") {

  body {
    background: #FFF !important;
    color: #000 !important;
  }

  .someclass {
    color: #F00 !important;
    font-style: bold !important;
  }

  .someotherclass { color: #113377 !important; }

}

Then presume we want an addon style to change only body, to give it a black background and white text, but we want to keep any other rules of the original userstyle. We would do so like this:

@-moz-document url("") {

  html > body {
    background: #000 !important;
    color: #FFF !important;
  }

}

This works because in HTML namespace, a body node is always the child of the html node. Similarly, we can change any other piece of the already existing userstyle, such as the .someclass rule, by prefixing a selector with body, like this:

@-moz-document url("") {

  body .someclass { color: #00F !important; }

}

This works if the original userstyle was written like our example, using only .someclass, and not some more specific selector, because in HTML namespace, every node of the document is a descendant of the body node. Creating addon userstyles may put you in a situation of needing to override a selector which already uses the specificity principle, such as in:

@-moz-document url("") {

  html > body { background-color: #ccc !important; }

}

To affect a selector such as this, you may need to use the :root psuedo-selector, like this:

@-moz-document url("") {

  html:root > body { background-color: #000 !important; }

}

This works because while the html node does not have any ancestors for you to select, it is the root node in HTML namespace, and the :root psuedo-selector is used to add specificity in this case.

Here are some other ways you might increase specificity of your selectors:

.message
div.message // assuming the original html code was <div class="message">
body .message
body div.message
html body .message
html body div.message
html body:not([imaginary_tag_attribute]) div.message // a body node does not have imaginary_tag_attribute=""

In any userstyle, you must match or exceed the specificity of the original CSS. Existing properties must be overwritten or negated, if you don't want them involved in the result, and the selector ancestry syntax ( spaces, > or + ) must usually match or beat the original.

While writing an addon userstyle, with the original userstyle also loaded, Stylish's userstyle load order may trick you, making you think you've gotten the selector specificity right. Stylish reads loaded userstyles from top to bottom, in order of the time they were loaded, so new styles have natural priority over older ones. This is the same principle as load order of .css files when writing web pages.

  {
Part of: Example Style

The selector is finished, we now begin to list the property values which form the actual styles applied to the given selector(s).

Properties Top of this page.

    background: #999999 !important;
    color: #000000 !important;
Part of: Example Style

This is a simple rule with two property declarations, changing the background color to grey and the text color to black. "#999999" and "#000000" are hexadecimal color values. "!important", forces a property to be chosen instead of a previous one of matching specificity. !important properties override non-!important ones, and is key in userstyling. Every property you write should end with "!important;".

background is a shorthand property which can combine all of the separate background-* property values.

    background-image: url("http://website.com/picture.png") !important;
    background-color: #000000 !important;

The above example, is equivalent to the following one:

    background: #000000 url("http://website.com/picture.png") !important;

You can embed image data into a CSS file using data URI. In the Stylish userstyle editor, to insert a data URI, write out the rest of the property declaration, like this:

    background-image: url() !important;

Place the keyboard cursor between the parenthesis, then at the top-left of the Stylish editor, click: Insert, Data URI. Select the file, and you're done. Stylish 0.5 userstyle editor would scroll to the top of the textarea when inserting a data URI, which is why you should write the rest of the property first.

The result will look similar to this:

    background-image: url(data:image/png;base64,iVBORw0Jggg==) !important;

You can use the chrome:// URI in property values, such as in:

    background: rgb(255,255,255) url("chrome://branding/content/about.png") top right no-repeat !important;

You may choose to write your color values as RGB decimals, hexadecimals, or english names.

  }
Part of: Example Style

Ends the properties list.

}
Part of: Example Style

Closes the document style.

Local Resources (files) in Firefox's Paths Top of this page.

chrome://

You can use Chrome List to find image resources you see in FireFox or extensions.

chrome://path/ These paths are somewhat relative to the user profile directory, but the "chrome" URI (Universal Resource Identifier) scheme is used because many of these files are being pulled directly from ZIP archives.

resource://

resource://gre/path/ These paths are relative to the program directory.

These paths are supposed to be restricted to local JavaScript space, with limited accessibility. The bug advisory suggests that, as always, such ideals are not guarantees. You can add files to these paths, but should limit those files to the same sort that are found there already. Namely, images and such.

file:///

file:///C:/path/to/file These are exactly what they look like. The extra / is required, so take note of it.

How NOT To Style Top of this page.

about:blank

Many Stylish userstyle authors seem to think that about:blank is only used for new/empty tabs. The assumption is false. About:blank is used in many places where an HTML DOM is needed, or where a place-holder is needed before a document loads (it is in all new tabs before the document loads).

About:blank is used by Web Developer Toolbar, "View Style Information".
screenshot screenshot screenshot

About:blank is used by NoScript, as a place holder for embedded objects.
screenshot screenshot

About:blank is on this page:

You should not put content on about:blank, with Greasemonkey, or place images on about:blank because it looks cool in new tabs. About:blank can appear anywhere, and it is not meant for that behavior. Doing these things can break or severely slow down anything built to use about:blank.

Frequently Asked Questions Top of this page.

These are answers to questions often asked about userstyling with Stylish.

CSS Color Values Top of this page.

Where a color value is needed, you can use words: black, lightblue, or any other CSS color name.

RGB: rgb(123,213,43)

  • Each decimal value can be in the range of 0 to 255.
  • The RGB decimal range is modeled on the human visible light spectrum. So, 0 is black, and 255 is white.
  • The numbers represent the amount of red, green, blue, to be added into an assumed black (0) original value. Distance from 0 determines light intensity. The three light colors are added together, providing a sum which is the result color. So, rgb(127,127,127) has nearly equal amounts of everything in it, and is the middle shade of grey. rgb(255,0,0) is the brightest red.

hexadecimal: #FFFFFF

  • hexadecimal colors are RGB colors, in hexadecimal representation, because hexadecimal is shorter than decimal, for long numbers.
  • The pattern is still RGB, so #FFFFFF = rgb(255,255,255) = FF FF FF
  • The # preceding these values is telling the software that the string is a hexadecimal number.
  • 0 is still 0, although it may be padded to 00.
  • 255 is FF.
  • 254 is FE. Notice, in relation to FF, all I did was subtract 1. In hex, F - 1 = E.
  • F, in decimal, is 15. 0 1 2 3 4 5 6 7 8 9 A B C D E F
  • In #FD, F is decimal 240, D is decimal 13, and FD as a total is 240 + 13 = 253
  • #0D = 13, #1D = 29, #1F = 31.
  • So, in #1F that is: (16 x 1) + 15 = 31
  • In #FD that is: (16 x 15) + 13 = 253
  • CSS lets you shorten hexadecimals like #FFFFFF, to #FFF
  • #999999 can be #999
  • #CCCCCC can be #CCC
  • #CCFF00 can be #CF0
  • This does not mean that #FF = #F, or #99 = #9. What's actually happening is the CSS specification states that web designers are lazy (they are), and as such, they should not be required to press a key twice, when once would suffice. The CSS parser, instead, must spend a processor cycle or three to find out that #FFF is #FFFFFF is rgb(255,255,255).
  • MoreCrayons has good web color information and tools.

Positioning Is Confusing Top of this page.

position Tell an element to behave as static, relative, absolute, or fixed.

top Distance from this edge of the parent node, to this edge of this node.

bottom ''

left ''

right ''

    position: fixed !important;
    top: 10% !important;
    right: 10ex !important;
    bottom: 5em !important;
    left: 50px !important;

Fixed means, "fixed on screen". Absolute means "position within the parent node". To force positioning to the bottom of a page, you often must use the size and positioning of other nodes above the target node, to force it to be pushed down.

A parent of an absolute positioned node, might stretch to let its child get attached to the given edge. That stretching, however, may change the floating, wrapping, padding, or positioning of the target node's siblings. This could mean that position:absolute;bottom:0; will end up being the bottom of the window at some stage of the page being drawn, and not the bottom of the page when it is finished drawing.

Read W3's explaination of positioning, with visual examples.

If a node is already set to "top", and you want it at the "bottom" use this to turn off "top":

    top:auto;
    bottom:5pt;

Can I use wildcards in @-moz-document?: Top of this page.

No, you can not use wildcards to do something like this:
@-moz-document url("http://honestlyillustrated.com/userstyles/stylishguide/*.html")
I don't like it either. I wish we could.
The closest you can get is by using:
@-moz-document url-prefix("http://honestlyillustrated.com/userstyles/stylishguide/")
@-moz-document url-prefix("http://honestlyillustrated.com/userstyles/")

Make my style change all pages?: Top of this page.

That's called a "global style".

  1. Begin with Click:"Stylish Icon" > Click:"Write Style" > Click:"Blank Style".
  2. In "Add Style" window, Click:"Insert" > Click:"HTML Namespace". Because I assume you're asking about website global styles.
  3. Write some style rules for whatever HTML tag you want.

If you write something like this:

body { background-color: black; }

Click the "!important" button, so it becomes this:

body { background-color: black !important; }

Don't use @-moz-document for global styling.

Replace an image with a local image?: Top of this page.

Read: Local Resources (files) in Firefox's Paths.
Choose the method, chrome://, file:///, or resource://, which makes the most sense to you, and works best for your style's goal.
File paths written as those URI, (as opposed to http://), are ways for Firefox to access files on your disk drive(s).

Style this thing on that page?: Top of this page.

Install:
DOM Inspector
Inspect Context
Web Developer Toolbar
With Web Developer Toolbar: Top of this page.

These images are an example of using Web Developer Toolbar and Stylish, together:

screenshot
Use "CSS" -> "View Style Information", to activate a tool with a cross-hair cursor, and red border box, which indicates the HTML tag element you are hovering over.
screenshot
The toolbar has changed to CSS information mode, which shows a "bread crumb trail" through all of the tags which the hovered tag is a "descendent" of.
screenshot
That was enough information to write the example userstyle.
screenshot
When that isn't enough information, turn off "View Style Information".
Highlight some text or an image, in the area you are trying to change.
That is, Left-Click, hold it, drag across the text, release left-click. Right-Click (context menu), "View Selection Source".
screenshot
Firefox will show you this.
screenshot
Highlight some text in the target container tag, and also some text outside of it, like this.
screenshot
Usually, you will be given the entire page source, but again, the highlighted part is selected there, too.
With DOM Inspector, Inspect Context, and Web Developer Toolbar: Top of this page.

These images are an example of using Web Developer Toolbar, DOM Inspector, Inspect Context, and Stylish, together:

screenshot
Use "CSS" -> "View Style Information", to activate a tool with a cross-hair cursor, and red border box, which indicates the HTML tag element you are hovering over.
screenshot
Take advantage of this to hover the correct page element.
Right-Click.
Chose "Inspect".
screenshot
DOM Inspector has been opened, with the page element (tag) you were hovering already navigated to and selected.
Now, you can copy Stylish's selector suggestion by Right-Clicking the DOMi line.
screenshot
I have pasted the selector into Stlyish.
Then, I trimmed the selector down to only the most important part of it.
If you used the entire selector Stylish gave you, the page you are styling will be more likely to break your style, by slightly changing only one part of what you have selected. Also, your style will be huge and slow.
screenshot
Now, I have finished the selector, and given it the properties I wanted it to have.
For the ratings stars, there were 3 total images. Those same images are used on other pages, too, so I wrote selectors which can catch them all.
Then, I would move these finished CSS Rules into a @-moz-document domain("userstyles.org")

Select one URL and exclude another?: Top of this page.

Not with CSS.
Currently, @-moz-document does not allow complex expressions, such as you would need to exclude a URL that falls in the domain you selected to style.
Greasemonkey is the cure.
I'm working on a script, Greasy Black, which, amongst other things, lets you define domains and URLs in which to add a class name to those pages, and features the often requested domain and URL exclusion not found in @-moz-document.
An example of the script in action, can be seen by pairing it with this userstyle: greasy black - google 2008 ( ALL except GMail ).
Configure the script by adding lines like these:
/* A list of common class names to reuse.
*/
var class_list = new Array();

class_list['default'] = 'greasy-black';

class_list['apacheError'] = 'apacheError';
class_list['google'] = 'bigBroother';
class_list['daytime'] = 'day';
class_list['another'] = 'anotherclassnamehere';
// Domains or URLs that you want to include.
do_class['google.com'] = class_list['google'];
do_class['customize.likethis.etc'] = 'yourclassnamehere';
do_class['anotherone.etc'] = class_list['another'];
// Domains or URLs that you want to exclude.
// No wildcards here.
// For URLs, this behaves just like @-moz-document url-prefix
dont_class['mail.google.com'] = true;
dont_class['http://maps.google.'] = true;
dont_class['butnotthis.anotherone.etc'] = true;
dont_class['http://anotherone.etc/and/not/this/either/'] = true;

What HTML tag does that select?: Top of this page.

td[bgcolor="#000080"]{background-color:green!important}
Selects: <td bgcolor="000080">
Selectoracle says:
Selects any td element with a bgcolor attribute that equals #000080.
Read: Selectors.
Learn: HTML.

Try To Userstyle Top of this page.

The following <iframe> contains a page which is incredibly ugly and a bit complex. Use it to test the principles of this tutorial as you learn to userstyle.

Hint:

@-moz-document url("") {
 [style*=".gif"],
 .dot1,
 .message9
  { display: none !important; }
}

After clicking, "CLICK HERE TO BEGIN", the CSS used in the page which loads in the <iframe> is:

body {
  background-color: #000 !important;
  color: #fff !important;
}

.message {
  color: red !important;
  font-style: italic !important;
}

.anotherMessage { color: #6699cc !important; }
.message2 { color: #80FF80 ; background-color: #2B2F2B ; }
.message3 { color: #804000 ; background-color: #80FF80 ; }
.message4 { color: #FD11F7 ; background-color: #408080 ; }
.message5 { color: #FFFF2B ; background-color: #000000 ; }
.message6 { color: #202020 ; background-color: #FFFFFF ; }
.message7 { color: #918E80 ; background-color: #808000 ; }
.message8 { color: #69675C ; background-color: #804040 ; }
.message9 { color: #004000 ; background-color: #004000 ; position: fixed ; top: 0 ; bottom: 0 ; left: 100px ; width: 100px ; overflow: hidden ; }

.dot1 { background-image:url(images/valacar-example-dot1.gif); position:absolute; left:0; top:0; width:100%; height:100%; z-index:500; }

After Stylish Top of this page.

Next Steps
Greasemonkey & UserScripts: With or without Stylish, there is UserChrome.js, extended by Greasemonkey.
 

HI Network Search

Loading...

 

Build your future, today!

Use Coupon Code:
HONESTHOST
$9.94 Savings
(4.95 x 2) - 9.94 =
2 Months Free
+ $100 Free Google AdWords Credit
+ Unlimited Disk Space
+ Unlimited Bandwidth

corner Copyright © 2010
Copyright & License Privacy Policy Terms of Service Site Uptime
corner