300 likes | 448 Views
Learning a New Language: HTML. Fall 2012 ITD Workshop. Workshop instructors. Steven Smidl - Experience with HTML/XHTML and CSS. Nicholas Tippie - Experience with HTML/XHTML, CSS, PHP, Java, C++ What experience do you have with HTML, CSS, and web site creation?.
E N D
Learning a New Language: HTML Fall 2012 ITD Workshop
Workshop instructors • Steven Smidl • - Experience with HTML/XHTML and CSS. • Nicholas Tippie • - Experience with HTML/XHTML, CSS, PHP, Java, C++ • What experience do you have with HTML, CSS, and web site creation?
Purpose + Learning objectives • This is an introduction to creating static webpages. Since libraries are increasingly moving toward web content, web content management is a skill that is useful and will make you more marketable. • What you will (hopefully) learn: • What HTMLand CSS are • Some important terminology • Coding standards • To read and edit basic HTML code, such as web site templates
Some Things you will need • A code editor • For Macintosh: • Text Wrangler • For Microsoft Windows: • Notepad++ • Any simple-text editor will work (e.g., TextEdit, Notepad) • A place to put your web page files on the Internet • I: Drive • Google Sites, Wix, Weeble • Web hosting service provider with domain name • You can also view HTML webpage files locally in your favorite web browser.
What is HTML? • HTML = HyperText Markup Language • Tim Berners-Lee, the cool British computer science who created the World Wide Web, was the pioneer of HTML. It became standardized in November 1995 as HTML 2.0. • World Wide Web Consortium (W3C) is the international standards organization for the World Wide Web. W3C maintains the standards for HTML, CSS, XML, among many other languages. • HTML is not a scripting language.
Html as markup language • HTML is written in elements, which are specific to the language itself, and each element typically has three components: • Tags are enclosed in angle brackets – start tag / end tag • Attributes may be included in the start tag • Content is always placed in between the two tags • <tag attribute=“value”>content</tag> • Empty elements (i.e., elements without content) do not have an end tag and follow this form • <tag attribute=“value” />
Hello_world.html • <!DOCTYPE html> • <html> • <head> • <title>Hello HTML World</title> • </head> • <body> • <p>Hello world!</p> • </body> • </html>
Heading Tags • Heading tags are used for titles and subtitles within the content of the webpage. The font size gets smaller as the numbers get bigger. • <body> • <h1>Headings</h1> • <h2>are</h2> • <h3>great</h3> • <h4>for</h4> • <h5>titles</h5> • <h6>and subtitles</h6> • </body>
Heading Tags • What is wrong with this picture?
Heading Tags • All tags come in pairs!
Textformatting tags • <body> • <p><strong>Bold text</strong></p> • <p><em>Emphasized text</em></p> • <p><i>Italic text</i></p> • <p><u>Underlined text</u></p> • <p><del>Struckthrough</del></p> • <p><sup>Superscript</sup></p> • <p><sub>Subscript</sub></p> • </body> These are some of the commonest text formatting tags that add emphasis to your content.
Useful attributes Align attribute allows you to align your content left, right or center. The default is always left. CSS is making this attribute less popular. • <body> • <h2 align=“left”>Left</h2> • <h2 align=“center”>Centered</h2> • <h2 align=“right”>Right</h2> • </body>
Useful attributes The title attribute adds a tiny text pop-up to any HTML element. Search engines use this attribute to catalog your webpage as well as increase your search ranking. This attribute is most often used with images. <body> <h1 title=“Hi!”>Big Title Heading Tag</h1> </body>
Hypertext reference (href) A hypertext reference (href) is a link tag that directs a user to a valid URL. <body> <h3>This is a hyperlink:</h3> <br /> <a href=“http://www.nytimes.com/”>NY Times</a> </body>
Hypertext reference (href) • There are five different kinds of URLs you can use in the href attribute: • <a href=“http://www.uiuc.edu”>UIUC</a> • <a href=“../internal/index.html”>Homepage</a> • <a href=“#top”>Go to top</a> • <a href=“mailto:help@support.lis.illinois.edu?subject=“I need help”>GSLIS Help Desk</a> • <a href=“http://www.uiuc.edu/some_file.zip”>Download this file</a>
Comments Comments are a way for you to make notes in your HTML code. They are never shown in the web browser. You can also comment out existing code instead of deleting it. <body> <!–- This is a comment. It is not displayed. --> <p>This text is shown in the web browser.</p> </body> <body> <!–- This comment is temporarily removing this code. <p>This text is shown in the web browser.</p> --> </body>
Images Almost every website uses images, and a website without images is pretty boring. The <img> tag does not have “content”. It is an empty element. <body> <p>What is the plural of TARDIS?</p> <imgsrc=“tardis.jpg” /> </body> Images as link/anchor: <body> <a href=“../internal/some_file.html”> <imgsrc=“tardis.jpg” /> </a> </body>
Image Source urls • The source of your images may be either global or local. But it is good practice to make them all local. Src Attribute Code Explanation src=“tardis.jpg” src=“imgs/tardis.jpg” src=“../tardis.jpg” src=“../imgs/tardis.jpg” src=“http://www.uiuc.edu/tardis.jpg” Image is located in the same directory Image is located in the imgs directory Image is located “up” a directory Image is located “up” a directory in another directory called imgs Image is located at a specific URL elsewhere; this is known as a “global” location
Attributes of the <img> tag You can specify the exact width and height of the image. <imgsrc=“tardis.jpg” width=“220” height=“293” /> • Two things to note about specifying the dimensions of an image: • Always use the same ratio of width to height • Always scale downward – bigger images scale down nicely, but smaller images will become pixelated if you make them much bigger The alt (alternative) attribute allows you to display alternate text if the image does not load for some reason. <imgsrc=“tardis.jpg” alt=“The TARDIS” />
Unordered Lists There are different types of lists in HTML. The unorderedlist is named so because its items are not numbered. Its items are displayed with bullet points. <body> <h3>Today’s Task List</h3> <ul> <li>LIS501 homework</li> <li>LIS506 assignment</li> <li>Exercise</li> <li>Do the cleaning</li> </ul> </body>
Ordered lists The items of an ordered list are numbered. <body> <h3>Goals</h3> <ol> <li>Finish school</li> <li>Get a job</li> <li>Make money</li> <li>Get own place</li> </ol> </body>
List attributes For unordered lists, you can specify which type of bullet point you would like by using the type attribute in the ul tag. <ul type=“circle”> […] </ul> <ul type=“square”> […] </ul> <ul type=“disc”> […] </ul> For ordered lists, you can pick a starting number other than 1 by using the start attribute. <ol start=“3”> […] </ol> If you want something other than numbers in the ordered list, you can choose among a few other options like alphabetical or roman numerals. <ol type=“a”>[…] </ol> <ol type=“i”>[…] </ol> <ol type=“A”>[…] </ol> <ol type=“I”>[…] </ol>
tables • Note: Do not use tables to structure the entire content of your webpage. This practice is now considered old fashioned. The HTML element table is composed of rows and columns. This element is a container element, which means it can contain other elements. <table border=“1”> <tr> <td>Row 1/Cell 1</td> <td>Row 1/Cell 2</td> </tr> <tr> <td>Row 2/Cell 1</td> <td>Row 2/Cell 2</td> </tr> </table>
<Div> element The <div> element is nothing more than a container. Web developers now use <div> elements to arrange content on webpages instead of <table> elements. This will become important to you once you’ve learned more CSS. <div id=“someDIV” name=“someDIV” title=“DIV Element”> <!-- any HTML element can go in here --> </div> <div> elements can be nested in one another.
Html web form elements • Web forms, which are those parts of a webpage where users enter some input, are created in HTML but require some scripting language to interpret the user’s input. • Some examples of web forms: • Credential authentication (e.g., a login screen) • Search functionality on webpages • Web applications • This is outside of the scope of this workshop. Web forms are a more advanced feature of HTML that are only necessary when using a scripting language like PHP.
HTML vs. xhtml • XHTML = Extensible HyperTextMarkup Language • Until version 5.0, HTML was based on Standard Generalized Markup Language (SGML) standards. • XHTML, which is replacing HTML, is based on the Extensible Markup Language (XML) standards. • What this means for you: • Tags remain the same as in HTML 5.0 • There are stricter rules in the coding • Everything must be lowercase • All tags are closed and nested • There are other more technical differences, too.
What is css? • CSS = Cascading Style Sheet • CSS files are separate from HTML files, but they are “included in” the HTML file. • It is best practice to use CSS for all formatting in your HTML files. This is the current trend…. • Some HTML tags are becoming depreciated because of CSS. A few examples: • - <font> • - Lists: <ul>, <il>, … • - <table> as used for main content structure • - Align attribute and other formatting attributes
The css workshop • The Instructional Technology & Design (ITD) Office occasionally offers a workshop on CSS. • Some other helpful resources: • - W3C Tutorials • http://www.w3schools.com/css • - Lynda Tutorials • http://go.illinois.edu/lynda
Questions, comments, concerns… • Thank you for attending our workshop! • Contact GSLIS Help Desk: • help@support.lis.illinois.edu • Information on this presentation • Steven Smidl : smidl2@illinois.edu • Nick Tippie : tippie2@illinois.edu • Feedback is always appreciated! • http://go.illinois.edu/itdfeedback