html 1 Flashcards

1
Q

what is html

A

Hyper text markup language
Standard markup language for creating webpages
Describes the structure of a web page
Consists of a series of elements, and elements tell the browser how to display the content
Elements label pieces of content such as “this is a heading” etc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

explain an example

A

Doctype html declaration defines that this document is an html5 document
Html element is the root element of an html page
Head element contains meta information about the html page
Title element specifies the title
Body element defines the document’s body and is a container for all the visible contents such as lists, headings, paragraphs etc
H1 element defines a large heading
P element defines a paragraph

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is an html element

A

Defined by a start tag, some content and an end tag
The HTML element is everything from the start tag to the end tag

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is a web browser

A

Purpose of a web browser is to read html documents and display them correctly
Browser doesn’t display html tags but uses them to determine how to display the document

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is the sturcture of html documents

A

All html document must start with a document type declaration: DOCTYPE html
The html document itself begins with html and ends with /html
The visible part of the html document is between body and /body

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what does the doctype declaration of

A

This represents the document type, and helps browsers display the webpage correctly
It must only appear once at the top of the page before any html tags
The doctype declaration is not case sensitive
For html5 it is <!DOCTYPE html >

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what are html headings

A

Html headings are defined with the h1 to h6 tags
H1 is the most important heading
H6 is the least important heading

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what are html links

A

Defined with the a tag
Link’s destination is specified in the href attribute
Attributes are used to provide additional information about html elements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what are html images

A

Defined by img tag
Source file src, alternative text alt, width and height and provided as attributes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is the html element

A

Everything from the start tag to the end tag
Headings, paragraphs, etc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what is the nested html elements

A

Html elements that contain other elements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what are empty elements

A

Elements with no content
The br element defines a line break and is an empty element without a closing tag

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

are html tags case sensitive

A

Html tags are not case sensitive
Aka P means the same as p

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what is additional info about these tags

A

Html defines the root of an html document
Body defines the documents body
H1 to h6 defines html headings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what are html attributes

A

All html elements can have html attributes
Attributes provide additional information about elements
Attributes are always specified in the start tag
Attributes usually come in name/value pairs like name = “ value “

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what is the href attribute

A

a tag defines a hyperlink
href attribute specifies the url of the page the link goes to

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

what is the src attribute

A

Img tag used to embed image
Src attribute specifies the path to the image to be displayed

18
Q

what are the two ways to specify the url in the src attribute

A

Absolute url - links to an external image hosted on another website
Relative url - links to an image that is hosted within the website

19
Q

what are the width and height attributes

A

Img should contain the width and height attributes which specify the width and height of the image

20
Q

what is the alt attribute

A

Specifies an alternate text for the image if the image cannot be displayed

21
Q

what is the style attribute

A

Used to add styles to an element, such as color, font, size and more

22
Q

what is the lang attribute

A

Use lang attribute inside html tag to declare the language of the web page
Meant to assist search engines and browsers

23
Q

what is the title attribute

A

Defines some extra information about an element
Value of the title attribute will be displayed a sa tooltip when you move the mouse over the element

24
Q

what are headings

A

Titles or subtitles to display on a page
Defined with the h1 to h6 tags
H1 most important while h6 is the least important

25
Q

how to make a bigger heading

A

You can specify the size for any heading with the style attribute using css font size property

26
Q

what is a paragraph

A

Html p element defines a paragraph
Paragraph always starts on new line and browsers automatically add some white space aka a margin before and after a paragraph

27
Q

what are the html horizontal rules

A

Hr tag defines a thematic break in an html webpage and is most often displayed by a horizontal rule
Hr element is used to separate content in an html page

28
Q

what is a line break

A

Br tag defines a line break
Used if you want a line break aka a new line without starting a new paragraph

29
Q

what are links

A

Html links are hyperlinks
Html tag a defines a hyperlink
Most important attribute of the a element is the href attribute which indicates the links destination

30
Q

what is the target attribute

A

Target attribute specifies where to open the linked document
Can have one of the following values
Self - default, opens document in same window/tab it was clicked
Blank - opens document in new window / tab
Parent - opens document in the parent frame
Top - opens document in the full body of the window

31
Q

how to use button as a link

A

Have to add some javascript code
Allows you to specify what happens at certain events such as a click of a button

32
Q

what is the img image tag

A

Used to embed an image in a webpage
Images are linkedin to webpages
Img tag is empty, it contains attributes only and does not have a closing tag

33
Q

what is the img tag’s two required attributes

A

Src - specifies the path to an image
Alt - specifies an alternate text for the image

34
Q

what is the src attribute

A

Required src attribute specifies the path (URL) to the image

35
Q

what is the alt attribute

A

The alt attribute provides an alternate text for an image if the user for some reason cannot view it

36
Q

what to do with width and height

A

Can use the style attribute to specify the width and height of an image
Better to use style because it prevents style sheets from changing the size of images
Alternatively can use the width and height attributes - these always define width and height in pixels

37
Q

what if image is another folder

A

Must include the folder name in the src attribute

38
Q

what is image is on another server / website

A

To point to an image on another serve, you must specify an absolute (full) URL in the src attribute

39
Q

how to use an image as a link

A

Put the img tag inside of the a tag

40
Q

how to get an image to float

A

Use the css float property to let the image float to the right or left