240 likes | 363 Views
Introduction to HTML Formatting, Spacing, & Text Stuff. Before We Begin. Find the file you created previously Open it in Notepad. Background Info. HTML files are ‘free form’ ‘Enters’ and multiple spaces are ignored Don’t use spaces, tabs, and enters to format your text
E N D
Before We Begin • Find the file you created previously • Open it in Notepad
Background Info • HTML files are ‘free form’ • ‘Enters’ and multiple spaces are ignored • Don’t use spaces, tabs, and enters to format your text • You can format it pretty in Notepad, but the browser will ignore your formatting
Background Info (cont.) • The browser will lump everything into one long single-spaced paragraph • It will use the tags to figure out how to format it • Therefore, you must rely on your HTML to format your web page • If you have a typo or mistake in a tag, the browser will treat it like text
Background Info (cont.) • Once the start tag is turned on, it stays in effect until the end tag is reached • This allows multiple tags to be used together because you can have multiple things turned on at once
Format Tags • Line Break <BR> - forces following text to next line (like a hard return) • Paragraph <P></P> - treats text between the start/end tags as a paragraph and forces 2 line breaks • Horizontal Rule <HR> - draws a horizontal line
Format Tags • In your file, enter this in the body after the line of text you entered previously <HR>Web Design is a wonderful thing. Look – a line break.<BR> <P>This is a paragraph. It’s a great thing. Oh joy!</P> Woop-de-do! 1
Format Tags • Now save your file (File>Save or Ctrl-S) • Display it in the browser • Don’t close Notepad – minimize it • Open ‘My Computer’ or some file folder list • Find your file • Double-click on it
Style Tags • Bold <B></B> - bolds text • Underline <U></U> - underlines text • Italicize <I></I> - italicizes text
Style Tags • Make the changes in white: <HR>Web Design is a <U>wonderful</U> thing. Look – a line break.<BR> <P>This is a paragraph. It’s a <I>great</I> thing. Oh joy!</P> <B>Woop-de-do!</B> 2
Heading Tags • Use the Heading tags to create titles and headings for sections of your page • HTML has six levels of headers: • H1, H2, H3, H4, H5, H6 • H1 is highest importance, H6 is lowest • They also cause line breaks
Heading Tags • Enter this on new line after the other text: <h1>Biggest Size</h1> <h2>Next Biggest</h2> <h3>Average</h3> <h4>Almost Average</h4> <h5>Getting Small</h5> <h6>Smallest Size</h6> 3
Tag Attributes • Used to change the way the tag behaves • It’s sort of an ‘add-on’ • You can use them to set things like: • Size (height, width, length, etc.) • Color • Alignments • Etc., etc.
Tag Attributes • They go right after the tag name inside the brackets <> • You can have more than one on a tag • Use a space to separate them • For start/end tags, they only go on the start tag • Like this: <TAG ATTR1=? ATTR2=?>blah </TAG>
Attribute Examples • Horizontal Rule <HR> • Change width <HR WIDTH=#> (# is some number) • Change height/thickness <HR SIZE=#> • Change both at once <HR WIDTH=# SIZE=#>
Attribute Examples • Font Tag <FONT></FONT> • Change size (1 to 7) <FONT SIZE=#>text</FONT> • Change font face (type of font) <FONT FACE=“{font name}”>text</FONT> • Change both at once <FONT FACE=“Arial” SIZE=3>text</FONT>
Attribute Examples • Alignment • Paragraph Tag <P ALIGN=left/center/right>text</P> • Heading Tag <H1 ALIGN=left/center/right>text</H1> • Center Tag <CENTER>text</CENTER> • Centers everything between the tags
Attribute Examples • Make the changes in white: <FONT SIZE=6 FACE=“Arial”> This is a simple web page. AMAZING!! </FONT> <HR width=500 size=10> ... <P ALIGN=CENTER> 4
Colors • Can be changed on almost anything • Usually set with an attribute • Use color name or hexadecimal code White or #FFFFFF Black or #000000 Red or #FF0000 Green or #00FF00 Blue or #0000FF Yellow or #FFFF00 Gray or #808080 Purple or #800080 Fuchsia or #FF00FF Lime or #00FF00
Colors • If you use a color name the browser doesn’t know, you might get a strange or unpredictable color • Complete lists of colors can be found on the web
Color Examples • Page background – Body tag • <BODY BGCOLOR=“color”> • All text – Body tag • <BODY TEXT=“color”> • Some text – Font tag • <FONT COLOR=“color”>
Color Examples • Make the changes in white: <BODY BGCOLOR=gray TEXT=white> <FONT COLOR=RED ...> ... <HR COLOR=“#0099FF” ...> 5
Color Examples • Now, try out other color options, sizes, attributes, whatever