I'm having trouble styling a label with CSS properties because every word inside the label is breaking to a new line. For example, "Withdraw money" is displaying like this:
Withdraw
money
I've tried various properties like
white-space:nowrap,float: left,display:inline-block,display:inline
, but none of them seem to work! Additionally, can someone please explain why the color property is not affecting the text inside the label? Here's my code:
body,
h1,
h2,
h3,
p,
td,
quote,
small,
form,
input,
ul,
li,
ol,
label {
margin: 0px;
padding: 0px;
}
body {
margin-top: 20px;
font-family: Arial, Helvetica, sans-serif;
color: #51555C;
height: 100%;
font-size: 11px;
}
/* Form styles */
input,
select {
padding: 3px;
color: #333333;
border: 1px solid #96A6C5;
margin-top: 2px;
width: 200px;
font-size: 14px;
}
select {
width: auto;
padding: 2px;
}
.formline {
padding: 3px;
}
label {
font-size: 14px;
display: block;
text-align: left;
white-space: nowrap;
color: #203360;
}
table {
width: 400px;
}
td {
font-size: 11px;
}
.input-container {
padding: 8px;
}
#div-regForm,
.registered {
border: 3px solid #eeeeee;
padding: 15px;
background: url(images/bg.jpg) repeat-x #999933;
color: #203360;
margin: 15px auto 40px auto;
width: 400px;
}
.form-title,
.form-sub-title {
font-size: 40px;
font-family: "Lucida Grande", Tahoma, Verdana, Arial, sans-serif;
font-size: 20px;
font-weight: bold;
}
.form-sub-title {
font-weight: normal;
padding: 6px 0 15px 0;
}
<div id="div-regForm">
<div class="form-title">Withdraw money</div>
<table>
<tbody>
<tr>
<td>
<label for="fname" style="color: #990000">Withdraw address</label>
</td>
<td>
<div class="input-container">
<input name="email" id="email" type="text" />
</div>
</td>
</tr>
<tr>
<td>
<label for="fname" style="color: #990000">Amount</label>
</td>
<td>
<div class="input-container">
<input name="amount" id="amount" type="text" />
</div>
</td>
</tr>
</tbody>
</table>
</div>