There is border around button and link when click.
How can I remove it?
You can preset it like that :
:focus{
outline:0; /*removes the dotted border*/
}
But remember (for accessibility reasons) to set the style "later" in your CSS file to something more visible. For example :
a:focus, a:active{
color:#ff5500; /*different color than regular*/
}
input[type=submit]:focus, input[type=submit]:active{
background-color:#444; /*different color than regular*/
}
Try this one
a:hover, a:active, a:focus {
outline: 0;
}
It's ugly, but so are most IE fixes.
a:focus, *:focus {
noFocusLine: expression(this.onFocus=this.blur());
}
To start with, I can see one of your tags is IE7-bug, while this is actually more like a feature. The purpose of having this dotted outline is for users to be able to navigate between various controls using their mousewheel or the tab key.
In any case, to define the style of an element when it's "focused" use the CSS :focus selector. The property that styles this outline is, trivially, outline; outline: 0 will prevent the focus outline from appearing.
Note: You might want to apply that rule only on your button, and not on all elements, because some users might be used to seeing something to indicate focus, which makes it easier to navigate using the methods mentioned above.
Hope that helped in any manner.
CSS outline is not supported in IE7. That "browser" requires the following CSS expression:
a {
_noFocusLine: expression(this.hideFocus=true);
}
It works also in newer versions.
This would do the trick
a {
outline:0;
}
This will also work
a
{
outline-style:none;
}
a:link{
outline-style: none;
}`
Try setting the outline property:
a {
outline: 0;
}
Try
a {
outline: none;
}
Always try to use css reset.This will help you to solve the problem like this.I use eric mayer css reset tool.
Apply this rule to the input
input { outline : none ; }
This is all around code to remove outerline and put in your your CSS under the desired class name (className in IE). Example for <a> tags
a{
_noFocusLine:expression(this.hideFocus=true);
outline-style:none;
outline:0;
}
Example for all tags in your html page!
*{
_noFocusLine:expression(this.hideFocus=true);
outline-style:none;
outline:0;
}
Example for a tag with class myClassName in your html page!
.myClassName{
_noFocusLine:expression(this.hideFocus=true);
outline-style:none;
outline:0;
}
Example for a tag with id myidName in your html page!
#myidName{
_noFocusLine:expression(this.hideFocus=true);
outline-style:none;
outline:0;
}
Works in major browsers and if not they are so old so the chance of how many people there still are using this old browsers!
Notes: outline:none 0; does also work in newer browsers but not in all. But outline:0; is universal and in those browsers there don´t understand 'none' and you get there's default value, but 0 understand in all browsers there are using outline:.
And you need this for IE7: _noFocusLine:expression(this.hideFocus=true);
or use JavaScript for the rest!
window.document.getElementById("myidName").blur();
window.document.getElementById("myidName").hideFocus=true;
window.document.getElementById("myidName").style.outline=0;
or
Obj=window.document.getElementById("myidName");
Obj.blur();
Obj.hideFocus=true;
Obj.style.outline=0;
or with check if element exist:
if (window.document.getElementById("myidName")){
Obj=window.document.getElementById("myidName");
Obj.blur();
Obj.hideFocus=true;
Obj.style.outline=0;
}
JavaScript can do the trick for IE6 and IE7 and other CSS can't.
You can do it with this code:
a:focus{
border: none;
}
Related
I'm making my firs steps learning to code. I've been taken some courses on Internet and now I decided to continue learning from the experience while I build a Wordpress child theme.
The thing is that I made a summary. And when it's active it has a blue border.
I'm trying to remove it but I can't find a solution.
I tried suing this without success:
summary:active {
border:none;
}
Do you have some suggestion?
summary:focus{
outline: none;
}
The browser is rendering a border around the summary while it is on focus.
Problem: Its not the border but a outline that browsers render.
Solution: Set outline:none on the element.
So the code would be
summary:focus{
outline: none;
}
To remove it from all inputs
input {
outline: none;
}
To remove it from all tags use the universal selector *:
*:focus {
outline: none;
}
The problem is the input field, not the summary class itself. You can try removing it by using the following code:
input:focus{
outline:none;
}
Hope it helps
People have said to remove with outline: none, which will remove the outline.
However, from an accessibility perspective you should replace the outline with one that fits the brand guidelines.
The outline on an element's focus state is to ensure that someone can tell where they are. Not all users have a point-and-click device, and even if they do, they won't leave their mouse hovering over an element at all times. For field inputs it's worth keeping an outline or other focus style so users know which field they're in.
The A11y Project (accessibility project) has some useful information which covers what I've said.
I'd suggest that rather than doing:
summary:focus {
outline: none !important
}
You talk to the designer to come up a positive focus style, e.g.:
summary:focus {
background: #ffeeee;
color: #242424;
outline: none
}
If it is an input field try this
input:focus{
outline: none !important;
}
I was able to make the blue outline disappear in Safari 10 with:
summary {outline:none;}
Funny thing is that I can't change the specific color of the outline:
summary:focus{outline:red;}
Αlso removed the outline. Using solid and dotted all work as specified, and display it black.
But it looks like the blue color is hard-coded into focused input fields. The very text box I'm using right now has the same light blue outline. Maybe that can't be changed, but you can suppress its visibility or restyle it. You just can't specify a color.
*.no-outline > * :focus {
outline: none;
}
This would remove any the outline for any tag with class no-outline, and also it will remove outline for all its children.
I have a div wrapped in a <a> tag like this...
<a href='/'><span>Quiz</span>
and then my css stylesheet looks like this...
a:visited {
color: green;
}
But when the link is visited, it looks like this...
I have tried defining the border settings in the a css selector in various ways with no luck. Any ideas on how to fix this?
This is not an outline, probably there is already a border on, either your span or your a. Now, if the border doesn't have a specific color set, e.g.
border: 1px solid;
instead of
border: 1px solid black;
then it's color is defined by the color property. Which means that what is happening is normal.
Now, you have two options, either you find where is this border defined and remove it or add a color to it. Or you override it in some way like:
a:visited {
color: green;
border-color:transparent;
}
you may need !important on the border-color rule but that depends.
Use outline instead of border to fix this.
Thanks
i think it will be better if you look into the style section of the safari inspection. There are certain browser default styles which behave in a similar way. If you find any outline or border declaration, try to neutralize that declaration by declaring from your end border: 0; outline: none;
It will be of real help if you could share with us the code over fiddle or codepen.
Note: I was unable to recreate the scenario as you specified.
I found that if there is a a link in the page which does not link to a new page,then when user click it,there will be a dotted line around the element,it will only disappear when user click anything else in the page,how to remove this?
Example:
Note the dotted line around the element Section 2.
Use outline:none to anchor tag class
Like #Lo Juego said, read the article
a, a:active, a:focus {
outline: none;
}
a {
outline: 0;
}
But read this before change it:
removing-the-dotted-outline
Try with !important in css.
a {
outline:none !important;
}
// it is `very important` that there is `no` `outline` for the `anchor` tag. Thanks!
To remove all doted outline, including those in bootstrap themes.
a, a:active, a:focus,
button, button:focus, button:active,
.btn, .btn:focus, .btn:active:focus, .btn.active:focus, .btn.focus, .btn.focus:active, .btn.active.focus {
outline: none;
outline: 0;
}
input::-moz-focus-inner {
border: 0;
}
Note: You should add link href for bootstrap css before the main css,
so bootstrap doesn't override your style.
Removing outline will harm accessibility of a website.Therefore i just leave that there but make it invisible.
a {
outline: transparent;
}
In my case it was a button, and apparently, with buttons, this is only a problem in Firefox. Solution found here:
button::-moz-focus-inner {
border: 0;
}
Its simple try below code --
a{
outline: medium none !important;
}
If happy cheers!
Good day
I'm working on a website: http://www.allaboutwinecellars.com
And on one of the galleries (the Accesory page) there are blue lines between the pictures and I don't know why, the layout is exactly the same as the first page.
Can anyone figure out why those lines are there?
Here is the first page (the correct one): http://allaboutwinecellars.com/gallery.html
Here is the second page (the one with blue lines): http://allaboutwinecellars.com/gallery-2.html
Edit: I tried adding outline:none; to my anchor tag CSS rules and it did not fix the problem.
The issue is your anchor tags. You need to explicitly set the text-decoration property. The line that you're seeing is the blue underline representing a hyperlink. It looks like you already have properties defined that alter anchor's behavior. Simply add to it:
a {
text-decoration: none;
outline: none;
}
a { text-decoration: none; }
should fix it
Try this:
a, img{
border:0px;
outline:0px;
}
add this to your css:
#content p a
{
color:#000;
}
It's actually a blue underline.
Use text-decoration: none;.
I am using this CSS to remove dotted borders which appear when hyperlinks are clicked
a:active, a:focus, input {
outline: 0;
outline-style:none;
outline-width:0;
}
This is working fine, but doesn't work on input buttons which have background images.
It's not my place to question your design decisions, so here you go.
Just add this to any link's you want to remove the dotted line
onfocus="if(this.blur)this.blur()"
It isn't working fine. It is rendering it impossible to navigate the design without a mouse.
See http://24ways.org/2009/dont-lose-your-focus for a reasonable compromise.
You could add an onclick: blur(); so it keeps it tab-happy and doesn't ruin the design when clicked.
But for the record, this seems to work cross browser. The first part for IE, the second for FF:
input, input:active, input:focus{
outline: 0;
outline-style:none;
outline-width:0;
}
button::-moz-focus-inner,
input[type="reset"]::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner,
input[type="file"] > input[type="button"]::-moz-focus-inner {
border: none;
}
You need classes to differentiate which links have dotted borders and which do not. Using the img selector won't be enough.
Style your input tags to not have dotted borders; you could even use a class for your input buttons if you have more than one style (Clear, Submit, Cancel, etc.)