Skip to content

Tag: css

Disable details/summary

When I use the new details tag in combination with a summary I would then like to disable the generated input. I thought that could do the trick, but sadly it doesn’t work. How can one disable the details element? Answer Instead of using the non-existent disabled attribute, you can set a click handler o…

Making line numbers uncopyable

I’m working on adding line number support to Rainbow, a syntax highlighter, but I can’t figure out how to make the line numbers uncopyable. Disabling selection via user-select: none; makes an element unhighlightable, but you can still copy its text by highlighting around it and then copying, which…

Change :hover CSS properties with JavaScript

How can JavaScript change CSS :hover properties? For example: HTML CSS How can the td :hover properties be modified to, say, background:#00ff00, with JavaScript? I know I could access the style background property using JavaScript with: But I don’t know of a .style JavaScript equivalent for :hover. Answ…

slideDown jumps abruptly at the end

I’ve built a fairly normal menu-submenu arrangement in a vertical column — nested ULs, using slideToggle to expand and collapse submenus. The problem I’m trying to solve is in the way the submenus “jump” open at the very end. (I’m testing in the latest release of Chrome.) I…