• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Radio buttons all on one line

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Radio buttons all on one line

    OK little html css pop quiz for anyone that's up for it.

    [Read I've spent all evening messing to get precisely nowhere]

    I want, two radio buttons, with corresponding labels, in a frameset, all on one line.

    That's it. Nothing more.

    So that's

    (.) Some label (.) Some other label

    What I get is

    (.) (.) Some label Some other label

    No matter what I try.

    In desperation I switched to <ul> but got the same end result. Both in FF and IE10.

    Knock first as I might be balancing my chakras.

    #2
    42 views and no suggestions?

    Think of the kudos people?
    Knock first as I might be balancing my chakras.

    Comment


      #3
      Dunno if this is the best way, but it works.

      HTML Code:
      <label>No&nbsp;<input type="radio" name="suity" value="no"/></label>
      <label>Yes&nbsp;<input type="radio" name="suity" value="yes"/></label>
      Edit this Fiddle - jsFiddle

      Comment


        #4
        Originally posted by suityou01 View Post
        42 views and no suggestions?

        Think of the kudos people?
        Give us a chance - I was just having a fiddle.

        Comment


          #5
          Originally posted by mudskipper View Post
          Give us a chance - I was just having a fiddle.
          Surely its

          Code:
          <label><input type="radio" name="suity" value="no"  />No&nbsp;</label>
          <label><input type="radio" name="suity" value="yes"/>Yes&nbsp;</label>
          to get the text after the radiobutton.

          Are you sure you don't have other css adding a line break.
          merely at clientco for the entertainment

          Comment


            #6
            Thanks. Can I ask, where is the frameset in your examples?

            How to Create a Radio Button in an HTML5 Form - For Dummies

            See how this example works. I do the same and it goes all over the place.

            Technically I think labels and radios are "inline" by default so it should work "out of box".

            I observe differently though.

            Edit : Actually posting the html I am using may help those that have already been so kind as to offer a potential solution. Should have done this right at the start. Apologies.

            Code:
            <fieldset>
            		<legend>Data Entry</legend>
            		<p>
            			<input type = "radio" name = "standardentry" id = "standardentry" value = "standard" checked = "checked" />
            			<label for = "standardentry">Standard Entry</label>
            			<input type = "radio" name = "quickentry" id = "quickentry" value = "quick"/>
            			<label for = "quickentry">Quick Entry</label>
            		</p>
            </fieldset>
            Last edited by suityou01; 23 May 2013, 07:03.
            Knock first as I might be balancing my chakras.

            Comment


              #7
              Originally posted by mudskipper View Post
              Dunno if this is the best way, but it works.

              HTML Code:
              <label>No&nbsp;<input type="radio" name="suity" value="no"/></label>
              <label>Yes&nbsp;<input type="radio" name="suity" value="yes"/></label>
              Edit this Fiddle - jsFiddle
              I tried it in jsfiddle and it works ok.

              Clearly some residual css that's borked it. OK as you were folks, it's me being thick (again). I'll look at it tonight.

              Neat site btw
              Knock first as I might be balancing my chakras.

              Comment


                #8
                Originally posted by suityou01 View Post
                I tried it in jsfiddle and it works ok.

                Clearly some residual css that's borked it. OK as you were folks, it's me being thick (again). I'll look at it tonight.

                Neat site btw
                not quite you need to nest the input within the label tag not before or after it.

                Code:
                <fieldset>
                <legend>Data Entry</legend>
                
                <label for = "standardentry"><input type = "radio" name = "standardentry" id = "standardentry" value = "standard" checked = "checked" /> Standard Entry</label> 
                <label for = "quickentry"><input type = "radio" name = "quickentry" id = "quickentry" value = "quick"/> Quick Entry</label>
                
                </fieldset>
                merely at clientco for the entertainment

                Comment


                  #9
                  Originally posted by eek View Post
                  not quite you need to nest the input within the label tag not before or after it.

                  Code:
                  <fieldset>
                  <legend>Data Entry</legend>
                  
                  <label for = "standardentry"><input type = "radio" name = "standardentry" id = "standardentry" value = "standard" checked = "checked" /> Standard Entry</label> 
                  <label for = "quickentry"><input type = "radio" name = "quickentry" id = "quickentry" value = "quick"/> Quick Entry</label>
                  
                  </fieldset>
                  I thought that (but haven't tried it yet, so that's the first thing I will try tonight).

                  In all the examples I looked at the label superseded the input tag (not doubting you here) I just thought the "for" attribute in the label tag negated the need to nest.

                  In the example I tried on MSs jsfiddle, the tags were not nested but the desired result was displayed.
                  Knock first as I might be balancing my chakras.

                  Comment


                    #10
                    Originally posted by suityou01 View Post
                    I
                    In all the examples I looked at the label superseded the input tag (not doubting you here) I just thought the "for" attribute in the label tag negated the need to nest.
                    I believe you are right. "for" means the user can click on the label and access the control, so a useability thing.
                    +50 Xeno Geek Points
                    Come back Toolpusher, scotspine, Voodooflux. Pogle
                    As for the rest of you - DILLIGAF

                    Purveyor of fine quality smut since 2005

                    CUK Olympic University Challenge Champions 2010/2012

                    Comment

                    Working...
                    X