Reputation: 4098
I am currently learning html/css and would like to develop my first web form. However, I am having issues placing my radio buttons next to the associated label.
Here is my jsfiddle
I assume I have to create a .radio style in my css. However, I am not certain what to do.
<form id="contactform" class="rounded" method="post" action="">
<h3>Equipment Procurement Form</h3>
<p>Use this form to submit requests to Medical Physics for new equipment</p>
<div class="field">
<label for="Directorate">Directorate</label>
<input type="text" class="input" name="Directorate" id="Directorate" />
<p class="hint">Enter your directorate.</p>
</div>
<div class="field">
<label for="Department">Department:</label>
<input type="text" class="input" name="Department" id="Department" />
<p class="hint">Enter your department.</p>
</div>
<div class="field">
<label for="Request">Equipment Requested:</label>
<textarea class="input textarea" name="Request" id="Request"></textarea>
<p class="hint">Summarise equipment request..</p>
</div>
<div class="radio">
<input id="Capital" type="radio" name="Capital" value="Capital">
<label for="Capital">Capital
<span class="small">>£5000 (inc VAT)</span></label>
<input id="Capital" type="radio" name="Capital" value="Revenue">
<label for="Capital">Revenue
<span class="small"><£5000 (inc VAT)</span></label>
</div>
<input type="submit" name="Submit" class="button" value="Submit" />
</form>
Upvotes: 0
Views: 364
Reputation:
<form id="contactform" class="rounded" method="post" action="">
<h3>Equipment Procurement Form</h3>
<p>Use this form to submit requests to Medical Physics for new equipment</p>
<div class="field">
<label for="Directorate">Directorate</label>
<input type="text" class="input" name="Directorate" id="Directorate" />
<p class="hint">Enter your directorate.</p>
</div>
<div class="field">
<label for="Department">Department:</label>
<input type="text" class="input" name="Department" id="Department" />
<p class="hint">Enter your department.</p>
</div>
<div class="field">
<label for="Request">Equipment Requested:</label>
<textarea class="input textarea" name="Request" id="Request"></textarea>
<p class="hint">Summarise equipment request..</p>
</div>
<div class="radio">
<label><input id="Capital" type="radio" name="Capital" value="Capital">
Capital
<span class="small">>£5000 (inc VAT)</span></label>
<label>
<input id="Capital" type="radio" name="Capital" value="Revenue">
Revenue
<span class="small"><£5000 (inc VAT)</span></label>
</div>
<input type="submit" name="Submit" class="button" value="Submit" />
Upvotes: 1
Reputation: 9923
You put the radio buttons outside of the label, it will hold them together if you put them in.
<div class="radio">
<label for="Capital">Capital
<input id="Capital" type="radio" name="Capital" value="Capital">
<span class="small">>£5000 (inc VAT)</span></label>
<label for="Capital">Revenue
<input id="Capital" type="radio" name="Capital" value="Revenue">
<span class="small"><£5000 (inc VAT)</span></label>
</div>
Upvotes: 1
Reputation: 641
Refer this http://jsfiddle.net/3sPNH/13/ . I hope this is how you want. Just placed the input
inside.
Upvotes: 2