In this lesson you will add some more images to Hector's page.
To put spaces between the images requires using a special code for spaces, since the browser will squish together all white space in the HTML code into just one space.
<p style="text-align:center;"><img
alt="Butterfly" height="75" src="butterfly.gif" width="100"><img
alt="Butterfly" height="75" src="butterfly.gif" width="100"><img
alt="Butterfly" height="75" src="butterfly.gif" width="100"><img
alt="Butterfly" height="75" src="butterfly.gif" width="100"><img
alt="Butterfly" height="75" src="butterfly.gif" width="100"></p>
<p style="text-align:center;"><img
alt="Butterfly" height="75" src="butterfly.gif" width="100">
<img
alt="Butterfly" height="75" src="butterfly.gif" width="100">
<img
alt="Butterfly" height="75"
src="butterfly.gif" width="100"> <img alt="Butterfly" height="75" src="butterfly.gif" width="100"> <img
alt="Butterfly" height="75" src="butterfly.gif" width="100"></p>
In the HTML code any space between the code for a space and the next character counts as an additional space.
So in the source code This is text and here is more text puts 2 spaces between the words text and and. One space is from the special code for a non-breaking space and one is from all the white space squashing down to a single space on the page.
![]() |
Step-by-Step: More Images |
![]() |
What you will learn: | to add spaces to insert multiple images with space between |
Start with: , hector7-Lastname-Firstname.htm, resource
files
Shortly you will be inserting images of the two children, Ricardo and Rosa, on the same line as the image of Hector and Carla. You need some space between the images. In the browser it can be hard to tell how many spaces you have and why they are there.
Images
wrap too: If the pictures need more space than the window allows, they will wrap
just like text does. If the image is larger than the window at maximum size., the browser will show horizontal and vertical scrollbars, as needed.
Collapsing
white space: Any sequence of spaces in your HTML code collapses
to only 1 space when you view your page in a browser.
to the left of the < that starts the IMG tag.
Each
creates a space
that will show in the browser.
The letters for this code come
from the words non-breaking space. You can create as many spaces as you like with this code.
The image scoots over 3 spaces. This is enough to see
Hurrah! You have learned a way to precisely control the white space in a line of text or images.
Problem: Image did not move over
Check the Address bar. Are you viewing hector8 or are you still showing hector7?
Solution: Edit the address to show hector8-Lastname-Firstname.htm from your Class disc.
Now you can insert the photos of Ricardo and Rosa.
Hmm. Not very attractive yet! Ricardo's picture is way too tall and Rosa is too tiny.
Resizing with a graphics program gives you more control. Smaller files reduces
the download time also. You will fix these pictures in a later lesson!