Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Dec 2011
    Thanked 1 Time in 1 Post

    Radio button with <p> tag issue

    Hey all,

    I am pretty new to HTML and CSS and have been stuck on this problem for a few hours now. I created a multiple choice question using hmtl/javascript and everything seems to be working fine. The only issue is that the answers for the question are dynamically pulled from my companies course authoring tool. An example of an answer is <p>True</p>. The problem is the <p> tags around it. I can't get rid of them and they are causing the answer to be below the radio button. Here is an example line:

    <input type="radio" name="group1" value="1" class="answer" onclick="selectOption(value)" /><label for="Choice1"><p>this is the answer text</p></label><br />
    Does anyone know how I can still have the <p> tags and get the text to be on the same line as the radio button? Any hep would be greatly appreciated.


  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Thanked 1,847 Times in 1,831 Posts
    Hello ballaby,
    I imagine default styling on the paragraph tag is messing up your form box? Add something like this to your CSS to zero it out -

    That will remove the default 16px top and bottom margin on the p tag.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts