Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to disable text wrapping around checkbox

how can I prevent the text from wrapping around the checkbox? I need to align the text after the checkbox, and not under it. I know I'm not the first person to ask, but I cant seem to find a solution.

http://jsfiddle.net/csYPu/77/

.sign-newsletter {
padding:40px;
width:200px;
}

form li {display:inline;}

fieldset {border:0;}

.checkbox {
width: 13px;
height: 13px;
padding: 0;
margin:0 10px 0 0;
vertical-align: bottom;
position: relative;
top: -2px;
*overflow: hidden;
}

input {background:#636566; padding:7px;
width:100%;
margin-bottom:5px;
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box;    /* Firefox, other Gecko */
box-sizing: border-box;         /* Opera/IE 8+ */
}

<div class="sign-newsletter">

<form method="post" action="submit-sign-newsletter.php">
    <fieldset>

        <ul>
            <li><input type="text" name="name" placeholder="Name" /></li>
            <li><input type="email" name="email" placeholder="Email" /></li>
            <li><input class="checkbox" type="checkbox" name="sign_me_in" value="" /><label>"Lorem ipsum dolor sit amet, consectetur      </label></li>
            <li><input type="submit" value="Submit" class="button" /></li>
        </ul>

    </fieldset>
</form>

</div>  
like image 777
devotchkah Avatar asked Feb 18 '13 17:02

devotchkah


People also ask

How do I force text to not wrap?

Click the Display tab. Select or clear the Wrap text check box.

How do I stop excel from wrapping text?

The fastest way is to select the cell(s) and click the Wrap Text button (Home tab > Alignment group) to toggle text wrapping off. Alternatively, press the Ctrl + 1 shortcut to open the Format Cells dialog and clear the Wrap text checkbox on the Alignment tab.

How do I get rid of text wrap in HTML?

To prevent the text from wrapping, you can use the CSS white-space property with the “nowrap” or “pre” value.

Which tag is used to turn off the word wrapping?

Word Wrapping Use the &nbsp; entity for the non-breaking space character, when you want to make sure that a line isn't broken! Alternatively, use the NOWRAP attribute to disable word wrapping and the <BR> element to force line breaks where desired. Netscape includes two tags: <NOBR>... </NOBR>, and <WBR>.


1 Answers

Try changing:

HTML

<li>
    <div class="chkLabel">
       <input class="checkbox" type="checkbox" name="sign_me_in" value="" />
       <label>"Lorem ipsum dolor sit amet, consectetur</label>
    </div>
</li>

CSS

.chkLabel input { float: left; margin-top:0.5em;}
.chkLabel label { display: block; margin-left: 1.5em;}

DEMO

like image 187
Mate Avatar answered Sep 21 '22 02:09

Mate