Checkbox and label not indented properly

Just need to get the checkbox and label to be on the same line and indented properly.

Any help is greatly appreciated :)

See the code:

<head runat="server">
    <title></title>

    <style type="text/css">
        #cbRedeem {
        display: none;
        }
        #cbRedeem + label
        {
            float: left;
            width: 50px;
            height: 50px;
            background: url('Image/Control/checkbox_unchecked.jpg');
            background-repeat: no-repeat;
   
        }
        #cbRedeem:checked + label  
        {
            float: left;
            width: 50px;
            height: 50px;
            background: url('Image/Control/checkbox_checked.jpg');
            background-repeat: no-repeat;
        }    
    </style>

</head>
<body>
   
    <form id="form1" runat="server">
   
    <asp:CheckBox ID="cbRedeem" runat="server" Text="blah blah blah" Checked="false" AutoPostBack="true" Font-Bold="true" />
    <label for="cbRedeem"></label><br />
   
    </form>
</body>
checkbox-not-indented.jpg
tangteng78Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
You should really post your rendered code and not your asp code.  If there is an error in your rendered code, you can always figure out how to back that out.

Without any css, everything lines up.  Perhaps you can post a link to your sample page to look at.

Also, make sure you are applying your css to classes and not id's. There can only be one ID but you can have multiple classes.  I am not a .NET dev, but it seems a lot of people programming in .NET tend to repeat ID's and that can play havoc with your front end code.

http://jsbin.com/dujino/1/edit
<!DOCTYPE html>
<html>
<head>
  <style type="text/css">
    
    </style>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <form id="form1">
    
    <input type="checkbox" ID="cbRedeem" Text="blah blah blah"/>
    <label for="cbRedeem">blah blah blah</label>
    <br />
    <input type="checkbox" ID="cbRedeem" Text="blah blah blah"/>
    <label for="cbRedeem">blah blah blah</label>
    <br />
    <input type="checkbox" ID="cbRedeem" Text="blah blah blah"/>
    <label for="cbRedeem">blah blah blah</label>
    <br />
    </form>
</body>
</html>

Open in new window

0
tangteng78Author Commented:
Just checked. There is no repeated ids.

Here you go the actual page http://www.toypanic.com/testing1.aspx

Believe the culprit is the CSS. If someone able to help, it would be great.
0
Julian HansenCommented:
A) You seem to have two labels for the checkbox - one in the <span> and one after it

Otherwise just add padding left to your label

#cbRedeem + label {
  background: url("Image/Control/checkbox_unchecked.jpg") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
  float: left;
  height: 50px;
  width: 50px;
  padding-left:  30px; /* like so */
}

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Julian HansenCommented:
A) You seem to have two labels for the checkbox - one in the <span> and one after it
You can probably remove the following line from your source.
  <label for="cbRedeem"></label><br />

Open in new window

0
tangteng78Author Commented:
Right on.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.