English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The input align attribute is only used with <input type ="image">, which specifies the alignment of the image input based on the surrounding elements.
HTML form with an image as a submit button. The submit button is aligned to the left:
<!DOCTYPE html> <html> <head> <title>HTML: <input> align attribute - 基础教程网(oldtoolbag.com)</title> <body> <form action="action_page.php"> First name: <input type="text" name="fname"><br> <input type="image" src="submit.gif" alt="Submit" align="left" width="48" height="48"> </form> </body> </html>Test and see ‹/›
IEFirefoxOperaChromeSafari
Note:Only the 'left' and 'right' values of the 'align' attribute work normally in all major browsers.
HTML5 O atributo align do <input> não é suportado. Use CSS em vez disso.
No HTML 4.01 No entanto, o atributo align do <input> foi descontinuado.
O atributo align pode ser usado apenas com <input type="image">, ele determina o alinhamento da imagem em relação aos outros elementos ao redor.
No HTML 4.01 No entanto, o atributo align do <input> foi descontinuado. Use CSS em vez disso.
Sintaxe de CSS: <input type="image" style="float:right">
Exemplo de CSS: Alinhamento de imagem de entrada
Em nossa lição de CSS, você pode encontrar mais sobre Atributo floatdetalhes.
<input align="esquerda|direita|centro|superior|inferior">
Valor | Descrição |
---|---|
esquerda | Alinhar imagem para a esquerda (padrão). |
direita | Alinhar objeto para a direita. |
superior | Alinhar imagem para cima. |
centro | Alinhar imagem para o centro. |
inferior | Alinhar imagem para baixo. |