HTML basic syntax and Elements
HTML:
Hyper Text Markup language (HTML) was devised as an easy means to format textual documents .Hyper text transfer protocol ( HTTP ) is the method for delivering HTML documents which the client browser then renders into an on-screen image. It is a standard markup language for making web pages and you can make your own website. To date HTML has gone through five major standards, including the latest HTML5 .In addition to HTML , Cascading Style Sheets(CSS) , EXTENSIBLE MARKUP LANGUAGE (XML) and Javascript also provides valuable contribution to the way of the web.
HTML SYNTAX:-
The concept and use of HTML is straightforward.
Individual tags , special text strings that are interpreted as formatting commands by the browser are placed within a document to lend structure and format accordingly. Each tag has a beginning and an ending tag.
Each tag begins with a left-pointing angle bracket (<)and ends with a right pointing angle bracket.(>).
Between the brackets are keywords indicating the type of tag. Beginning tags include any parameters necessary for the tag , ending tags contain only the keyword prefixed by a slash(/).
for example, to bold a text we will surround it with bold tags <b> and </b>.
YOUR FIRST HTML PAGE:-
output:-
HTML ELEMENTS:-
HTML provides more than 90 elements
Categories of Elements
- Top-level elements
- Head elements
- Block level elements
- Inline elements
Top-level elements:
Html, head and body
Head elements
Elements placed inside head including page title, style(css stylesheet),link(related documents),
meta(data about the document),base(URL of document),script(client-side scripting)
Block-level elements
elements behaving like paragraphs includingh1 to h6(headings),p(paragraph),pre(preformatted text),
div(designated block), ul, ol , dl(lists),table(tabulation) and form (user input forms) always start on a br
new line
,and any element immediately after the block element also begin on a new line.
Inline elements
elements behaving like words, characters or phrases including a(anchor or hyperlink), br(brek line),image(picture or graphics),
em(emphasis),strong(strong emphasis),sub(subscript),sup(superscript),code(computer code),var(variable name),
kbd(text for user input),samp(sample output) ,and span
(designated inline scope).
when an element is placed inside another, the containing element is the parent and the contained element is the child.
- All tags begin with " < " and ends with " > ". The tag name is given immediately following the leading < . Make sure the tag is spelled correctly. Unrecognized tags are ignored by browsers .Any attributes are given following the tag name in the form :
- Tag and attribute names are given in lower case . Attributes are always given in the form
- Most elements involve opening and closing tags . Other elements such as <br> and <img> ,do not have closing tags and are known as empty elements .
- Elements must be well-formed. This means no missing opening or closing tags and no improper nesting. For example,
- Attributes can be required or optional and can be given in any order.
- Extra White space and line breaks are allowed between the tag name and attributes and around the = sign inside an attribute.
- T he body element may contain only block-level HTML elements . Freestanding text or inline elements are not allowed directly in the body element.
Comments
Post a Comment