How To: Format Images in posts beautifully Com: imatges de format en els llocs de bonítol

ADVERTISEMENT PUBLICITAT
To get our software and web/tips via email, sign up for Per aconseguir el nostre programari i web / suggeriments per correu electrònic, per signar daily email newsletter butlletí diari per correu electrònic . .
Subscribe to RSS feed Subscriure's al feed RSS or o follow me em segueixen on Twitter? a Twitter?

Images add scenic beauty to posts (unless you include really bad images). Imatges afegir bellesa escènica als llocs (a menys que inclogui imatges realment dolenta). Most bloggers advise you to include images at the at or around the beginning of your posts. La majoria dels bloggers us convidem a incloure imatges en el en o al voltant del començament de les seves entrades. And I am no different. I jo no sóc diferent.

However, one thing that those advice does not contain is how to include images which blend well with the content, yet be noticeable by a reader. Tanmateix, una cosa que els consells no conté és la forma d'incloure les imatges que es barregen amb el contingut, no obstant, ser visible per un lector. Selecting the right image is important, but so is the way you place them. Selecció de la imatge de la dreta és important, però també ho és la forma en què situar-los. Including an image with an uninspiring <img src=”" / > tag is just not in anymore – they're so web 1.0/year 1998. Inclou una imatge amb una mica inspirat <img src="" /> és només que no en més - són tan web 1.0/year 1998.

I prefer to use centered images, with the width slightly less than your post area width. Jo prefereixo usar les imatges centrades, amb l'amplada lleugerament inferior al seu ample de la zona posterior. This example shows you how to center the image, and add caption. Aquest exemple mostra com el centre de la imatge, i afegir el títol.

What you need now is a sensible, easy way to format images, without spending the whole day on it. El que necessitem ara és una assenyada manera fàcil a les imatges de format, sense passar tot el dia en ell. This can be achieved by a combination of two things – a CSS styling rule to be added to your style.css , and some HTML code which you have to wrap around your image. Això es pot aconseguir mitjançant una combinació de dues coses - una regla d'estil CSS per a ser afegit a la seva style.css i una mica de codi HTML que has d'embolicar la imatge.

Note that this cannot be used for images previously added, without editing them. Tingueu en compte que això no pot ser utilitzat per a les imatges prèviament afegit, sense editar. The reason: while CSS styling rule affects all elements, HTML markup has to be manually added around each image. La raó: mentre que la regla d'estil CSS afecta tots els elements, el format HTML s'ha d'afegir manualment al voltant de cada imatge.

Add this code to your style.css file, towards the end: Afegir aquest codi al vostre fitxer style.css cap al final:

div.ci { text-align: center; margin: 0; padding: 16px 0; padding: 0; border: none; }
div.ci small { font-size: .9em; line-height: 1.4em; color:#777; padding: 7px 0 0 0; }

ADVERTISEMENT PUBLICITAT

The code above is the styling rules which help you to position the image. El codi anterior són les normes d'estil que l'ajuden a la posició de la imatge. To apply the styling, we need to use HTML around the image tag. Per aplicar l'estil, hem d'usar HTML al voltant de la imatge. The HTML code is as follows: El codi HTML és el següent:

<div class="ci"><img src="URL_TO_IMAGE" alt="ALT TEXT" /><br />
<small>YOUR CAPTION</small></div>

In the code, replace URL_TO_IMAGE with the image URL, ALT TEXT with what you want to show when the image is not displayed, and YOUR CAPTION with the caption that you want. En el codi, substituïu URL_TO_IMAGE amb l'URL de la imatge, text ALT, amb el que voleu mostrar quan la imatge no apareix, i el títol SEVA amb el títol que desitja.

Alternatively, you can remove the caption, by using this code: Com a alternativa, pot treure el títol, mitjançant l'ús d'aquest codi:

<div class="ci"><img src="URL_TO_IMAGE" alt="ALT TEXT" /></div>

Remember to tweak the caption colour, size and font to your liking, and your images will rock! Recordi que ha d'ajustar el color de títol, la mida i tipus de lletra al seu gust, i les seves imatges es rock!

To get our latest articles, Per aconseguir els nostres darrers articles, click here to sign up feu clic aquí per registrar for our free email newsletter or subscribe to al nostre butlletí de correu electrònic gratuït o subscriure's a RSS feed RSS feed

§ Comments § Comentaris