The My Opera forums have been replaced with forums.opera.com. Please head over there to discuss Opera's products and features

See the new Forums

Remove outline for HTML elements using CSS.

Forums » Dev.Opera » General Web Development Discussions

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

14. November 2011, 09:13:52

harshniketseta

Posts: 5

Remove outline for HTML elements using CSS.

I want to remove outline totally from input,img,select and textarea using CSS.How do I go about it.Please tell me.

Already tried:

outline: none;

and

outline: rgba(0,0,0,0) none 0;

and

outline: 1px solid #CCC;
outline-offset:-2px;

Thanks in advance.

15. November 2011, 00:19:02

spadija

Posts: 1643

Those elements don't normally have an outline. Maybe you want to remove the border?

15. November 2011, 04:17:08

harshniketseta

Posts: 5

Then what is the dotted line around the element when it is active or has focus.

15. November 2011, 07:38:20

spadija

Posts: 1643

I don't see any dotted line around focused elements. What OS and version of Opera are you using?

15. November 2011, 09:07:43

harshniketseta

Posts: 5

OS: Ubuntu 11.04
and

Opera

Version
11.52

Build
1100

Platform
Linux

System
i686, 2.6.38-12-generic

15. November 2011, 17:54:22

spadija

Posts: 1643

It's possible this is a Linux-only thing, since I don't see it on Windows. Could you post a screenshot of the dotted outline just to be sure?

17. November 2011, 22:09:31

Frenzie

Posts: 15571

I don't see any dotted outline on the same OS.
The DnD Sanctuary — a safety net for My Opera's demise.

19. November 2011, 05:38:24

harshniketseta

Posts: 5

I am attaching the screenshots and the src.The screenshot consist of various tricks that I have tried on 3 html elements.

src(focus.html+special.css+play.jpg)
http://dl.dropbox.com/u/16730545/src.zip

screenshots(total of 15 images)
http://dl.dropbox.com/u/16730545/opera%20screenshots.zip

Some of the hacks do work but only on some elements.

19. November 2011, 19:50:46

spadija

Posts: 1643

Okay. The blue outline only appears when you use spatial navigation (Shift+Arrows). Disabling that is going to make those who use spatial navigation hate you, as they won't be able to tell which element is selected. I'm not sure why you're getting a dotted outline on the other buttons though. Do you have any OS settings set in a way that might cause this?

22. November 2011, 08:22:31

harshniketseta

Posts: 5

I don't think its a OS setting plus it also happens with mouse based focus.

Also it is working when we do -o-transform:rotate(0) which is a Opera specific CSS command.

22. November 2011, 21:15:46

spadija

Posts: 1643

I can now get the outline on buttons here, but only when I focus them with tab or spatial navigation. This happens for you when you focus things with the mouse too? I am not sure if/how you can remove this.

23. November 2011, 21:38:09

Frenzie

Posts: 15571

Originally posted by spadija:

Disabling that is going to make those who use spatial navigation hate you, as they won't be able to tell which element is selected.


I'd be one of those people.

Anyhoo, if you style buttons you don't get the outline, which btw is simply a part of the default Ubuntu theme. It's the exact same in e.g. Firefox, and disappears or changes if you choose a theme without it. http://www.webreference.com/programming/css_stylish/index.html
The DnD Sanctuary — a safety net for My Opera's demise.

Forums » Dev.Opera » General Web Development Discussions