Website HTML problem! (HELP!)?

sc???l gù?l

New member
So I'm trying to move a input or form I want to move it to the top right of the website so I'm struggling can someone help???
<div align="right">
<form action="">
Username: <input type="text" name="user" /><br />
Password: <input type="password" name="password" />
</form>
<input type="submit" value="Sign In">
 
Move all your page styling into an external CSS file, because it will give you more control over your page than Transitional HTML. (For more info on this, please visit HTML Dog and have a look around, specifically at this page http://htmldog.com/guides/cssbeginner/applyingcss/ )

Secondly, the style that you want is:
form {
* * float: right;
* * position: absolute;
* * top: 0;
* * right: 0;
}

What this does, is that the first line applies the style to all forms.
The second line floats the form to the right. This positions it to the right.
The third line sets the positioning absolute to the form's outer box (typically the page itself).
The fourth line sets the form to the top-most position of the outer box.
The fifth line fixes the third line, which accidentally cancels out the floating of the form.
The last line closes the block.

The most important thing that you can do though, is keep a logical page flow, even without styles or behaviours. Nothing can ever replace this.

A few, small corrections:
Your form has no real action. You might want to fix that. Unless you're already server-side.
You have an unclosed division which uses a deprecated align attribute.
Your submit button is outside of the form and unclosed. You also might want to use a button element rather than an input for that.
You might want to wrap your label text-form element pairs inside a label element, and that label element inside of a paragraph. Since forms can't have in-line elements as their direct descendants.
Always use paragraphs or a list (for programme code), depending on the situation instead line breaks.
The colon on the Password element is completely stylistic, so instead of wrapping the input with a label, just wrap the text, and use an :after pseudo-element for the colon. Use the label and input as a for-id pair.
Since you're submitting a password, you should set the form's method to "post" instead of letting it default to "get". That way, the password is more secure and private.
Just a few things to think about. Some of which you don't really have to do, but they'd help you. (If you don't know what I mean, even without researching, you might not have to do it.)

I hope that this helps! =) If it doesn't email me.
 
The align="right" does align it to the right. But without knowing how your page looks like right now, it's hard to say where the problem is.

Btw, you should use style (css) for presentation. Like:
<div style="float: right;"></div>

And the input needs to be inside the form.

I think you should give us more info for us to help you out.
 
Back
Top