html
How to write a:hover in inline CSS?
Short answer: you can’t. Long answer: you shouldn’t. Give it a class name or an id and use stylesheets to apply the style. :hover is a pseudo-selector and, for CSS, only has meaning within the style sheet. There isn’t any inline-style equivalent (as it isn’t defining the selection criteria). Response to the OP’s comments: See … Read more
How to center an unordered list?
Expand snippet
Set bootstrap modal body height by percentage
I am trying to make a modal with a body that will scroll when the content becomes too large. However, I want the modal to be responsive to the screen size. When I set the max-height to 40% it has no effect. However, if I set the max-height to 400px it works as expected, but … Read more
How to make a display in a horizontal row
List items are normally block elements. Turn them into inline elements via the display property. In the code you gave, you need to use a context selector to make the display: inline property apply to the list items, instead of the list itself (applying display: inline to the overall list will have no effect): Here … Read more
What is wrong in chrome “net : Failed to load resource: net::ERR_SPDY_PROTOCOL_ERROR”?
The problem was that web hosting adds HTTP header Content-Encoding: gzip for all the PHP content even when the Content-Type: image/jpeg is in the output from that script. For the hotfix I added HTTP header Content-Encoding: none into that script. And it worked. But now I am asking web hosting provider to not add the … Read more
Local Storage vs Cookies
Cookies and local storage serve different purposes. Cookies are primarily for reading server-side, local storage can only be read by the client-side. So the question is, in your app, who needs this data — the client or the server? If it’s your client (your JavaScript), then by all means switch. You’re wasting bandwidth by sending … Read more
How do I load an HTML page in a div using JavaScript?
I finally found the answer to my problem. The solution is
How to use the “required” attribute with a “radio” input field
TL;DR: Set the required attribute for at least one input of the radio group. Setting required for all inputs is more clear, but not necessary (unless dynamically generating radio-buttons). To group radio buttons they must all have the same name value. This allows only one to be selected at a time and applies required to … Read more
Indent List in HTML and CSS
I’m new to CSS and working with list. I tried using one of the code I saw on w3schools which shows how to indent lists: My css is overriding it so it all apears on the same vertical line. Is there any CSS code I could use locally on the list to override the main … Read more