| :: code war·ri·or | ||||||||||
|
|
|
|
| home :: html tutorials :: site building :: q&a :: resources :: shop |
|
Your First HTML File Enough talk, it's time to start creating pages. Have Notepad at the ready, and here we go. The easiest way to explain this is to show you the code and explain it afterwards, so here are the first few bits: <HTML> The first tag is the HTML tag - this tells the browser what type of code you have written and how to interpret it. After that comes the HEAD section. Any tags within the HEAD tags are generally giving information that applies to the whole of this document. They generally are not visible. The only one I've put here is TITLE (it's all you need for now, but there are more). The text between <TITLE> and </TITLE> is what appears in the title bar of the browser, in this case "Welcome to my first page!". On this page, the title is just <TITLE>:: code war·ri·or</TITLE> Hopefully that should make the whole closing tag business make sense - <TITLE> goes at the start, and it's exactly the same at the end but with a / at the front. You can see that again after the title, where I've closed the HEAD section. It's a little like opening and closing brackets. Let's move on to the main visible part of the page: <BODY> You can use the form below to test this code. You will notice that your text although written on two lines now shows on one line. This is because we have no formatting yet. In order to do some basic formatting we can use some predefined tags, <H1> is a heading, <P> is a paragrah. This is very similar to the predefined formatting that some word processors use. To format the page slightly the first thing we have done is put the heading, "Hello World!" surrounded by the H1 tag, which tells the browser to format the text as a heading, in fact the largest possible heading. There are also tags for H2, 3, 4, 5 and 6 available for other types of heading, but you'll probably want to format them yourself, which you'll learn about in the next section. Headings don't need to go at the top of the page though you can use them at the start of all your paragraphs too. Just like when you write a document in your word processor, how you format the text and style is up to you. After the heading there are two paragraphs. The text for your paragraphs
goes between the <P> and </P> tags. You can have as many paragraphs
as you like. After you've finished the page, all that remains is to close
the BODY and HTML tags. <BODY> Make these changes in the form above and you can see for yourself now. That's it - your first page. Nothing amazing, but now you've got the idea of how things work you'll be able to learn more in next to no time. So read on, and find out how to make that text more interesting. Move onto the next section - Formatting
|
· code-warrior |
| home :: html tutorials :: site building :: q&a :: resources :: shop |
|
|
|
|
|
|