Remove points from select focus css

2

In firefox to have focused a select puts me some points that I do not know exactly how to remove.

These are:

I've taken them off once, but I do not remember what it was like.

If I'm not mistaken, it's with outline, but in firefox, it's over.

.txt {
    padding: 10px;
    
    &:read-write:focus {
        background: #eeeeee;
        outline: none;
    }
}
<div class="txt" contenteditable="true">Lorem ipsum</div>

I give an example of what happens ... with safari I see a background, but with firefox I see the little dots.

    
asked by Killpe 26.01.2018 в 23:26
source

3 answers

2

Your problem really is that in order to use the read-write selector in Firefox you need to add the prefix -moz .

I have managed to reproduce your error with Firefox 49.0.2.

Of course, keep in mind that you will have to make two CSS entries, one for Firefox and one for the other browsers.

Your modified example:

.txt {
   padding: 10px;
}

.txt:-moz-read-write:focus {
   background: #eeeeee;
   outline: none;
}

.txt:read-write:focus {
   background: #eeeeee;
   outline: none;
}
<div class="txt" contenteditable="true">Lorem ipsum</div>

NOTE: Here I have put the code in pure CSS so that you can see the effect in the snippet since with SASS we can not see the result here.

Your code with SASS would look like this:

.txt {
    padding: 10px;
    
    &:-moz-read-write:focus {
        background: #eeeeee;
        outline: none;
    }
    
    &:read-write:focus {
        background: #eeeeee;
        outline: none;
    }
}
<div class="txt" contenteditable="true">Lorem ipsum</div>
    
answered by 27.01.2018 / 13:07
source
1

It is assumed that, since you have it in your code, it worked, I do not know if it was already deprecated or why it no longer works. But, with the property% co_of% it is possible, although it applies it to all the elements not only to the [contenteditable] class:

.txt {
    padding: 10px;
}
[contenteditable]:focus {
   outline: 0px solid transparent;
}
<div class="txt" contenteditable="true">Lorem ipsum</div>
    
answered by 27.01.2018 в 00:10
-3

a: hover {     margin: // whatever you want to happen with the margin }

    
answered by 26.01.2018 в 23:34