Search results
Results from the WOW.Com Content Network
Style your radio button and also Include a label for content. Change the outer rim color and/or checked circle to any color you like. Give it a transparent look with modifications to background color property and/or optional use of the opacity property. Scale the size of your radio button.
CSS to make standard radio button vanish on screen and superimpose custom button image: input[type="radio ...
This css seems to do the trick: input[type=radio] {. border: 0px; width: 100%; height: 2em; } Setting the border to 0 seems to allow the user to change the size of the button and have the browser render it in that size for eg. the above height: 2em will render the button at twice the line height.
It's the margin-top:-1px; that's the extra sauce that gets my vote. I have a radio inside a span I'm using as a button. putting only the vertical-align for the radio style puts the radio just crossing the bottom of the span. putting the vertical-align in the span style leaves the button at the top.
2. Unfortunately you can't style radio buttons directly in any browser. The way to do it is to use <label> elements with properly set for attributes, then hide the radio button itself using visibility: hidden rather than display: none. You can then position the labels wherever you want and they will act as radio buttons.
This makes the "second" radio button selected on loading the page. EDIT: Since AngularJS 2.x The above approach does not work if you're using version 2.x and above.
If you still want to use all the browser's native support for radios and check boxes, like moving between them with ↑ and ↓ keys, set the css to: position: fixed; opacity: 0; pointer-events: none; This will keep all functionality but keep the input hidden, and won't take up any layout space.
I wasn't able to reproduce your problem in Google Chrome 4.0, IE8, or Firefox 3.5 using that code. The label and radio button stayed on the same line. Try putting them both inside a <p> tag, or set the radio button to be inline like The Elite Gentleman suggested.
I'd suggest using <label> elements, though. In doing so, clicking on the label will check the element too. Either associate the <label>'s for attribute with the <input>'s id:
@naughtilus - this answer totally obviates the simple answer's limitation, because it explicitly defines the styles for each option. i.e. Mine constrains you to having a structure convention; this one constrains you to writing css for every radio button and result. –