CSS: how to make label appear right of the radio?


Tags: css,radio-button

Problem :

Say I have the following mark up:

<label for="name">Name:</label>
<input type="radio" name="name" id="name"/>

The order of the tags appear to be proper to me (in a semantic sense: label before the thing you're labeling). But I want to display this as radio button first, followed by the label. How can I do that in CSS?



Solution :

You don't need CSS. Wrap your input in a label and put the text last.

<label><input type="radio" name="name" id="name"/>Name:</label>

Is that still semantic for you?

Or you could try the float.


    CSS Howto..

    How to set two values for one css property?

    How to disable a CSS class with javascript on window.load()

    How to pass a css % parameter in javascript/jquery

    Rails 4: How to style navigation for current page using jQuery

    How to change floating div's width to fill all the space they occupy?

    How to design a cross client / browser compatible email?

    How to make a width binding in CSS

    CSS/Javascript show image remove x on mouseover/hover

    How can I centre an unordered list of floated items to the page

    How to get an ellipsis to display on text in CSS

    Basic CSS: When applying effects to images in CSS, how do you exclude the banner image?

    Css, text shadow - How to get it overflow off the div

    How do I make a dedicated row for javascript alerts?

    How can I turn off hardware acceleration for certain HTML elements via CSS?

    How to center this flip card example?

    How can I move this box in this HTML/CSS file?

    How to delay a hyperlink until a CSS animation ends?

    How to create a top-footer and footer using foundation, just like foundation website

    How are new lines made with text as background?

    How can I use CSS to select the “a” tag in the following layout?

    How to make html button look pressed in using css?

    Position:Absolute; Div is making the page too wide and adding blank space to the side. How do I reduce its size?

    How to utilize CSS only button markup?

    How to Minify CSS to its Absolute Minimalistic Essence?

    How to make the effects of jQuery's $(element).css() persistent?

    How can i Split Menu Bar in two lines

    How can I dynamically change element's width related with parent width using only CSS? [closed]

    How to create circle image and text Which are complementary to each other in bootstrap or pure css?

    How to delete the gap

    How do you add PHP to CSS?