How to style a checkbox after it is checked? - html

react.js
<div className='check'>
<input
type='checkbox'
className='checkbox'
id='termschkbx'
// style={{backgroundColor: "#DE1F48", color: "#30333F"}}
checked={this.state.isChecked}
// onClick={this.isClicked}
onChange= {this.isChecked}
>
</input>
<span>I agree to Terms & Conditions.<a href="" className='readme'>Read here</a> </span>
</div>
style.css
.checkbox{
top: -2px;
left:-45px;
width: 21px;
height: 21px;
opacity: 1;
display: inline-block;
margin-left:12px;
position: absolute;
}
.checkbox::after{
background: #DE1F48;
color: #30333F;
}
.checkbox:checked{
background: #DE1F48;
color: #30333F;
}
.checkbox input[type=checkbox]:checked {
background: #DE1F48;
color: #30333F;
}
nothing reflects on my checkbox after it is clicked. what can be done?
I even tried inline styling. That didn't work as well.
i did research about this, there were a lot of similar questions about this but nothing worked for me. I'm a new coder so excuseme if this is silly

Use input[type="checkbox"]:checked. This selects checkboxes that are checked.
Here's how to use it:
If the snippet is unavailable, use this JSFiddle link.
input[type=checkbox] {
height:0px;
width:0px;
}
input[type=checkbox]::after {
height:12px;
width:12px;
content:"\00a0\00a0\00a0\00a0";
border:1px solid black;
}
/* The magic below */
input[type=checkbox]:checked::after {
height:12px;
width:12px;
background-color:cyan;
content:"✓";
border:1px solid black;
}
<input type="checkbox" id="first" />
<label for="first" id="first">Here! A Checkbox!</label>
It also works for radio buttons:
input[type="radio"] {
width:0px;
height:0px;
}
input[type="radio"]::after {
content:"\00a0\00a0\00a0\00a0";
border-radius:5px;
height:10px;
width:10px;
position:absolute;
border:1px solid black;
display:inline;
}
input[type="radio"]:checked::after {
content:"✓";
background-color:#00ffff;
}
<div>
<input type="radio" name="radio" id="one" />
<label for="one">Option 1</label>
</div>
<hr>
<div>
<input type="radio" name="radio" id="two" />
<label for="two">Option 2</label>
</div>
<hr>
<div>
<input type="radio" name="radio" id="three" />
<label for="three">Option 3</label>
</div>

Related

How to highlight the color once selected?

I have given focus and active property to input but it doesn't work. After the selection of any color, it doesn't highlight. Hover property is working though.
Below is the code I used to show highlight property for color.
.highlightC:focus,
.highlightC:focus-visible,
.highlightC:visited {
border: 2px solid orange!important;
}
.highlightC:hover,
.highlightC:active {
border: 2px solid white;
}
.highlightC {
height: 20px;
width: 20px;
border-radius: 50%;
display: inline-block;
border: 2px solid transparent;
}
.color1 {
background-color: red;
}
.color2 {
background-color: green;
}
.color3 {
background-color: blue;
}
<div class="text-left mt-2">
<p class="tpColorsHeading ">Available colors</p>
<input type="radio" id="1" name="color" value="1" class="">
<label for="1" class="dot color1 highlightC"></label>
<input type="radio" id="2" name="color" value="2" class="">
<label for="2" class="dot color2 highlightC"></label>
<input type="radio" id="3" name="color" value="3" class="">
<label for="3" class="dot color3 highlightC"></label>
</div>
Your issue is that you check the label for :active status. That status only works for Elements like Links.
I commented the Code where i made changes
also see the following links to help you understand why you have to access it this way and why your attempt didnt get any results:
How to style radio-buttons
operators to affect other elements(the + operator in my example)
/*active is only working for links, not label elements*/
.highlightC:hover {
border: 2px solid white;
}
/*you can style the border by checking the status of the input, + as an oeprator affects the next following label after clicking any radio button in this case, so it only works if the label comes after the radio-button in your dom*/
.text-left input[type="radio"]:checked+label {
border: 2px solid white;
}
/*what are you trying to achieve with this? Visited also only works for links*/
.highlightC:focus,
.highlightC:focus-visible,
.highlightC:visited {
border: 2px solid orange!important;
}
.highlightC {
height: 20px;
width: 20px;
border-radius: 50%;
display: inline-block;
border: 2px solid transparent;
}
.color1 {
background-color: red;
}
.color2 {
background-color: green;
}
.color3 {
background-color: blue;
}
<div class="text-left mt-2">
<p class="tpColorsHeading ">Available colors</p>
<input type="radio" id="1" name="color" value="1" class="">
<label for="1" class="dot color1 highlightC"></label>
<input type="radio" id="2" name="color" value="2" class="">
<label for="2" class="dot color2 highlightC"></label>
<input type="radio" id="3" name="color" value="3" class="">
<label for="3" class="dot color3 highlightC"></label>
</div>
You could use the :checked pseudo class selector in combination with the + adjacent sibling combinator:
.color-input {
display: none;
}
.color-input:checked + .color-label {
border-color: orange;
}
.color-label {
height: 20px;
width: 20px;
border-radius: 50%;
display: inline-block;
border: 2px solid transparent;
}
.color-label--red {
background-color: red;
}
.color-label--green {
background-color: green;
}
.color-label--blue {
background-color: blue;
}
<fieldset>
<legend>Available colors</legend>
<input type="radio" id="1" name="color" value="1" class="color-input">
<label for="1" class="color-label color-label--red"></label>
<input type="radio" id="2" name="color" value="2" class="color-input">
<label for="2" class="color-label color-label--green"></label>
<input type="radio" id="3" name="color" value="3" class="color-input">
<label for="3" class="color-label color-label--blue"></label>
</fieldset>
I think you need to make CSS for checked radio button.
This is the solution for the issue you are facing now:
input[type="radio"] {
display: none;
}
.highlightC {
height: 20px;
width: 20px;
border-radius: 50%;
display: inline-block;
margin: 3px;
box-shadow: 0px 0px 0px 2px transparent;
}
input[type="radio"]:checked+.highlightC {
box-shadow: 0px 0px 0px 2px darkorange;
}
.color1 {
background-color: red;
}
.color2 {
background-color: green;
}
.color3 {
background-color: blue;
}
<div class="text-left mt-2">
<p class="tpColorsHeading ">Available colors</p>
<input type="radio" id="1" name="color" value="1" class="">
<label for="1" class="dot color1 highlightC"></label>
<input type="radio" id="2" name="color" value="2" class="">
<label for="2" class="dot color2 highlightC"></label>
<input type="radio" id="3" name="color" value="3" class="">
<label for="3" class="dot color3 highlightC"></label>
</div>
Yuo have to insert the css class name (highlightC) in the property class="" like this:
class="highlightC"

HTML buttons not appearing/elements stacked on each others

I followed a tutorial for a form(to make it look more professional) and I've followed each and every step carefully(I f#cked up something tho, I can't find it) and now all of my "fields" are stacked on each other. I have a php page that I make a form on and then if all the info is filled in and the user presses the "submit" button then it should send it to my and their email. It worked but when I started to follow this tutorial/guide the button disappeared, when I tried to find it on the page I couldn't see it/click it or anything. With some tricks I could see the outline of the button but not the actual button(there is a function in opera and I think many other browsers that while browsing through the elements on the page if you click on one of them in the source it highlights it on the page). The following is the source code, the only thing I want is the button to appear under the text fields and the text fields not to be stacked on top of each other, I'll only be including the html and not the php code for the smtp.
<!DOCTYPE html>
<html>
<head>
<title>Enroll</title>
<link rel="icon" href="mail.png">
</head>
<style>
body{
background-color: white;
font-family: sans-serif;
justify-content:space-around;
align-items:center;
flex-direction:column;
height:100%;;
}
.form{
overflow:hidden;
width:75%;
position:absolute;
left:10%;
transition: all 0.3 ease;
height:50px;
}
.form label{
position:absolute;
bottom: 0px;
left: 0px;
width: 100%;
height: 100%;
pointer-events: none;
border-bottom: 1px solid black;
transition: 0.3 ease;
}
.form label::after{
content: "";
position:absolute;
left:0px;
buttom:0px;
height:100%;
width:100%;
border-bottom: 3px solid #5fa8d3;
transform translateX(-100%);
}
.button{
width:400px;
height:30px;
background-color:blue;
}
.form input{
width:100%;
height:100%;
color: #595f6e;
padding-top: 20px;
border: none;
transition: 0.3s ease;
}
.content-name {
position:absolute;
bottom:5px;
left:0px;
transition: all 0.3 ease;
}
.form input:focus + .label-name .content-name,
.form input:valid + .label-name .content-name {
transform: translateY(-150%);
font-size: 14px;
color: #5fa8d3;
}
.form input:focus{
}
</style>
<body>
<div align="center">
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<form class="form" action="" method="post">
<input type="text" name="email" required />
<label for="email" class="label-name">
<span class="content-name">Email</span>
</label>
<br>
<input type="text" name="first_name" required />
<label for="first_name" class="label-name">
<span class="content-name">First Name</span>
</label>
<br>
<input type="text" name="last_name">
<label for="last_name" class="label-name">
<span class="content-name">Last Name</span>
</label>
<br>
<br>
<input style="color:blue;" onClick="return empty()" type="submit" name="submit" value="Submit"></br>
</form>
</div>
</body>
</html>
They are all stacking because you use position:absolute on <label> without proper parent reference on where they should be positioned. Try wrapping them with <div> like the example below, and add position:relative to that div
<!DOCTYPE html>
<html>
<head>
<title>Enroll</title>
<link rel="icon" href="mail.png">
</head>
<style>
body{
background-color: white;
font-family: sans-serif;
justify-content:space-around;
align-items:center;
flex-direction:column;
height:100%;;
}
.form{
overflow:hidden;
width:75%;
position:absolute;
left:10%;
transition: all 0.3 ease;
height:50px;
display: flex;
}
.form .field {
position: relative;
}
.form label{
position:absolute;
bottom: 0px;
left: 0px;
width: 100%;
height: 100%;
pointer-events: none;
border-bottom: 1px solid black;
transition: 0.3 ease;
}
.form label::after{
content: "";
position:absolute;
left:0px;
buttom:0px;
height:100%;
width:100%;
border-bottom: 3px solid #5fa8d3;
transform translateX(-100%);
}
.button{
width:400px;
height:30px;
background-color:blue;
}
.form input{
width:100%;
height:100%;
color: #595f6e;
padding-top: 20px;
border: none;
transition: 0.3s ease;
}
.content-name {
position:absolute;
bottom:5px;
left:0px;
transition: all 0.3 ease;
}
.form input:focus + .label-name .content-name,
.form input:valid + .label-name .content-name {
transform: translateY(-150%);
font-size: 14px;
color: #5fa8d3;
}
.form input:focus{
}
</style>
<body>
<div align="center">
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<form class="form" action="" method="post">
<div class="field">
<input type="text" name="email" required />
<label for="email" class="label-name">
<span class="content-name">Email</span>
</label>
</div>
<br>
<div class="field">
<input type="text" name="first_name" required />
<label for="first_name" class="label-name">
<span class="content-name">First Name</span>
</label>
</div>
<br>
<div class="field">
<input type="text" name="last_name" />
<label for="last_name" class="label-name">
<span class="content-name">Last Name</span>
</label>
</div>
<br>
<br>
<input style="color:blue;" onClick="return empty()" type="submit" name="submit" value="Submit"></br>
</form>
</div>
</body>
</html>

problem using with valid/invalid pseudoclass

I am trying to make a form using HTML and CSS only. The problem is i am using valid pseudo-class to just give animation, but when it is invalid it mixes up with the label. the code will be at https://codepen.io/hardik-g1/pen/mdVzMyL and if you don't get please try this type number in name field you will see the problem.
code:
<div id="fle">
<div class="container">
<h2 id="aa">HACKATHON REGISTRATION</h2>
<form action="">
<div class="group">
<input type="text" value="" pattern="[a-zA-z]+" required title="No numbers or special characters allowed">
<label class="set">First Name</label>
</div>
<div class="group">
<input type="text" value="" pattern="[a-zA-z]+" required title="No numbers or special characters allowed">
<label class="set">Last Name</label></p>
</div>
<div class="group">
<input type="email" value="" required>
<label class="set">Email</label>
</div>
<div class="group">
<input type="number" value="" required pattern="[0-9].{10}" title="Enter correct mobile number">
<label class="set">Mobile number</label>
</div>
<div class="group">
<p>Branch</p>
<select name="branch" id="" required><option value=" ">Please select your branch</option><option value="cs">Computer Science</option>
<option value="it">Information Technology</option>
</select>
</div>
<div class="group"><p>Do you have participated before?</p>
Yes<input id="a" type="radio" name="hosting" value="yes">
No<input type="radio" id="a" name="hosting" value="no">
</div>
<div class="group" id="c">
<p>Project Description</p>
<textarea name="comment" placeholder="Write Here" rows="4" cols="40" required></textarea>
</div>
<input id="b" type="checkbox" id="Agree" name="agree" value="yes" required> Click here to agree to all the information above is true.
<p><button class="button" type="submit"><span>Register</span></button></p>
</form>
</div>
<div>
<video id="video" width="860" onclick="play();">
<source type="video/webm" src="https://res.cloudinary.com/iatneh/video/upload/v1594920650/Virtual_Hackathon_copy_-_Biteable_kmyhcp.mp4"/>
</video>
<h1>Click on it to play</h1>
<p>All validations show when submitted</p>
</div>
</div>
CSS
#fle{
display:flex;
}
body{
color:#999;
}
#aa{
color:black;
}
#b{
width: 12.5px;
margin:0;
}
#c{
margin:10px 0;
}
#a{
width:30px;
color:#999;
}
select{
width: 300px;
height: 30px;
}
.container {
font-family:'Roboto';
width:600px;
background:#FFF;
padding:10px 50px 50px;
}
.group {
position:relative;
margin-bottom:30px;
}
input {
font-size:18px;
padding:10px 10px 10px 5px;
width:300px;
border:none;
border-bottom:1px solid #757575;
}
input:focus{ outline:none; }
label {
color:#999;
font-size:18px;
font-weight:normal;
position:absolute;
pointer-events:none;
left:5px;
top:10px;
transition:0.2s ease all;
}
input:focus ~ label, input:valid ~ label {
top:-20px;
font-size:14px;
color:#5264AE;
}
input:invalid ~ label{
opacity:0.4;
}
.button {
border-radius: 4px;
background-color: #f4511e;
border:None;
color: #FFFFFF;
text-align: center;
font-size: 14px;
padding: 10px;
width: 100px;
transition: all 0.5s;
cursor: pointer;
margin: 5px;
}
.button span {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}
.button span:after {
content: '\00bb';
position: absolute;
opacity: 0;
top: 0;
right: -20px;
transition: 0.5s;
}
.button:hover span {
padding-right: 25px;
}
.button:hover span:after {
opacity: 1;
right: 0;
}
You can listen to input changes and if it has a value inside add a class to keep the label floating.
Here is a sample you can modify and use it in your code (it will keep the .floating class on label as long has the input has content in it):
function checkForInput(element) {
const $label = $(element).siblings('label');
if ($(element).val().length > 0) {
$label.addClass('floating');
} else {
$label.removeClass('floating');
}
}
$('input.input').on('change keyup', function() {
checkForInput(this);
});
label.floating {
color:#5264AE;
/* use styles for floating your labels here */
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="wrapper">
<input type="text" name="some-name" class="input" />
<label class="input-label" for="textdemo">label</label>
</div>

How to replace radio button with unicode character?

This is my fiddle: http://jsfiddle.net/a3ft0b0k/
How do I make the unicode characters beside each radio button act like radio button and in other word, change the default radio button style to the unicode?
HTML
<ul class="small-block-grid-2 medium-block-grid-2 large-block-grid-2">
<li>
<input type="radio" name="good_bad" value="good" style="visibility:none;"><div style="border:1px solid #00FF00;border-radius:16px;padding:0.5px;font-size:2.5em;color:#00FF00;">☺</div>
</li>
<li>
<input type="radio" name="good_bad" value="bad" style="visibility:none;"><div style="border:1px solid #FF0000;border-radius:16px;padding:0.5px;font-size:2.5em !important;color:#FF0000;">☹</div>
</li>
</ul>
Not sure if I understand it correctly but how about this:
<ul class="small-block-grid-2 medium-block-grid-2 large-block-grid-2">
<li>
<label><div style="border:1px solid #00FF00;border-radius:16px;padding:0.5px;font-size:2.5em;color:#00FF00;"><input type="radio" name="good_bad" value="good" style="visibility:none;">☺</div></label>
</li>
<li>
<label><div style="border:1px solid #FF0000;border-radius:16px;padding:0.5px;font-size:2.5em !important;color:#FF0000;"><input type="radio" name="good_bad" value="bad" style="visibility:none;">☹</div></label>
</li>
</ul>
How about this?
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
html{
font-size:11px;
}
form select, form input[type="text"]{
padding:3px 5px;
border-radius:4px;
border:1px solid #ccc;
line-height:1;
font-size:2rem;
box-sizing: border-box;
font-weight:300;
}
input[type="checkbox"],input[type="radio"]{
-webkit-appearance:none;
-moz-appearance:none;
appearance:none;
line-height:1;
font-size:2rem;
margin-right:0px;
box-sizing: border-box;
font-weight:300;
outline:none;
}
input[type="checkbox"]:focus,input[type="radio"]:focus{
outline:none;
}
input[type="checkbox"]:after, input[type="radio"]:after{
font-size:inherit;
cursor:pointer;
padding:3px 5px;
margin-right:0px !important;
border-top-left-radius:4px;
border-bottom-left-radius:4px;
border:1px solid #ccc;
border-right:0px;
line-height:1;
box-sizing: border-box;
font-weight:300;
}
input[type="checkbox"]:after{
content:"\2610";
}
input[type="checkbox"]:checked:after{
content:"\2611";
}
input[type="radio"]:after{
content:"\25CE";
}
input[type="radio"]:checked:after{
content:"\25C9";
}
input[type="checkbox"] + label[for],input[type="radio"] + label[for]{
cursor:pointer;
padding:3px 5px;
margin: 3px 0px 0px 0px;
border-top-right-radius:4px;
border-bottom-right-radius:4px;
border:1px solid #ccc;
border-left:0px;
margin-left:0px !important;
line-height:1;
font-size:2rem;
box-sizing: border-box;
font-weight:300;
}
::placeholder{
color:rgba(0,0,0,0.1);
}
</style>
</head>
<body>
<form>
<select><option>1</option><option>2</option></select>
<input type="text" placeholder="text" />
<input type="checkbox" id="c" /><label for="c">Check me</label>
<input type="radio" name="r" value="1" id="r1" /><label for="r1">option 1</label>
<input type="radio" name="r" value="2" id="r2" /><label for="r2">option 2</label>
</form>
</body>
</html>
How about this?
It uses existing Unicode characters for radio-buttons and checkboxes (checkboxes have at least a couple of options for checked boxes, radio-buttons—currently—have no unchecked character, so a circle is used). It uses the :before and :content CSS selectors and attributes to style the labels for the input elements and just hides the input elements themselves (clicking the labels will toggle the inputs).
input[type="radio"],
input[type="checkbox"] {
display: none;
}
input[type="radio"] + label,
input[type="checkbox"] + label {
width: 40px;
height: 40px;
display: block;
font-size: 32px;
}
input[type="radio"] + label::before {
content: "🔵";
}
input[type="checkbox"] + label::before {
content: "☐";
color: DodgerBlue;
font-size: 40px;
}
input[type="radio"]:checked + label::before {
content: "🔘";
}
input[type="checkbox"]:checked + label::before {
content: "☒"; /* or ☑ */
}
<input id="a" type="radio" name="gb" value="good1" style="visibility:none;"><label for="a">A</label>
<input id="b" type="radio" name="gb" value="bad1" style="visibility:none;"><label for="b">B</label>
<input id="c" type="checkbox" name="gb" value="good" style="visibility:none;"><label for="c">C</label>
<input id="d" type="checkbox" name="gb" value="bad2" style="visibility:none;"><label for="d">D</label>

Radio button background only with CSS?

What I need to do is to replace the look of the radio button with image. That can be easily achieved with jQuery, but it this case I need to do it with CSS only. Is there any way to do that? Here is my HTML:
<div class="radio-buttons">
<div class="holder">
<span></span>
<input type="radio" class="radio" id="cheetah" value="" />
</div>
<div class="holder">
<span></span>
<input type="radio" class="radio" id="horse" value="" />
</div>
<div class="holder">
<span></span>
<input type="radio" class="radio" id="lion" value="" />
</div>
</div>
I've tried to apply a style background-image: on the radio button, but of course it didn't work. Then I added the <span>'s and I am wonderig if I can set style to the buttons display: none , and somehow on input:checked to display the <span> which will be styled with background-image: ? Is this the right way or I am on completely wrong direction? And can it be achieved with CSS only at all ?
Edit: the radio buttons might be changed to checkboxes if needed.
As Dominik said that is almost the way to achieve this. May be his code is for a specific case, and I found something similar but much simple than that. I had to make list of photos, and on click of a photo, it must display the clicked photo, but larger and in section after the list. That's why it didn't work with me. But I will first explain everything and then I will paste my code.
The Dominic code will work only if the label is next to the radio-button. It didn't work for me because I have my <label>'s separated from the radio-buttons. Labels are in <ul> and the radio-buttons are in <div> after the <ul>. That way it doesn't work and that's why I needed to add another same <label> next to each radio-button. Now I had two labels for 1 radio button. So here is my entire code. I had styled the ul labels inline just to save some space in the css. I made it with bg-color so if someone want to try ... it works fine with bg-image too
HTML:
<div class="shell">
<form>
<ul>
<li><label class="label" for="cheetah" style="background-color: white"></label></li>
<li><label class="label" for="horse" style="background-color: yellow"></label></li>
<li><label class="label" for="lion" style="background-color: green"></label></li>
<li><label class="label" for="squirrel" style="background-color: red"></label></li>
<li><label class="label" for="tiger" style="background-color: purple"></label></li>
<li><label class="label" for="bear" style="background-color: black"></label></li>
</ul>
<div class="radio-buttons">
<div class="wrapper">
<input type="radio" name="radio" class="radio" id="cheetah" value="" />
<label class="label" for="cheetah" ></label>
</div>
<div class="wrapper">
<input type="radio" name="radio" class="radio" id="horse" value="" />
<label class="label" for="horse" ></label>
</div>
<div class="wrapper">
<input type="radio" name="radio" class="radio" id="lion" value="" />
<label class="label" for="lion" ></label>
</div>
<div class="wrapper">
<input type="radio" name="radio" class="radio" id="squirrel" value="" />
<label class="label" for="squirrel"></label>
</div>
<div class="wrapper">
<input type="radio" name="radio" class="radio" id="tiger" value="" />
<label class="label" for="tiger"></label>
</div>
<div class="wrapper">
<input type="radio" name="radio" class="radio" id="bear" value="" />
<label class="label" for="bear" ></label>
</div>
</div>
</form>
</div>
CSS:
*{ margin: 0; padding: 0; }
.shell { width: 1000px; margin: 0 auto; }
ul { height: 150px; list-style: none; padding-bottom: 50px; }
ul li {
float: left;
border: 1px solid #666;
margin-right: 14px;
}
ul li label {
display: block;
width: 150px;
height: 150px;
cursor: pointer;
}
ul label {
display: inline;
}
input[type="radio"] {
display: none;
}
input[type="radio"]:checked + label.label {
border: 1px solid red;
background-repeat: no-repeat;
display: inline-block;
height: 500px;
width: 500px;
}
input[type="radio"]:checked + label[for="cheetah"] {
background-color: white
}
input[type="radio"]:checked + label[for="horse"] {
background-color: yellow
}
input[type="radio"]:checked + label[for="lion"] {
background-color: green
}
input[type="radio"]:checked + label[for="squirrel"] {
background-color: blue
}
input[type="radio"]:checked + label[for="tiger"] {
background-color: purple
}
input[type="radio"]:checked + label[for="bear"] {
background-color: black
}
As described in the Link I provided in the comment, you can use the following html:
<input type="radio" id="radio-2-1" name="radio-2-set" class="regular-radio big-radio" /><label for="radio-2-1"></label><br />
<input type="radio" id="radio-2-2" name="radio-2-set" class="regular-radio big-radio" /><label for="radio-2-2"></label><br />
together with the css similar to:
.regular-radio {
display: none;
}
.regular-radio + label {
-webkit-appearance: none;
background-image: url("unchecked.png");
padding: 9px;
border-radius: 50px;
display: inline-block;
position: relative;
}
.regular-radio:checked + label:after {
content: ' ';
width: 12px;
height: 12px;
border-radius: 50px;
position: absolute;
top: 3px;
background-image: url("checked.png");
box-shadow: inset 0px 0px 10px rgba(0,0,0,0.3);
text-shadow: 0px;
left: 3px;
font-size: 32px;
}
.regular-radio:checked + label {
background-image: url("checked.png");
border: 1px solid #adb8c0;
box-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0px -15px 10px -12px rgba(0,0,0,0.05), inset 15px 10px -12px rgba(255,255,255,0.1), inset 0px 0px 10px rgba(0,0,0,0.1);
}
Block-level HTML elements have a few restrictions:
They must be separated from surrounding text by blank lines.
The begin and end tags of the outermost block element must not be indented.
Markdown can't be used within HTML blocks.