Chapter 6 An Introduction to HTML Pages 180

  • Slides: 13
Download presentation
Chapter 6 An Introduction to HTML Pages 180 -195

Chapter 6 An Introduction to HTML Pages 180 -195

Images in Folders • <IMG SRC="filename"> looks for filename in the same directory as

Images in Folders • <IMG SRC="filename"> looks for filename in the same directory as the HTML source • <IMG SRC="subdir/filename"> looks for filename in the subdirectory subdir • <IMG SRC=". . /filename"> looks for filename in the parent directory 2

Images in Folders Example 3

Images in Folders Example 3

Those Files Look Like This in SSH Secure File Transfer • Parent directory •

Those Files Look Like This in SSH Secure File Transfer • Parent directory • Directory containing HTML • Subdirectory 4

Image Alignment: Horizontal • Horizontal alignment: use the align attribute. – align=“left” and align=“right”

Image Alignment: Horizontal • Horizontal alignment: use the align attribute. – align=“left” and align=“right” both cause text to wrap around the image – To center an image, or to prevent text wrapping, put it in a paragraph 5

Image Alignment: Vertical • Vertical alignment: use the align attribute – align=“top”, align=“middle”, or

Image Alignment: Vertical • Vertical alignment: use the align attribute – align=“top”, align=“middle”, or align=“bottom” adjust the vertical location of an image on a line of text – Rarely used, because you can do this better with tables 6

“White” Space Around an Image • Attribute of image tag – Use vspace=“ 10”

“White” Space Around an Image • Attribute of image tag – Use vspace=“ 10” for 10 pixels of vertical space – Use hspace=“ 20” for 20 pixels of horizontal space 7

Image as a Link • Just put the <IMG SRC> tag inside an <A

Image as a Link • Just put the <IMG SRC> tag inside an <A HREF> -- it becomes “hot” just like text does – “Hot” Images show a blue border 8

Lists: <ol>, <ul>, and <li> – <ol> -- ordered list (numbered) – <ul> --

Lists: <ol>, <ul>, and <li> – <ol> -- ordered list (numbered) – <ul> -- unordered list (bullets) – <li> -- List Item, same for both types of lists 9

Comment Tag – Visible in source code, not rendered in the browser – <!--

Comment Tag – Visible in source code, not rendered in the browser – <!-- --> 10

Browser Specific Issues • HTML and XHTML developed by W 3 C • Extra

Browser Specific Issues • HTML and XHTML developed by W 3 C • Extra tags and attributes were added by browser makers • Size of monitor or browser window also affects the way a page looks • Number of Colors displayed varies (less of a problem these days) 11

Optimizing for Search Engines • Put the <META NAME> and <META KEYWORDS> tags in

Optimizing for Search Engines • Put the <META NAME> and <META KEYWORDS> tags in the header section of your page to help search engines – <meta name=description content=“ …”> – <meta name=keywords content=“ …”> 12

Optimizing for Search Engines • Do – Include short, meaningful <title> – Put keywords

Optimizing for Search Engines • Do – Include short, meaningful <title> – Put keywords in main page • 100 words or more on a page, keywords repeated many times – – – Comment tags can contain keywords too Use keywords for file names Use Themes Arrange for other sites to link to you Searchengines. com has more tips • Don’t – Repeat a keyword in the title more than twice – Repeat keywords many times in comments or other invisible text 13