HTML/CSS/JS Flashcards
What is HTML?
Hyper Text Markup Language is a standard markup language for web pages. It contains HTML elements, represented by tags, which tell browser how to display content.
Explain HTML tags.
HTML elements are represented by tags, which are element names surrounded by angle brackets. They normally occur in pairs and end tag starts with forward slash.
Do all HTML tags occur in pairs?
No.
The HTML body and title tags are in pairs whereas the image and break tags are not.
What are the common lists used in HTML pages? Explain each one.
Ordered: list starts with < ol > tag and every list item starts with < li > tag.
Unordered: list starts with < ul > tag and every list item starts with < li > tag.
Definition: used to create list of items with their descriptions. List starts with < dl > tag, < dt > defines the term and < dd > describes every term.
Menu: only supported by Firefox. List starts with < menu > tag and each item starts with < menuitem > tag
How to insert a comment in HTML page?
< ! β comment β >
What are image maps?
With HTML image maps, we can create multiple clickable areas on image such that single image containing computer, phone and TV can open different pages if you click on computer or on phone or on TV.
In the <img></img> tag we provide a usemap attribute usemap whose value must start with # symbol and refer it in a tag bearing the same name attribute as usemap in image tag.
Inside tag we provide various areas specifying their co-ordinates, shapes and either Javascript function (onclick) or link it to some other HTML page.
The areas start with tag.
The shapes can be rectangular, circular, polygonal or default (entire region).
If the shape is rectangular, the co-ordinates are one pair for x-axis and one for y-axis where each pair has two points, first one from left margin and next one from top margin (all in pixels). For eg. 34,44,270,350.
If the shape is circular, we first give the center of area as pair and then radius (all in pixels).
How to create links to sections withing same page?
Inside the <a> tag we can either use #top or #bottom to go to page top or bottom as an href value</a>
or we can give ID selector of an HTML element to </a><a> tagβs href so that we move to that element.</a>
For eg. <p></p>
</a><a></a>
What does the attribute βaltβ do in <img></img> tag?
It displays alternate text of the image if image cannot be displayed by browser.
Does a hyperlink apply to text only?
No, we can use it with images as well by surrounding image with <a> tag.</a>