170 likes | 187 Views
Tags Blocks Style. Charles' keys to HTML. Tags. Opening tags: <TAGNAME attributename='value'> Closing tags: </TAGNAME>. Blocks. Blocks are made up of an opening and closing tag and everything in between: <HTML> <B>Hello there</B> </HTML>. Nesting Blocks. Bad:
E N D
Tags Blocks Style Charles' keys to HTML
Tags Opening tags: <TAGNAME attributename='value'> Closing tags: </TAGNAME>
Blocks Blocks are made up of an opening and closing tag and everything in between: <HTML> <B>Hello there</B> </HTML>
Nesting Blocks Bad: <B><I>Hello there</B></I> Good: <B><I>Hello there</I></B>
Style Indentation – Inside a block indent <HTML> <B>Hi there</B> </HTML> Consistent case – Tag Names, Attribute Names <BODY bgcolor='red'>
More Style Always Always Always quote attribute values good: <BODY bgcolor='red' vlink='green'> bad: <BODY bgcolor=red vlink=green>
The three basic tags and blocks <HTML> <HEAD> </HEAD> <BODY> </BODY> </HTML>
The three basic tags and blocks cont. • Html • This is the outside block in which we will create our webpage, for our purposes there should never be anything outside it. • Head • This is the block in which we place information about the page, such as the title. In fact we won't really use it for anything else until after the first project.
The three basic tags and blocks cont. • Body • This is where we place all the content that is going to be seen by the user. The rule of thumb is, if it is going to be seen by the user it will go here.
Adding Information to our page <HEAD> <TITLE>Some cool catchy title</TITLE> </HEAD> <BODY> Tiberius Claudius Nero Born: November 16, 42 BC Died: March 16, 37 AD </BODY>
How can we make the text look right? • Since all whitespace (spaces, returns) gets compressed to a single space we need to use a tag to get line breaks: <BR> <BODY> Tiberius Claudius Nero<BR><BR> Born: November 16, 42 BC<BR> Died: March 16, 37 AD<BR> </BODY>
Writing for the web (sort of) • Headings draw the eye in. They can also be used to draw the eye in. • <H1>, <H2>, <H3>, <H4>, <H5>, <H6> <H1>Tiberius Claudius Nero</H1><BR><BR>
A better way to control the font • The <FONT> tag uses following attributes: • Size: can be relative (+2, -2 ,etc..) or absolute (1-5) • Color: for now you can make this red, blue, etc... <FONT size='+2' color='red'>Born: November 16, 42 BC</FONT><BR>
But changing the actual Font? • In that case use the face attribute <FONT face='arial'> Died: March 16, 37 AD </FONT><BR>
Bold and Italics • <B>, <I> <FONT face='arial'> <B>Died: March 16, 37 <I>AD</I></B> </FONT><BR>
Background Color • The bgcolor of the <BODY> tag <BODY bgcolor='yellow'>
Reference Website • http://www.w3schools.com