120 likes | 156 Views
C151 Multi-User Operating Systems. Introduction to HTML. Web Server. Each user of a server can create a directory under their home directory ( ~ ) and that directory will be used to hold their web pages. Examples: For CS account, the directory should be called public_html .
E N D
C151 Multi-User Operating Systems Introduction to HTML
Web Server • Each user of a server can create a directory under their home directory (~) and that directory will be used to hold their web pages. • Examples: • For CS account, the directory should be called public_html. • For IUSB account (mypage.iusb.edu), the directory should be called html. • A server also defines a default name to be given to the starting page in any directory. • For CS account: index.html • For IUSB account: index.html
Page Identification • The default starting page in the default directory is identified by the user name in that domain. • Web address of my user name in the CS domain:http://www.cs.iusb.edu/~yul/ • File identified by that address:/home/yul/public_html/index.html • Any subdirectory can be accessed by adding its name to the main address:http://www.cs.iusb.edu/~yul/C151/ /home/yul/public_html/C151/ • Any other file than the one with the default name is identified by adding the relative path and the file name to the main address: http://www.cs.iusb.edu/~yul/c151/Lecture_05.ppt /home/yul/public_html/C151/Lecture_05.ppt
Introduction to Html • HTML stands for HyperText Markup Language. • An html document (page) contains text and some tags specifying the format and links to images, other pages, and so on. • A tag is applied to the entire text enclosed by <tag> and </tag>. • Comment in HTML • Any text between <!-- and --> is considered a comment and will not appear on the screen. • A document must start with the tag <html> and end with </html>. It is composed of a header and a body.<html><head> ... </head><body> ... </body></html> • Examples of things found in the head: <title>My web page</title>
Simple Formatting Tags • New line: <br> • The <br> tag is an empty tag which means that it has no end tag. • New paragraph <p> ……….. </p> • Headings: various titles, text to be displayed in a bigger font and usually bold or italicsheading 1 <h1> ... </h1>heading 2 <h2> ... </h2>etc.
Text Properties • bold: <b> ... </b> • italics: <i> ... </i> • centered: <center> ... </center> • Special characters: • & the & character • < the < character • > the > character
Fonts - Divisions • A font tag can be used to set character properties like font, color, size • <font face="Magneto" size=“12" color=“blue”> … </font>
Lists • Unordered lists:<UL><LI>Monday<LI>Tuesday <LI>Wednesday </UL> • Marked with bullets • Ordered lists:<OL><LI>Monday<LI>Tuesday <LI>Wednesday </OL> • Marked with numbers
Tables • Delimited between the tags <table> ... </table> • Each table row is delimited by <tr> ... </tr> • Each table cell is delimited by <td> ... </td> • The table tag can specify some things about the table format, as<table border=“1” align=“center” bordercolor=“red” >
Links and Images • A link is a hypertext link to another file, to a position in a page, or can also provide an email address: • <a href=“http://www.cs.iusb.edu/~yul/”>Liguo Yu </a> • Inserting an image in the page:<img src="cat.jpg"> • The image above is in the same directory as the page. It can be an image from an external location.
Recall File Permissions • Owner, group, others • Read, write, execute • Suppose I have a file test.cpp in my home directory. Can you copy it to your home directory? • This depends on the permission of test.cpp • Suppose I have a file index.html in my public_html directory. Can you see it using a web browser? • This depends on the permission of file and folders
File Permissions for Web Pages • Files should be readable for everyone: chmod 644 file_name • Folders (include home directory) should be executable for everyone: chmod 711 folder_name