The poem HTML problem

In tha last chapters you learnt to make a basic HTML structure and you learnt to use the most important and simple HTML tags.

In fact you could make a website right now, a bit simple and static but you could! 😉

In this chapter you’ll learn to change the text structure, you can write an HTML paragraph but what happens if you need to show an poem:

Antonio Machado poem:

Como atento no más a mi quimera
no reparaba en torno mío, un día
me sorprendió la fértil primavera
que en todo el ancho campo sonreía.

Brotaban verdes hojas
de las hinchadas yemas del ramaje,
y flores amarillas, blancas, rojas,
alegraban la mancha del paisaje.

Y era una lluvia de saetas de oro,
el sol sobre las frondas juveniles;
del amplio río en el caudal sonoro
se miraban los álamos gentiles.

Tras de tanto camino es la primera
vez que miro brotar la primavera,
dije, y después, declamatoriamente:

?¡Cuán tarde ya para la dicha mía!?
Y luego, al caminar, como quien siente
alas de otra ilusión: ?Y todavía
¡yo alcanzaré mi juventud un día!

Open your notepad and insert each paragraph from the poem between <p></p>, then open It using your browser….you will see that you can’t keep the poem structure. This problem has two solutions:

 <pre></pre> Tag

Delete all the document and copy the complete poem between the tag <pre></pre>, save It and use your browser again…

You will see like the <pre> tag keep the text structure, but there ir another way to keep a text structure, using <p> and line break: <br>. The <br> tag hasn’t closed tag, this means that you don’t need to close It.

Now copy all the poem again and use the tags like this:

 

<p>Como atento no más a mi quimera <br>
no reparaba en torno mío, un día <br>
me sorprendió la fértil primavera <br>
que en todo el ancho campo sonreía.</p>

Open again your HTML document with the browser….the structure is right!


Posted

in

by

Tags:

Comments

Leave a Reply