Pregunta

Quiero dos imágenes a aparecer de lado a lado. Sin embargo, WordPress inserta un salto de línea entre los elementos, incluso si uso el editor HTML en lugar del editor de Visual.

¿Cómo puedo hacer que la confianza editor que si no se inserta un salto de línea, yo no lo quiero?

¿Fue útil?

Solución

Para evitar el salto de línea al publicar 2 imágenes lado a lado de asignación de la clase o AlignLeft bside a ellos y se las puso en la misma línea en el editor sin saltarse ningún espacio entre ellos.

Ejemplo:

<img src="/wp-content/uploads/your_image.jpg" alt="" class="alignleft" /><img src="/wp-content/uploads/your_image2.jpg" alt="" class="alignright" />

Editar Me olvidé de mencionar que el contenido después de las imágenes flotaban desbordarán entre las imágenes a menos que se borre los flotadores. Añado: <div class="clear">&nbsp;</div> después de las imágenes y añadir .clear {clear:both;} a mi css

.

Otros consejos

Along with what @Chris_O said, when you are in the editor for the pictures select Left on one and Right on the other. This applies the alignleft and alignright classes, respectively.

Your theme has to have the CSS classes defined, if you have one from vendor, they are more then likely there, but in case they aren't, just go into the theme editor and add them to the CSS:

.alignleft {float:left;}
.alignright {float:right;}

I also like to add something like this for the images I float, since the test might wrap around them;

img.alignleft, img.alignright {
padding: 5px;
display: inline;
}

Obviously you can add margin or changing the padding to suite your taste.

Licenciado bajo: CC-BY-SA con atribución
scroll top