Change the border color when summernote is in focus状态

My goal is to change the border color of the summernote div to a light blue when it is focused, and then set it back to neutral when it loses focus.

To remove the shadow around the div, I used the following CSS code:

div.note-editor.panel.panel-default {
    box-shadow: none;
}

However, I am struggling to style the div when it is in a focused state. Neither using .focused nor :focus has helped me achieve this. Any suggestions would be appreciated!

Answer №1

According to MDN documentation, :focus is used to represent an element (like a form input) that has been focused on. Conversely, :active is used to represent an element (such as a button) that is being activated by the user. In this scenario, you should use :active instead of :focus.

div.note-editor.panel.panel-default {
  box-shadow: none;
  cursor: pointer;
}

div.note-editor.panel.panel-default:active {
 outline: 1px solid blue;
}
<div class="note-editor panel panel-default">
  Hello Focus
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The Ajax search feature seems to be malfunctioning as it does not exhibit any functionality and fails to

I have successfully added search functionality to my webpage. However, I am encountering a problem where the data is not displaying and only showing a blank page. I checked the console for errors but found none. Below is the code for the search functional ...

Tips on incorporating form groups within a grid using semantic-ui-react

I am currently developing a project using semantic-ui-react that involves numerous input fields. To better organize the page, I have decided to split it into 3 columns. Below is the approach I have taken: render() { return ( <Form> < ...

"Troubleshooting: Sending null values through Jquery ajax to an MVC controller

The issue: I am facing a challenge with saving events in a calendar through ajax by sending the content to my controller function. Despite my efforts, I constantly see null values being passed to my database. Upon inspecting the Network tools console log ...

Creating new rows dynamically with jQuery

In my current setup, there is a table with one row and two columns - a textbox and a button: $(function() { var i = 1; $('#add').click(function() { i++; $('#dyn').append('<tr id="row' + i + '">&l ...

Having difficulty retrieving user selection from the drop-down menu

I've been attempting to retrieve user input from a basic drop-down menu and insert it into a <p> tag, however, I'm encountering difficulties. Here is the javascript code I am using: <script> function changeText() { var t ...

Ways to decrease the spacing between lines in a table row

I am trying to decrease the line height between table rows, but the code I used didn't work. Can you please take a look at the image? Specifically, I want to reduce the space between "Mon-Sat 09:00 AM - 7:00 PM" and "We closed Sunday &a ...

Why isn't my CSS transition animation working? Any suggestions on how to troubleshoot and resolve

I am looking to incorporate a transition animation when the image changes, but it seems that the transition is not working as intended. Can anyone provide guidance on how to make the transition style work correctly in this scenario? (Ideally, I would like ...

Slowly zooming background image

I've been searching all over the place but can't seem to find a clear answer on how to slowly zoom in the background image using CSS. Any help would be greatly appreciated. Currently, my code only zooms the text elements and not the background. ...

Hiding the author, category, and date information from displaying on WordPress posts

After creating a Wordpress blog site and adding the category widget to the right sidebar as a drop down, I realized that I needed to customize its layout in terms of colors and design. However, I am struggling to find out how it can be done, which .php fil ...

Transferring CSV information from a div container to an Excel spreadsheet

At this moment, when I have a <textarea> structured as follows: <textarea> 1, 2, 3, 4 5, 6, 7, 8 9, 10, 11, 12 </textarea> and then attempt to transfer the content to Excel, it prompts me to paste from a comma-separated source. However ...

Tips on setting the ajax parameter contentType to "html"

I'm encountering an issue where the variable "myvariable" is passing as null. Can anyone provide guidance on what I might be doing incorrectly? $.ajax({ type: "POST", url: "/MyController/MyAction", data: JSON.stringify({ items: my ...

Show information on the following screen by utilizing ajax when the button is pressed

I need to implement functionality on my cshtml page, ListZoneRecords.cshtml, where clicking on a zone row should display its details on another page. I am looking to achieve this using ajax. //ListZoneRecords.cshtml <script> $('#btn_sbmt_details ...

How can I retrieve form information using Jquery AJAX?

Hey there! I've been working on a code to retrieve key/value pairs from a form on a page when a user clicks submit. Despite trying various methods, I keep encountering errors like: Uncaught TypeError: Cannot use 'in' operator to search for ...

Discover the method to retrieve HTML content by sending an HTTP POST request in AngularJS, similar to loading content

My attempt to retrieve HTML content using Angular Js Post HTTP method was successful, but only for text contents like P tags. I am now trying to fetch HTML contents that include input types such as text boxes using Angular JS. Interestingly, when I utilize ...

Creating a repetitive animation effect using CSS3 transforms

I am looking to add an animation effect that creates a "shaking" motion on an image when hovered over. This effect is similar to the shaking of app icons on iPhones when held down for a few seconds. Ideally, I would like to achieve this using pure CSS3, b ...

Sending JSON data two times to the ASP.NET MVC controller via POST request

function onTestComplete(content) { var url = '<%= Url.Action("JsonTest","Organization") %>'; $.post(url, null, function(data) { alert(data["name"]); alert(data["ee"]); }); } <% using (Ajax.BeginForm("JsonTe ...

Guide to linking an external URL with a lightbox image

I have created a gallery and an admin gallery page. In the admin gallery, there is a delete button that appears over the image. However, when I click on it, instead of showing the message "Are you sure?", it opens a lightbox. I suspect that the code for t ...

The positioning problem arising from using a Vuetify select dropdown within a datatable

Vuetify datatable is being used with 20 columns, functioning properly. To view all the columns, horizontal scrolling is available. Filters are needed for each column in the header, achieved using v-slot:header. An issue arises when clicking on the select ...

Retrieve an image located outside of a container

I have multiple SVGs inside separate div elements. <div id="divA"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <rect x="10" y="10" height="130" width="500" style="fill: #000000"/> ...

displaying the identical image from various perspectives

I have an arrow image that I need to display in different angles - top, left, bottom, right. I was considering what would be the best approach: 1: Changing the image direction via CSS and loading the main image <img src="a.png"> <img src="a.png" ...