HTML CSS examples for CSS Widget:Image Text
Putting text on top of images
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #selector {<!-- ww w . ja v a 2 s .c o m--> width:6vw; vertical-align:middle; } input[type="radio"] { display:none; } input[type="radio"]:checked + image { border:3px solid Chartreuse; } label { display:inline-block; } label span { display:block; position:relative; bottom:-21px; } </style> </head> <body> <label> <span>Lorem</span> <input type="radio" name="amount" value="100" checked> <img id="selector" src="https://www.java2s.com/style/demo/InternetExplorer.png">Lorem</label> <label> <span>Lorem</span> <input type="radio" name="amount" value="250"> <img id="selector" src="https://www.java2s.com/style/demo/Firefox.png">Lorem</label> <label> <input type="radio" name="amount" value="500"> <img id="selector" src="https://www.java2s.com/style/demo/Opera.png">Lorem</label> <label> <input type="radio" name="amount" value="1000"> <img id="selector" src="https://www.java2s.com/style/demo/Opera.png">Lorem </label> <label> <input type="radio" name="amount" value="1500"> <img id="selector" src="https://www.java2s.com/style/demo/Safari.png">Lorem </label> </body> </html>