I'm working with HTML and CSS and I want to align the form and the logo more to the right:

The positions I want are more like this if I do a mockup:

My HTML is
<!DOCTYPE hml>
<html>
<head> <link rel="stylesheet" href="/welcome/static/css/register.css"/>
<STYLE TYPE="text/css">
</STYLE>
<title>{% trans %}Register new distributor{% endtrans %}</title>
</head>
<body> <div id="content">
<form action="{{action}}" method="post"><img src="/welcome/static/images/reg-reg.gif">
<table><tr><td>
<label>Pers. number </label></td><td><input type="text" name="soc_sec" placeholder="{% trans %}Your social security number{% endtrans %}" />({% trans %}YYMMDDXX{% endtrans %})</td></tr><tr><td>
<label for="start">Sponsor ID</label></td><td>
<input type="text" id="start" name="Log1" size="3" maxlength="3" />
<input type="text" name="Log2" size="3" maxlength="3" />
<input type="text" name="Log3" size="3" maxlength="3" />
<input type="text" name="Log4" size="3" maxlength="3" />(<a href="/sponsor-id-info.html">{% trans %}What is a sponsor ID{% endtrans %}?</a>)</td><td></tr><tr><td>
<label>Email</label></td><td> <input type="text" name="email" placeholder="{% trans %}Your email{% endtrans %}" /></td></tr><tr><td>
<label>{% trans %}First name{% endtrans %}</label></td><td><input type="text" name="firstname" placeholder="{% trans %}Your first name{% endtrans %}" /></td></tr><tr><td>
<label>{% trans %}Last name{% endtrans %}</label></td><td><input type="text" name="lastname" placeholder="{% trans %}Your last name{% endtrans %}" /></td></tr><tr>
<td>
<label>{% trans %}Address{% endtrans %}</label></td><td><input type="text" name="address" placeholder="{% trans %}Your address{% endtrans %}" /></td></tr><tr><td>
<label>{% trans %}Zip code{% endtrans %}</label></td><td><input type="text" name="zipcode" placeholder="{% trans %}Your zip code{% endtrans %}" /></td></tr><tr><td>
<label>{% trans %}City{% endtrans %}</label></td><td><input type="text" name="city" placeholder="{% trans %}City{% endtrans %}" /></td></tr><tr><td>
<label>{% trans %}Phone{% endtrans %}</label></td><td><input type="text" name="phone" placeholder="{% trans %}Your phone number{% endtrans %}" /></td></tr></table>
<button>{% trans %}Next{% endtrans %}</button>
</form><img src="/welcome/static/images/snabbreg002.jpg"></div>
</html>
And my CSS is
BODY {background-image: url(/welcome/static/images/reg-bg.png); background-repeat: repeat-x; }
#content {
width: 700px ;
margin-left: auto ;
margin-right: auto ;
}
Could you advice how to align my components more to the right like in the lower picture?
Thank you
Now I could align the logo to the right, all that is left to be done is moving the form to the right. How do I do it?

Your css is right, but try to apply it to a div inside the content div:
Html:
<div id="content">
<div id="content-container">
<form ...>
...
</form>
<img id="image-logo" .../>
</div>
</div>
Css:
#content-container {
width: 700px ;
margin: 0 auto;
}
#image-logo {
float: right;
}
Also, the image needs a right floating to position as you expect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With