Esta plantilla se utiliza para posicionar texto o elementos en el extremo derecho o izquierdo de una página/área, sin cambiar la alineación o el formato de otros textos y elementos cercanos.
Todo lo que coloques con esta plantilla cubrirá todo lo que esté debajo. El texto se ajustará debajo de esta plantilla, no alrededor de ella.
Para alinear texto en general, consulte {{ align }} . Para imágenes, cuadros y otros elementos flotantes de manera que el texto se ajuste alrededor en lugar de debajo, consulte {{ stack }} .
Estos son los usos estándar:
{{float|item}}
hace flotar el elemento en el extremo derecho de una página/área.{{float|left|item}}
hace flotar el elemento en el extremo izquierdo de una página/área.Más configuración:
{{float |width= |height= |top= |right= |bottom= |left= |item}}
item
Es obligatorio. Debes especificar qué texto o elemento desea que flote o se generará un error.
Todos los parámetros son opcionales. Los parámetros |width=
y |height=
sirven para indicar el ancho y la altura del <div>
elemento.
Los parámetros opcionales |top=
, |right=
, |bottom=
y |left=
sirven para indicar a qué distancia de sus respectivas posiciones debe colocarse el elemento.
Se puede utilizar cualquier unidad HTML/CSS establecida, por ejemplo, {{float |top=2.0em |left=2px |width=10em | the content to float}}
.
Tenga cuidado al utilizar esta plantilla en cuadros de navegación. Asegúrese de que lo que flota (por ejemplo, una imagen) no flote sobre otros elementos o texto, incluso después de cambiar el tamaño del cuadro de navegación.
Para alinear listas centradas en un cuadro de navegación con una imagen, consulte la sección de alternativas para cuadros de navegación a continuación.
Observe cómo los enlaces en los dos segundos ejemplos están centrados en relación con toda la plantilla, a diferencia de los del primer ejemplo.
Este es un cuadro de navegación que utiliza su parámetro de imagen:
{{Cuadro de navegación| nombre = Flotador/doc| estado = no colapsado|título=[[Armada Imperial Japonesa]]|listaclase = hlist| imagen = [[Archivo:Naval Ensign of Japan.svg|24px|border|Insignia naval de Japón]]|lista1=* [[Almirantes de la Armada Imperial Japonesa|Almirantes]]* [[Batallas de la Armada Imperial Japonesa|Batallas]]* [[Lista de buques de la Armada Japonesa|Buques]]* [[Lista de aeronaves de la Armada Japonesa|Aeronaves]]* [[Lista de armas de la Armada Japonesa|Armas]]}}
Usamos {{float}} en lugar del parámetro de imagen del cuadro de navegación:
{{Cuadro de navegación| nombre = Flotador/doc| estado = no colapsado|título=[[Armada Imperial Japonesa]]|listaclase = hlist| list1 = {{float|[[Archivo:Naval Ensign of Japan.svg|24px|border|Insignia naval de Japón]]}}* [[Almirantes de la Armada Imperial Japonesa|Almirantes]]* [[Batallas de la Armada Imperial Japonesa|Batallas]]* [[Lista de buques de la Armada Japonesa|Buques]]* [[Lista de aeronaves de la Armada Japonesa|Aeronaves]]* [[Lista de armas de la Armada Japonesa|Armas]]}}
Usamos {{float}} con un valor personalizado de |top=
este tiempo:
{{Cuadro de navegación| nombre = Flotador/doc| estado = no colapsado|título=[[Armada Imperial Japonesa]]|listaclase = hlist| list1 = {{float|top=0.5em|[[Archivo:Naval Ensign of Japan.svg|24px|border|Insignia naval de Japón]]}}* [[Almirantes de la Armada Imperial Japonesa|Almirantes]]* [[Batallas de la Armada Imperial Japonesa|Batallas]]* [[Lista de buques de la Armada Japonesa|Buques]]* [[Lista de aeronaves de la Armada Japonesa|Aeronaves]]* [[Lista de armas de la Armada Japonesa|Armas]]}}
Usamos su parámetro de imagen y estilo de lista con padding-left establecido en el ancho de la imagen:
{{Cuadro de navegación| nombre = Flotador/doc| estado = no colapsado|título=[[Armada Imperial Japonesa]]|listaclase = hlist| imagen = [[Archivo:Naval Ensign of Japan.svg|24px|border|Insignia naval de Japón]]| estilo de lista = relleno-izquierdo: 24px|lista1=* [[Almirantes de la Armada Imperial Japonesa|Almirantes]]* [[Batallas de la Armada Imperial Japonesa|Batallas]]* [[Lista de buques de la Armada Japonesa|Buques]]* [[Lista de aeronaves de la Armada Japonesa|Aeronaves]]* [[Lista de armas de la Armada Japonesa|Armas]]}}