Outline radius?

Old question now, but this might be relevant for somebody with a similar issue. I had an input field with rounded border and wanted to change colour of focus outline. I couldn’t tame the horrid square outline to the input control. So instead, I used box-shadow. I actually preferred the smooth look of the shadow, … Read more

Add a tooltip to a div

For the basic tooltip, you want: <div title=”This is my tooltip”> like: .visible { height: 3em; width: 10em; background: yellow; } <div title=”This is my tooltip” class=”visible”></div> For a fancier javascript version, you can look into: https://jqueryhouse.com/best-jquery-tooltip-plugins/ The above link gives you 25 options for tooltips.

Stylesheet not loaded because of MIME-type

For Node.js applications, check your configuration: app.use(express.static(__dirname + ‘/public’)); Notice that /public does not have a forward slash at the end, so you will need to include it in your href option of your HTML: href=”https://stackoverflow.com/css/style.css”> If you did include a forward slash (/public/) then you can just do href=”https://stackoverflow.com/questions/48248832/css/style.css”.

Remove CSS class from element with JavaScript (no jQuery) [duplicate]

The right and standard way to do it is using classList. It is now widely supported in the latest version of most modern browsers: ELEMENT.classList.remove(“CLASS_NAME”); remove.onclick = () => { const el = document.querySelector(‘#el’); el.classList.remove(“red”); } .red { background: red } <div id=’el’ class=”red”> Test</div> <button id=’remove’>Remove Class</button> Documentation: https://developer.mozilla.org/en/DOM/element.classList

Managing CSS Explosion

This is a very good question. Everywhere I look, CSS files tend to get out of control after a while—especially, but not only, when working in a team. The following are the rules I myself am trying to adhere to (not that I always manage to.) Refactor early, refactor often. Frequently clean up CSS files, … Read more

Set cookie and get cookie with JavaScript [duplicate]

I find the following code to be much simpler than anything else: function setCookie(name,value,days) { var expires = “”; if (days) { var date = new Date(); date.setTime(date.getTime() + (days*24*60*60*1000)); expires = “; expires=” + date.toUTCString(); } document.cookie = name + “=” + (value || “”) + expires + “; path=/”; } function getCookie(name) { … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)