What is the default value of the "cursor" attribute?

3

What is the default value of the "cursor" attribute?

I changed the value to pointer , but in a certain case I prefer to go back to the standard set, but I do not know what the value is.

    
asked by anonymous 06.11.2017 / 13:06

4 answers

3

No, initial value is not cursor: default as first response says, but cursor: auto , already default is a "cursor type"

  

Theanswersthatquotecursor:autoyesarecorrect.

Thecursor:automakesthebrowser(basedonaninternalstyleprobably)applyacursortypebasedontheelementtypeandtorestoretothe"default" value I think the best way is to use the initial value ( although auto works), however for other initial properties is what will work.

The value initial

The keyword initial applies the initial value to a property of an element, this can be used for any property

An example of MDN :

p {
  color: red;
}

em, a {
  color: initial;
}
<p>
  <span>Ficará em vermelho.</span>
  <em>Voltará a cor padrão inicial do navegador</em>
  <a href="#">Voltará a cor padrão inicial do navegador</a>
  <span>Em vermelho</span>
</p>

Using with the cursor property:

.area-com-cursor-customizado {
    cursor: pointer;
}
.area-com-valor-inicial {
    cursor: initial;
}
<div class="area-com-cursor-customizado">
   <p>foo bar baz</p>
   <p>foo bar baz</p>
   <p>foo bar baz</p>
   
   <div class="area-com-valor-inicial">
       <p>foo bar baz</p>
       <p>foo bar baz</p>
       <p>foo bar baz</p>
       <p>foo bar baz</p>
   </div>
   
   <p>foo bar baz</p>
   <p>foo bar baz</p>
   <p>foo bar baz</p>
   <p>foo bar baz</p>
</div>
    
06.11.2017 / 15:11
6

The default value is default :

.exemplo {
   cursor:default;
}

Here's an example of the possible values for the cursor attribute, just hover over each one to see how they work:

<span style="cursor:auto">auto</span><br>
<span style="cursor:crosshair">crosshair</span><br>
<span style="cursor:default">default</span><br>
<span style="cursor:e-resize">e-resize</span><br>
<span style="cursor:grab">grab</span><br>
<span style="cursor:help">help</span><br>
<span style="cursor:move">move</span><br>
<span style="cursor:n-resize">n-resize</span><br>
<span style="cursor:ne-resize">ne-resize</span><br>
<span style="cursor:nw-resize">nw-resize</span><br>
<span style="cursor:pointer">pointer</span><br>
<span style="cursor:progress">progress</span><br>
<span style="cursor:s-resize">s-resize</span><br>
<span style="cursor:se-resize">se-resize</span><br>
<span style="cursor:sw-resize">sw-resize</span><br>
<span style="cursor:text">text</span><br>
<span style="cursor:w-resize">w-resize</span><br>
<span style="cursor:wait">wait</span><br>
<span style="cursor:not-allowed">not-allowed</span><br>
<span style="cursor:no-drop">no-drop</span><br>
    
06.11.2017 / 13:10
3
  

The CSS cursor property specifies the mouse cursor shown when   the mouse pointer is over an element.

The initial value of this property is auto , what happens is that it is converted by browser to another property according to its context, usually in default (The little set that we are accustomed to see) / p>

  

cursor: auto; Brower determines the cursor to be displayed based on   in the current context.

Links for reference:

Cursor - MDN

Cursor - W3schools

    
06.11.2017 / 13:15
2

Hello, the cursor pattern will depend on the context. To use the common set you could use cursor: default , but if you want the default from the context, use cursor: auto .

    
06.11.2017 / 13:09