Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

From a CSS perspective, what state is an input button in when you click, hold down for a second and then drag away?

Tags:

html

css

Unknown CSS button state

Above you have a button in 3 states, normal, hover, and then what is the third state called? What would need to put into my CSS to style this?

The button seems to be in this state after a right click too.

Really simple probably, I know, but I can't figure it out.

like image 594
JMK Avatar asked Apr 14 '15 19:04

JMK


People also ask

How to style input elements with CSS properties?

In the example below, we have <input> elements with type="button" and type="submit", which we style with CSS properties. To style them, we use the background-color and color properties, set the border and text-decoration properties to "none". Then, we add padding and margin, after which we specify the cursor as "pointer".

How to style the button when pressed or clicked in HTML?

When button receives focus, the browser provides an outline to the button. To remove the outline, set the outline to none on the :focus pseudo-class Finally, there is an :active pseudo-class for the button. This helps to style the button when the button is pressed or clicked.

How to style a button in a separate css file?

The class="button" attribute will be used to style the button in a separate CSS file. The value button could be any other name you choose. For example you could have used class="btn".

How do I style an input button in HTML?

Styled input buttons. In the next example, we have a <form> element within which we add <div> elements each containing a <label> and <input>. Then, we add another <input> with type="submit" and style it.


1 Answers

The state you are looking for is the focus state

There are actually 4 states in the GIF you presented

  1. Normal (light pink)
  2. Hover (darker pink, mouse is hovering)
  3. Active (when you are still holding on, but dragging away)
  4. Focus (not pink anymore but still focused with blue rectangle)

Cannot replicate your gif exactly, but here is a JSFIDDLE demonstrating these 4 states.

like image 112
gitsitgo Avatar answered Oct 03 '22 07:10

gitsitgo