Images and CSS
Before we start, make sure to copy our smaller images over to your york_images images folder, as explained earlier. There should be 5 of these in the files you downloaded for this course:
york_minster_2.gif
york_minster_3.gif
york_minster_4.gif
york_minster_5.gif
In HTML5, image alignment is done using CSS. However, if you just want basic left, right or centre alignment then the DIV tag is quite useful. The DIV tag is an all-purpose tag. It's somewhat like the P tag in that you get a line break after you use it.
To see the DIV tag in action, amend your HTML code to this (we've missed out the DOCTYPE tag at the top):
Save your work and reload the web page in your browser. You should see this:
The ALIGN attribute can also be used with the P tag:
Now add some text above and below the two DIV tags:
Thursday, 9 July 2015
Images and CSS in Web Design
york_minster.jpg
The smaller ones are all GIF images.
<P ALIGN ="center">
<IMG SRC="york_images/york_minster.jpg">
</P>
Again, this will apply to anything between the two tags, including text.
0 comments:
Post a Comment