Basic HTML knowledge
4 posters
Ronie_iz_BaD Forums :: Communities and Networks :: Public software releases :: Programming :: Tutorials
Page 1 of 1
Basic HTML knowledge
For some reason, HTML seems to really frighten a lot of people. Some have seen complicated HMTL that's been produced by an editor program, or they've clicked 'View Source' on a few pages and been scared by what they've seen.
What you have to realize, though, is that HTML was designed from the beginning to be a very simple language to learn and to use – just because automated systems for producing it have a tendency to make it over-complicated, it doesn't mean that your code has to be that way. The best way to get started with HTML is to get over any fears you might have and just get stuck in.
Note that you will need to save files as filename.html before you will be able to open them in a web browser. If you're not sure how to do this with a text editor, use an HTML code editing program.
All About Tags
There's only one thing you really need to understand before you start writing pages in HTML, and that's the tag system. Basically, tags are commands in angle brackets, with text between them. For example, here is some text in a bold tag:
<b>bold text</b>
The second tag has a slash before its name because it's a closing tag. You can have as many tags inside other tags as you want, as long as you always remember to close the last one first. For example:
<b><i><u>bold, italic, underlined text</u></i></b>
If the tags are closed in the wrong order, then the code is invalid.
The only other thing you really need to understand about tags is that they can include some extra information in the opening tag. A link tag, for example, will include an 'href' (the URL it links to), like this: <a href="http://www.example.com">. Closing tags never contain any extra information.
The Structure of an HTML Document
These tags are usually laid out in a certain order. HTML is quite flexible in general, but there are two tags that almost all documents need to have: the head and the body. The head should contain information about the document, as well as any scripts or stylesheets it uses, while the body should contain the main text of the document. So, as an example, a simple HTML document might look like this:
<html>
< head>
<title>my page</title>
<style>body { background-color: blue; } </style>
< /head>
< body>
<p>some text</p>
< /body>
< /html>
The first thing to notice is the way it starts and ends: with the HTML tag. This is essential when you write HTML. Now, notice what's included in the head and what's in the body: while the head tells you the title of the page and that its background colour is blue, it's the body that has the web page's text.
Once you've got that basic structure, all you need to do is add more tags to make your page.
A Guide to the Tags
html. The first and last tag. Tells the browser that the document is HTML.
head. The header.
title. The page's title (appears in the browser's title bar, right at the top of your screen).
style. Contains CSS that provides information on how the browser should present your page.
body. The main body of the page.
p. A paragraph. All text should be contained in paragraph tags – to start a new paragraph, close the old tag and open a new one.
b. Bold. Text between b tags becomes bold.
i. Italics.
u. Underline. Beware of using this tag for things like headings, as many users have come to expect underlined text on the web to be a link.
h. Heading. You should use different tags depending on how important your heading is, so h1 for a page's main title, h2 for subheadings, h3 for the next headings down, and so on.
a. The link tag (the a is a little confusing: it actually stands for 'anchor'). This tag lets you link some of your text to another page. It works by surrounding the text that you want to become a link, like this: <a href="http://www.example.com">click here</a>.
ul/ol. Stand for 'unordered list' and 'ordered list' – used to say that a list follows. The only difference is that ul uses bullet points while ol uses numbers.
li. List item, a tag used inside ul or ol, like this: <ul><li>item 1</li><li>item 2</li></ul>
img. Used for inserting images: <img src="image.jpeg">.
What you have to realize, though, is that HTML was designed from the beginning to be a very simple language to learn and to use – just because automated systems for producing it have a tendency to make it over-complicated, it doesn't mean that your code has to be that way. The best way to get started with HTML is to get over any fears you might have and just get stuck in.
Note that you will need to save files as filename.html before you will be able to open them in a web browser. If you're not sure how to do this with a text editor, use an HTML code editing program.
All About Tags
There's only one thing you really need to understand before you start writing pages in HTML, and that's the tag system. Basically, tags are commands in angle brackets, with text between them. For example, here is some text in a bold tag:
<b>bold text</b>
The second tag has a slash before its name because it's a closing tag. You can have as many tags inside other tags as you want, as long as you always remember to close the last one first. For example:
<b><i><u>bold, italic, underlined text</u></i></b>
If the tags are closed in the wrong order, then the code is invalid.
The only other thing you really need to understand about tags is that they can include some extra information in the opening tag. A link tag, for example, will include an 'href' (the URL it links to), like this: <a href="http://www.example.com">. Closing tags never contain any extra information.
The Structure of an HTML Document
These tags are usually laid out in a certain order. HTML is quite flexible in general, but there are two tags that almost all documents need to have: the head and the body. The head should contain information about the document, as well as any scripts or stylesheets it uses, while the body should contain the main text of the document. So, as an example, a simple HTML document might look like this:
<html>
< head>
<title>my page</title>
<style>body { background-color: blue; } </style>
< /head>
< body>
<p>some text</p>
< /body>
< /html>
The first thing to notice is the way it starts and ends: with the HTML tag. This is essential when you write HTML. Now, notice what's included in the head and what's in the body: while the head tells you the title of the page and that its background colour is blue, it's the body that has the web page's text.
Once you've got that basic structure, all you need to do is add more tags to make your page.
A Guide to the Tags
html. The first and last tag. Tells the browser that the document is HTML.
head. The header.
title. The page's title (appears in the browser's title bar, right at the top of your screen).
style. Contains CSS that provides information on how the browser should present your page.
body. The main body of the page.
p. A paragraph. All text should be contained in paragraph tags – to start a new paragraph, close the old tag and open a new one.
b. Bold. Text between b tags becomes bold.
i. Italics.
u. Underline. Beware of using this tag for things like headings, as many users have come to expect underlined text on the web to be a link.
h. Heading. You should use different tags depending on how important your heading is, so h1 for a page's main title, h2 for subheadings, h3 for the next headings down, and so on.
a. The link tag (the a is a little confusing: it actually stands for 'anchor'). This tag lets you link some of your text to another page. It works by surrounding the text that you want to become a link, like this: <a href="http://www.example.com">click here</a>.
ul/ol. Stand for 'unordered list' and 'ordered list' – used to say that a list follows. The only difference is that ul uses bullet points while ol uses numbers.
li. List item, a tag used inside ul or ol, like this: <ul><li>item 1</li><li>item 2</li></ul>
img. Used for inserting images: <img src="image.jpeg">.
downhill69- Memberz
- Posts : 73
Points : 5852
Reputation : 4
Join date : 2009-12-01
Re: Basic HTML knowledge
Thanks for the Tut.
I am looking for something which has a comparison of html with Bbcode
I am looking for something which has a comparison of html with Bbcode
Paris Hilton- Senior memberz
- Posts : 118
Points : 5986
Reputation : 2
Join date : 2009-12-02
Re: Basic HTML knowledge
Hey, anybody know how to create a bbcode from some iframe
S.T.D- Posts : 6
Points : 5400
Reputation : 0
Join date : 2010-03-14
Re: Basic HTML knowledge
S.T.D wrote:Hey, anybody know how to create a bbcode from some iframe
If it ain't predefined then you can't use it,and anyways it has some security risks when using on a non-html page.
lol- Memberz
- Posts : 67
Points : 5637
Reputation : 2
Join date : 2010-02-10
Similar topics
» Javascript to html converter - The Best
» Visual Basic 6 Black Book
» Create Multiple page website - PHP or html
» Cool way to make your computer talk to you!! NO INTERNET OR VISUAL BASIC NEEDED!
» Visual Basic 6 Black Book
» Create Multiple page website - PHP or html
» Cool way to make your computer talk to you!! NO INTERNET OR VISUAL BASIC NEEDED!
Ronie_iz_BaD Forums :: Communities and Networks :: Public software releases :: Programming :: Tutorials
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum