HTML Flashcards
What does HTML stand for?
HyperText Markup Language
A language for annotating text so that it can link to other texts… Also images, videos, sounds, etc
HTML is interpreted… meaning:
A browser interprets HTML and displays it according to its meaning.
The first line of a HTML 5 document should be:
The doctype (version description) <!DOCTYPE html>
EVERYTHING ELSE IS INSIDE THE <html> TAGS
Empty tags
Tags that do not enclose any text… e.g. a line break <br></br> or an image <img … >
Tag attributes
-Added information in the start tag
(attributeName=”attributeValue”)
E.g.: source of the image: < img src=”test.jpg” >
ID
Used to identify a single element… no dublicates!!
Class
Used to identify a group of elements
HTML Head
- Meta information
- Page title < title > MyTitle < /title > Typically displayed in the browser bar
-Page encoding < meta charset=”UTF-8” >
-Page information in meta tags, name=”keywords” content=”the…content!”
SEARCH ENGINES LOVE METADATA!!!
-Inclusion of CSS docs and scripts
HTML Body
Contains the actual content that is rendered by the browser
- Text
- Links
- Images
- Videos
- …
Headings
< h1 > to < h6 > semantically most important to least important… SEMANTICALLY.
Paragraphs
< p > paragraph :P < /p >
Images
< img src=”source.png” alt=”description” >
empty tag
Image source is given by src attribute
alt attribute is for a description for when the image does not load or for screen readers… helps the blind
Lists
Unordered or Ordered lists
< ul > and < ol >
list items are enclosed with < li > list item < /li >
Hyperlinks
< a href=”someURL.bla” target=”_blank” > here < /a >
Defines a hyperlink to another resource
href is the target url
target defines how to open the link…
- _blank : in another window/tap
- _self: in the same window
Hyperlink within a document
Give an ID to an HTML element with the id attribute
Link with href to that attribute
Can be appended on an absolute and relative url