Opera FAQs, Tips, Tricks & Tweaks

Tips for Opera browser since 2005

Subscribe to RSS feed

Posts tagged with "User CSS"

Find the CSS code to hide anything using Opera Dragonfly

, , , ...

User style sheet can be used to modify the look of a website. Even if you don't know anything about CSS you can find code to hide anything using Opera Dragonfly dragonfly as shown below.

  1. Right click on the item you want to hide and select 'Inspect Element' from the context menu. Opera Dragonfly will open and highlight the element with blue color depending on where you clicked.

    Opera Dragonfly
    Ad is highlighted but the text 'Ad' is not highlighted

  2. Click one by one (in this example li.tas, ol, div#tads.c, ...) from bottom right side until everything you want to hide is highlighted.

    Opera Dragonfly
    Both Ad and text 'Ad' are highlighted

  3. Select and copy code from bottom and add the following at the end.
    {display:none !important;}
    The final code looks like the following.
    div#tads.c {display:none !important;}
  4. Save the CSS code to a file with css extension.
  5. Close Opera Dragonfly.
  6. Right click on the page > Edit Site Preferences... > Display > My style sheet > [Select saved file] > OK
  7. Reload page to apply the style sheet.

Quickly enable or disable a style using keyboard shortcut/mouse gesture

, , , ...

Author mode and user mode styles can be switched quickly using the default keyboard shortcut, Shift+G but there is no shortcut to enable or disable other styles except View > Style menu.

Any style can be enabled or disabled quickly by using action codes Select user CSS file and Deselect user CSS file respectively. Create a new keyboard shortcut or mouse gesture in Document Window section with the following action code.

Select user CSS file, X | Deselect user CSS file, X

For Windows OS, X = Style sheet number (files sorted in ascending order) - 1. If you don't have any additional CSS style files inside profile\styles\user directory except the default ones, you can use the X value from the following table.

# Style file name Style name X value for Windows OS
1 accessibility.css Accessibility Layout  0 
2 altdebugger.css Alt Debugger 1
3 classid.css Class and Id 2
4 contrastbw.css High Contrast (B/W) 3
5 contrastwb.css High Contrast (W/B) 4
6 disablebreaks.css Disable Breaks 5
7 disablefloats.css Disable Floats 6
8 disableforms.css Disable Forms 7
9 disablepositioning.css Disable Positioning 8
10 disabletables.css Disable Tables 9
11 outline.css Outline 10
12 structureblock.css Block Structure 11
13 structureinline.css Inline Structure 12
14 structuretables.css Table Structure 13
15 tablelayout.css Fixed Table Layout 14
16 toc.css Table of Contents 15

For Linux OS, open terminal and copy & paste the following command to find the X value.

ls ~/.opera/styles/user/ -U | awk '{ print FNR-1 " " $1 }'

Command to find X value in Linux OS
Command to find X value in Linux OS

Example: Action code to enable or disable accessibility layout

For Windows OS,

Select user CSS file, 0 | Deselect user CSS file, 0
For Linux OS,
Select user CSS file, 5 | Deselect user CSS file, 5

If you add additional CSS style files later you may have to change the X value.

Web page looks different in Opera?

, , , ...

If web page looks different from normal then you might have enabled User Mode or style sheet. To bring back normal look disable all except Author Mode in View > Style or O Menu > Page > Style.

Opera Author Mode Style
Normal look (Author mode)

Opera Accessibility Layout Style
Accessibility layout

Opera Block Structure Style
Block structure

Opera Outline Style
Outline

Opera Table of Contents Style
Table of contents

Look with various styles

Style your My Opera news page

, , , ...

Latest news page used to show your blog posts and photos in green color and others in blue color but this was removed in carambola release. Frown

You can bring back colors by using user style sheet. Smile Add the following code to user CSS file and reload news page to apply style sheet.

/* Subscriptions (Latest news) */
.newscontainer h2 { background:#2b7fb6; color:#fff; }
.newsowner h2 { background:#82a70b; }

My Opera news page before
News page before

My Opera news page after
News page after

Use user style sheet to modify the look of a website in Opera

, , , ...

A user style sheet is a text file with CSS declarations. It allows you to have control over the look and feel of website. It can be used to hide annoying things like ads, change fonts and colors, etc.

!important declaration should be added to a rule to take precedence over author style sheet.

User style sheets can be applied to all sites Tools > Preferences... > Advanced > Content > Style Options... > My style sheet (restart required to apply style sheet) or per-site basis Right click on a site > Edit Site Preferences... > Display > My style sheet (reload required to apply style sheet).

Example 1: Hide friend request link in My Opera

My Opera friend request link in top bar
My Opera friend request link in top bar

  1. Create a text file with the following and save preferably inside profile\styles directory with CSS file extension.
    /* Friend request */
    #friendrequest { display: none !important; }

    CSS to hide friend request link and share this button
    CSS to hide friend request link and share this button

  2. Add path to CSS file in site preferences.

    Path to CSS file in site preferences
    Path to CSS file in site preferences

  3. Reload page to apply style sheet.

    My Opera friend request link hidden by CSS
    My Opera friend request link hidden by CSS

Example 2: Hide sponsored links in Google

Google Sponsored Links
Useless Google sponsored links

Google sponsored links can't be blocked by content blocker but it can hidden by following CSS code.

/* Top sponsored links */
#tads { display: none !important; }

/* Side sponsored links */
#mbEnd { display: none !important; }