Comments on: :focus https://css-tricks.com Tips, Tricks, and Techniques on using Cascading Style Sheets. Wed, 10 Mar 2021 07:38:32 +0000 hourly 1 https://wordpress.org/?v=6.4.3 By: Shivam Tyagi https://css-tricks.com/almanac/selectors/f/focus/#comment-1769535 Wed, 10 Mar 2021 07:38:32 +0000 http://css-tricks.com/?page_id=14188#comment-1769535 input:focus{
outline-color: rgb(0,114,198,0.7) !important;
outline-width: 0.1px !important;
-moz-outline-color: rgb(0,114,198,0.7) !important;
-moz-outline-width:0.1px !important;}

is not working on Mozilla firefox. What to do?

]]>
By: Maria https://css-tricks.com/almanac/selectors/f/focus/#comment-1630287 Mon, 30 Apr 2018 15:02:03 +0000 http://css-tricks.com/?page_id=14188#comment-1630287 how to add focus to <img tag inside an <a href tag?

]]>
By: raymond https://css-tricks.com/almanac/selectors/f/focus/#comment-1612350 Mon, 09 Oct 2017 17:47:40 +0000 http://css-tricks.com/?page_id=14188#comment-1612350 https://stackoverflow.com/questions/46643441/how-do-i-change-a-menu-image-opacity-when-a-menu-item-is-active
the above link is a question i asked today on stackoverflow. the solution given has issues. can you check my comments below it for help please.

]]>
By: vkm https://css-tricks.com/almanac/selectors/f/focus/#comment-1605680 Thu, 22 Dec 2016 11:00:05 +0000 http://css-tricks.com/?page_id=14188#comment-1605680 Hi, am looking a way where the button background color can remain same even i click somewhere else on screen.
I am setting some color to button using button:active and just goes away when i click somewhere else on screen. I have couple of buttons where i need to set this property, is this doable using CSS.

Thanks,
V

]]>
By: Rakesh https://css-tricks.com/almanac/selectors/f/focus/#comment-1605133 Tue, 22 Nov 2016 10:28:27 +0000 http://css-tricks.com/?page_id=14188#comment-1605133 hi

actually if we take login and signup buttons side by side and if we click on login button , the signup button background color should be disappeared and in the same way if we click on login button, signup button background color should be diasppeared /// send the code this as soonas possible

]]>
By: Randy https://css-tricks.com/almanac/selectors/f/focus/#comment-1603936 Tue, 06 Sep 2016 21:59:15 +0000 http://css-tricks.com/?page_id=14188#comment-1603936 In reply to DLSMIZEL.

I actually have a use case where this is needed. We have an application where a user is looking at an image of handwritten text on the left side of the screen, drawing a box, and typing what it says in the box (like a person’s name); and then that name appears in a person name field in the “structured data” view on the right. As they type on the left, it updates on the right. That works fine. We wish that it would look like a text edit field that has “focus” on both fields at once, so that the user could look either place and feel like it’s ok to edit there. Both would stay in sync. It’s just a convenience to the user to edit where they’re looking/thinking about it.

]]>
By: Imanuel https://css-tricks.com/almanac/selectors/f/focus/#comment-1601992 Sat, 04 Jun 2016 14:42:30 +0000 http://css-tricks.com/?page_id=14188#comment-1601992 In iOS Safari I can’t get two divs to focus one after another. The first element stays focused on clicking the second one. Is there a workaround for this?

]]>
By: Aviraj https://css-tricks.com/almanac/selectors/f/focus/#comment-1600347 Thu, 17 Mar 2016 07:22:30 +0000 http://css-tricks.com/?page_id=14188#comment-1600347 In reply to Your Name.

I want to use focus event using inline css in input tag

]]>
By: Andy https://css-tricks.com/almanac/selectors/f/focus/#comment-1599886 Thu, 25 Feb 2016 18:45:13 +0000 http://css-tricks.com/?page_id=14188#comment-1599886 I think Abhishek asked this above but I didn’t see an answer. If I focus on something and then go backwards, how does one “reset” so that it doesn’t remain focused?

]]>
By: Web Developer https://css-tricks.com/almanac/selectors/f/focus/#comment-1598870 Mon, 04 Jan 2016 19:43:09 +0000 http://css-tricks.com/?page_id=14188#comment-1598870 Is it possible to use input along with focus and not selector?
I want to apply the focus selector to all the input elements but one.
Can we use something like:
input:focus(:not(.phone)){
}

]]>
By: Gireejatmaj https://css-tricks.com/almanac/selectors/f/focus/#comment-1597488 Wed, 14 Oct 2015 08:35:30 +0000 http://css-tricks.com/?page_id=14188#comment-1597488 Thanx mark bro
Do you have solution for same problem using angularjs? It will be best option for me.

]]>
By: Mark https://css-tricks.com/almanac/selectors/f/focus/#comment-1597484 Wed, 14 Oct 2015 04:41:01 +0000 http://css-tricks.com/?page_id=14188#comment-1597484 In reply to Gireejatmaj.

The label is supposed to act like a button for this purpose. You can use it as follows:

<p><label for="message">Enter Message</label></p>
…
<p><textarea id="message" name="message"></textarea></p>

Alternatively, instead of (or as well as) the label above, you could add the following:

<button id="select-message">Message</button>
//  inside initialisation script
    document.getElementById('select-message').onclick=function() {
        document.getElementById('message').focus();
    }

Do I get extra credit for this?

]]>
By: Gireejatmaj https://css-tricks.com/almanac/selectors/f/focus/#comment-1597483 Wed, 14 Oct 2015 04:14:38 +0000 http://css-tricks.com/?page_id=14188#comment-1597483 I couldnt understand mark. Can you please explain using one example? If i you are saying that javascript is needed for button then please write that java script. As well as explain how to make it possible using label. Please give suitable example for each.

]]>
By: Mark https://css-tricks.com/almanac/selectors/f/focus/#comment-1597481 Tue, 13 Oct 2015 21:01:24 +0000 http://css-tricks.com/?page_id=14188#comment-1597481 In reply to gireejatmaj.

If it’s really a button, no, it can’t be done without JavaScript.

If you create a label for the textarea, then that’s exactly what it’s supposed to do. The label and the textarea don’t have to be next to each other as long as you give the textarea an id attribute, and use the for attribute in the `label.

Using CSS, you can make the label look any way you want, including the appearance of a button.

]]>
By: gireejatmaj https://css-tricks.com/almanac/selectors/f/focus/#comment-1597471 Tue, 13 Oct 2015 08:41:44 +0000 http://css-tricks.com/?page_id=14188#comment-1597471 I want to make a particular area text area focus true when i will click on another button. (cursor should blink in text are when i click on particular button)

Autofocus works good but only once when page refreshes. I want to focus( cursor blink in text area) on every click on particular button.

]]>