I know that this could be solved rather easily with JavaScript, but I am only thinking about a pure CSS Remedy.There are some drawbacks, for example insufficient legacy browser support, but this is undoubtedly one thing to very seriously think about using. Furthermore you can even now offer fallbacks for more mature browsers like so:Rational number