Professional Documents
Culture Documents
HTML Tags
HTML tags are element names surrounded by angle brackets:
• <tagname>content goes here...</tagname>
• HTML tags normally come in pairs like <p> and </p>
• The first tag in a pair is the start tag, the second tag is the end tag
• The end tag is written like the start tag, but with a forward slash inserted
before the tag name
• The start tag is also called the opening tag, and the end tag the closing tag.
HTML Attributes
Attributes provide additional information about HTML elements.
• All HTML elements can have attributes
• Attributes provide additional information about an element
• Attributes are always specified in the start tag
• Attributes usually come in name/value pairs like: name="value"
HTML Attributes
• Below is an alphabetical list of some attributes often used in HTML:
Attribute Description
Specifies an alternative text for an image, when the image cannot be
Alt
displayed
disabled Specifies that an input element should be disabled
Href Specifies the URL (web address) for a link
Id Specifies a unique id for an element
Src Specifies the URL (web address) for an image
Style Specifies an inline CSS style for an element
Title Specifies extra information about an element (displayed as a tool tip)
HTML offers web authors three ways for specifying lists of information. All lists must
contain one or more list elements. Lists may contain −
• <ul> − An unordered list. This will list items using plain bullets.
• <ol> − An ordered list. This will use different schemes of numbers to list your items.
• <dl> − A definition list. This arranges your items in the same way as they are
arranged in a dictionary.
HTML Images
Images can improve the design and the appearance of a web page.
HTML Images Syntax
In HTML, images are defined with the <img> tag.
The <img> tag is empty, it contains attributes only, and does not have a closing
tag.
The src attribute specifies the URL (web address) of the image:
HTML Forms
• The <form> Element
• The HTML <form> element defines a form that is used to collect user
input:
• An HTML form contains form elements.
• Form elements are different types of input elements, like text fields,
checkboxes, radio buttons, submit buttons, and more.
Type Description
<input type="text"> Defines a one-line text input field
Defines a radio button (for selecting one of many
<input type="radio">
choices)
<input
Defines a submit button (for submitting the form)
type="submit">
• Text Input
• <input type="text"> defines a one-line input field for text input:
• Radio Button Input
• <input type="radio"> defines a radio button.
• EX.This is how the HTML code above will be displayed in a browser:
Male Female
The Submit Button
• <input type="submit"> defines a button for submitting the form data to a
form-handler.
• The form-handler is typically a server page with a script for processing
input data.
The <frame> tag was used in HTML 4 to define one particular window (frame)
within a <frameset>.
HTML frames are used to divide your browser window into multiple sections
where each section can load a separate HTML document. A collection of frames
in the browser window is known as a frameset. The window is divided into frames
in a similar way the tables are organized: into rows and columns.
Disadvantages of Frames
There are few drawbacks with using frames, so it's never recommended to use
frames in your webpages −
• Some smaller devices cannot cope with frames often because their screen
is not big enough to be divided up.
• Sometimes your page will be displayed differently on different computers
due to different screen resolution.
• The browser's back button might not work as the user hopes.
• There are still few browsers that do not support frame technology.