English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML reference manual

HTML tag list

HTML: <input> align attribute

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 <input> etiqueta

Online example

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 ‹/›

Browser compatibility

IEFirefoxOperaChromeSafari

Note:Only the 'left' and 'right' values of the 'align' attribute work normally in all major browsers.

Definição e uso

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.

Comentários de compatibilidade

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.

Sintaxe

<input align="esquerda|direita|centro|superior|inferior">

Valor do atributo

ValorDescrição
esquerdaAlinhar imagem para a esquerda (padrão).
direitaAlinhar objeto para a direita.
superiorAlinhar imagem para cima.
centroAlinhar imagem para o centro.
inferiorAlinhar imagem para baixo.
 HTML <input> etiqueta