tags:

views:

92

answers:

3

Hi I'm having a hard time how to align the Word "Code ein" in this code. If I do this, the word "Bitte Kopieren Sie den Anti-Spam" will have an indention but the "Code ein" is not indented. How can you do this? Thanks

 <div style="background-color:#aaa">
 <form method="post" action="[~[*id*]~]">
<input type="hidden" name="formid" value="registrationForm" />

<p>
<table>

<tr>
    <td><label for="workshop" style="margin:0.5em">Termine:</label>
    <td>
        <input type="radio" name="termine" value="Montag 4. Oktober 2010" eform="Termine::1"/>&#09;Montag 4. Oktober 2010 <br/>                    
    </td>
</tr> 

 <tr>
    <td><label for="kopieren" style="margin:0.5em">Bitte kopieren Sie den Anti-Spam Code ein: </label>
    <img src="[+verimageurl+]" alt="verification code" border="1" style="margin:0.5em"/></td>
    <td valign="top"><input type="text" name="vericode" size="20" />
</tr>


   <tr>
    <td rowspan="3" valign="right">
        <input align="right" type="submit" name="submit" value="Register" />
    </td>
</tr>

</table>

==== @Gabriel: already posted the links

=======

This is what I have now, no, colon at the end of the display:block

      <label style="margin:0.5em; display:block" for="kopieren" >Bitte kopieren Sie den Anti-Spam Code ein: </label>
+1  A: 

Here's my updated answer :

Add :

display:block;

On :

<label style="margin: 0.5em;display:block;" for="kopieren">Bitte kopieren Sie den Anti-Spam Code ein: </label>

This will fix your problem. Your label was an inline element, to achieve the result that you want, label needs to be a block element.

Gabriel
@Gabriel: but I don't want it to separate, i just would like that it will also indent the same as above. Is that possible?
tintincute
If I understand correctly, you want label "kopieren" to have the same indentation as label "workshop". Is that it?
Gabriel
@Gabriel: no, if you see my code, and if you execute it, it will show that the "Bitte kopieren Sie den Anti Spam" is in the first line and then "Code ein" will be in the next line, but it's not indented.
tintincute
@Gabriel:where should I put the "text-indent:20px;" Shall I put it here: <div style="background-color:#aaa"> inside?
tintincute
@tintincute : do you have a link that I could check? It would be easier to be able to see all css and html that could affect the indent of your text.
Gabriel
@Gabriel: yes you mean for the form? the actual website?
tintincute
I updated my answer according to the information and the link you provided. It will work now.
Gabriel
@Gabriel: thanks but i saw some corrections: this is what I have now:<label style="margin:0.5em; display:block" for="kopieren" >Bitte kopieren Sie den Anti-Spam Code ein: </label>
tintincute
A: 

Use spaces:

&nbsp;
wordupyow
@wordupyow:i don't think spaces will work, will shall i insert this one?
tintincute
Spaces aren't a good solution since you don't know where the line breaks might occur. A proper CSS solution as others are suggesting is the best option.
Chris
+1  A: 

Set the label to display:block and adjust the margins as needed. The left margin is only applied to the first line of an inline element.

mcrumley
@mcrumley:ok, could you please tell me where to put this display:block? I mean in the first line or so?
tintincute
The label needs to be display:block. `<label style="display:block;margin-left:0.5em">`
mcrumley