Today I discovered MinWiz – Minimal starter kit for under 2 KB sites.
Tag Archives: HTML
watch catting together HTML head/foot and MySQL information_schema.processlist
This came up back on August 9th 2020 in #lobsters on freenode. They were doing a system upgrade and providing a report by using `watch` to `cat` together a HTML header and footer with `mysql -e ‘select * from information_schema.processlist’` to provide a status report. Thought that was a neat hack.
Plain JavaScript can do a lot!
Today I saw on r/programming a post by Julia Evans titled A little bit of plain JavaScript can do a lot. She discusses some of JavaScript’s more powerful contemporary features.
HTML forms
Found a cool series of articles: How to Build HTML Forms Right. Only the first two of five articles have been published so far, but I’m looking forward to the next three. The articles are about how to do forms right in HTML 5.
The articles are rich with links, click through for heaps of info. Some things that I found:
Making vertical-align work for table cells
See Understanding vertical-align, or “How (Not) To Vertically Center Content”. Just in case this ever vanishes it is cached here: https://www.jj5.net/file/2018-08-09-193156/vertical-align.html
HTML <table> CSS width not working
If your table isn’t automatically adjusting to the width specified by your CSS, make sure you haven’t set display: inline-block; on the <table> element.
window.resizeTo( … )
See here:
- You can’t resize a window or tab that wasn’t created by window.open.
- You can’t resize a window or tab when it’s in a window with more than one tab.
- Also, even if you create window by window.open(…) it is not resizable by default …see 4.
- To make window created by window.open() resizable, you must open it with resizable feature
myExternalWindow = window.open("http://example.com", "myWindowName", "resizable"); myExternalWindow.resizeTo(500,500); //resize window to 500x500
Input keyboard for decimal input on iPhone
So I needed to adjust a value (the odds of a horse winning a race) that has a fractional part and an integer part (i.e. a ‘double’, or ‘float’). The standard numeric input on an iPhone doesn’t include a decimal point, so I needed to trigger a different input device.
I ended up with this:
<input type="number" pattern="[\d\.]*" step="0.01" inputmode="numeric">
HTML glow effects
Found some cool glow effects. Couldn’t actually get them to work in my context, but it’s the thought that counts.
Passing selected value into HTML select onchange handler
So you have a <select> element and you want to call a handler, but you need to pass the selected value to the handler because you have multiple instances of the same <select> and can’t access them by ID (because there is many, one of which will have the new selected value, but you don’t know which). The solution is to pass in the newly selected value, like this:
<select onchange='handle_change( this.value )'>
Easy-peasy!