Előző oldal Következő oldal

A legfontosabb tagek a HTMLben a címsor, bekezdés és sortörés tagek.

A legjobb módja a HTML megtanulásának a példák használata. Itt van egy jó kis HTML szerkesztő, amivel kedvedre szerkesztheted a HTML kódodat, majd a Teszt gomb megnyomásával megnézheted az eredményt.


Csináld Magad - Példák

Egy nagyon egyszerű HTML dokumentum.
Ez a példa egy nagyon egyszerű HTML dokumentum, mindössze a legminimálisabb HTML tagekkel. Bemutatja, hogy a szövegtörzsön elemen belüli szöveg hogyan jelenik meg a böngészőben. 

Egyszerű bekezdések
Ez a példa bemutatja, hogy a bekezdés elemen belüli szöveg hogyan jelenik meg a böngészőben.

(Még több példát találhatsz az oldal alján)


Címsorok

A címsorokat a <h1>-tól <h6>-ig tagekkel definiálunk. A <h1> a legnagyobb, a <h6> pedig a legkisebb címsor.

<h1>Ez egy címsor</h1>
<h2>Ez egy címsor</h2>
<h3>Ez egy címsor</h3>
<h4>Ez egy címsor</h4>
<h5>Ez egy címsor</h5>
<h6>Ez egy címsor</h6>

HTML automatically adds an extra blank line before and after a heading.


Bekezdések

A bekezdéseket a <p> tag segítségével definiáljuk.

<p>Ez egy bekezdés</p>
<p>Ez egy másik bekezdés</p>

A HTML automatikusan egy üres sort illeszt a bekezdés elé és után.


Sortörések

A <br> taget használjuk, ha új sor akarunk kezdeni, de új bekezdést nem. A <br> tag sortörét okoz akárhova is rakod.

<p>Ez <br> egy beke<br>zdés sortörésekkel</p>

A <br> tag egy üres tag. Nincs záró tagje.


Comments in HTML

The comment tag is used to insert a comment in the HTML source code. A comment will be ignored by the browser. You can use comments to explain your code, which can help you when you edit the source code at a later date.

<!-- This is a comment -->

Note that you need an exclamation point after the opening bracket, but not before the closing bracket.


Basic Notes - Useful Tips

When you write HTML text, you can never be sure how the text is displayed in another browser. Some people have large computer displays, some have small. The text will be reformatted every time the user resizes his window. Never try to format the text in your editor by adding empty lines and spaces to the text.

HTML will truncate the spaces in your text. Any number of spaces count as one. Some extra information: In HTML a new line counts as one space. 

Using empty paragraphs <p> to insert blank lines is a bad habit. Use the <br> tag instead. (But don't use the <br> tag to create lists. Wait until you have learned about HTML lists.)

You might have noticed that paragraphs can be written without the closing tag </p>. Don't rely on it. The next version of HTML will not allow you to skip ANY closing tags.

HTML automatically adds an extra blank line before and after some elements, like before and after a paragraph, and before and after a heading.

We use a horizontal rule (the <hr> tag), to separate the sections in our tutorials.


More Examples

More paragraphs
This example demonstrates some of the default behaviors of paragraph elements.

Line breaks
This example demonstrates the use of line breaks in an HTML document.

Poem problems
This example demonstrates some problems with HTML formatting.

Headings
This example demonstrates the tags that display headings in an HTML document.

Center aligned heading
This example demonstrates a center aligned heading.

Horizontal rule
This example demonstrates how to insert a horizontal rule.

Hidden comments
This example demonstrates how to insert a hidden comment in the HTML source code.

Background color
This example demonstrates adding a background-color to an HTML page.


Alapvető HTML tagek

Tag Leírás
<html> Definiál egy HTML Dokumentumot
<body> Definiálja a dokumentum törzsét
<h1> to <h6> Címsort definiál 1-től 6-ig
<p> Egy bekezdést definiál
<br> Egy egyszerű sortörést illetsz be
<hr> Egy vízszintes vonalat definiál
<!--> Megjegyzést definiál




http://www.w3schools.com/html/default.asp