Html Flashcards

1
Q

What is HTML?

A

HTML stands for hyper text markup language. It is a language of the World Wide Web. It is a standard text formatting language which ya used to create and display pages on the web. It makes text more interactive and dynamic. It can turn text into images, tables, links..etc

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

What are tags?

A

HTML tags are composed of three things: an opening tag, content, and ending tag. Some tags are unclosed tags. HTML documents contain two things: content and tags. When a web browser reads an HTML document , the browser reads it from top to bottom, and left to right. HTML tags are used to create HTML documents and render their properties. Each HTML tags have different properties. Content is placed between tags to display data on the web page.

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

Do all HTML tags have an end tag ?

A

No. There are some HTML tags that don’t need a closing tag. For example img and br

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

How many types of heading does an HTML contain

A
  1. H1-h6
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the difference between HTML elements and tags?

A

The element is an individual component of the HTML web page or document. It represents semantics or meaning. For example the title element represents the title of the document. the tags are used to make up and contain the elements.

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

What are attributes and how do you use them?

A

Each tag has additional attributes that change the way the tag behaves or is displayed. For example an input tag has a type attribute. Attributes are specified directly after the name of the tag , they should only appear in opening or self closing tags. Never closing tags.

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

What is the difference between inline and block elements?

A

A block level element is drawn as a block that stretches to fill the full width of the page. It will always start a new line and be in its own line. Block by default tags include (div, img, section,form, nav) in-line elements are drawn where they are defined and only take up space that is absolutely needed. Inline by default tags include ( span, b, strong, a, input)

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

When are comments used in HTML?

A

To help understand the code easier, and explain it to future developers who might need to use it.

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

What are some HTML tags used to display data in a tabular form?

A

Table, tr, th, td, caption, colgroup, col, tbody, thead, tfooter

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

How to create a hyper link in HTML?

A

The HTML provides the anchor tag to create a hyperlink that links one page to another.

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

What are some common lists that are used when designing a page?

A

Ordered lists, unordered lists, and definition lists.

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

What is semantic HTML?

A

It’s a coding style, it’s the use of HTML markup to reinforce the semantics or meaning of the content. For example: in semantic HTML b and I are not used for bold and italic. Instead we use strong and em.

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

How to create a nested webpage in HTML?

A

The iframe tag is used to display a nested webpage. In other words, it represents a webpage within a webpage.

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

What is an image map?

A

An image map is used for linking many different webpages using a single image. It’s represented by the map tag.

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

Does a hyperlink only apply to text?

A

No. You can use them for both text and images.

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

Explain the layout of HTML.

A

HTML layout specifies a way in which the web page is arranged. Every website has a specific layout to display content in a specific manner. Following are different HTML elements which are used to define the different parts of a webpage:

: It is used to define a header for a document or a section.
: This defines a container for navigation links
: It is used to define a section in a document
: This is used to define an independent, self-contained article
: It is used to define content aside from the content
: It is used to define a footer for a document or a section

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

What is a marquee?

A

Marquee is used for the scrolling text on a web page. It scrolls the image or text up, down, left or right automatically. You should put the text which you want to scroll within the …… tag.

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

What are the tags used to separate a section of texts?

A

There are three tags that can be used to separate the texts:

<br></br> tag – Usually <br></br> tag is used to separate the line of text. It breaks the current line and conveys the flow to the next line

<p> tag – This contains the text in the form of a new paragraph.
</p>

<blockquote> tag – It is used to define a large quoted section. If you have a large quotation, then put the entire text within <blockquote>……….</blockquote> tag.</blockquote>

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

What is the difference between DIV and SPAN in HTML?

A

The difference between span and div is that a span element is in-line and usually used for a small chunk of HTML inside a line,such as inside a paragraph. Whereas, a div or division element is block-line which is equivalent to having a line-break before and after it and used to group larger chunks of code.

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

What is the purpose of using alternative texts in images?

A

The purpose of using alternative texts is to define what the image is about. During an image mapping, it can be confusing and difficult to understand what hotspots correspond to a particular link. These alternative texts come in action here and put a description at each link which makes it easy for users to understand the hotspot links easily.

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

How to create a new HTML element?

A

You can create new elements for the document in the following way:

document.createElement﴾”myElement”﴿

It can be also be used in the HTML as:

hello edureka!

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

Is the tag considered as a HTML tag?

A

No, the declaration is not an HTML tag.

There are many type of HTML, such as, HTML 4.01 Strict, HTML 4.01 Transitional, HTML 4.01 Frameset, XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset, XHTML 1.1 etc. So, is used to instruct the web browser about the HTML page.

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

Why is a URL encoded in HTML?

A

An URL is encoded to convert non-ASCII characters into a format that can be used over the Internet because a URL is sent over the Internet by using the ASCII character-set only. If a URL contains characters outside the ASCII set, the URL has to be converted. The non-ASCII characters are replaced with a “%” followed by hexadecimal digits.

24
Q

What are the entities in HTML

A

The HTML character entities are used as a replacement for reserved characters in HTML. You can also replace characters that are not present on your keyboard by entities. These characters are replaced because some characters are reserved in HTML.

25
Q

Can you create a multi-colored text on a web page?

A

Yes, we can create a multi-colored text on a web page. To create a multicolor text, you can use for the specific texts that you want to color.

26
Q

How to make a picture of a background image of a web page?

A

To make a picture a background image on a web page, you should put the following tag code after the tag.

1

Here, replace the “image.gif” with the name of your image file which you want to display on your web page.

27
Q

What is the use of a span tag? Explain with example.

A

The span tag is used for following things:

For adding color on text
To add background on text
Highlight any color text
Example:

<span>
In this page we use span.
</span>

28
Q

What is the advantage of collapsing white space?

A

White spaces are a blank sequence of space characters, which is treated as a single space character in HTML. Because the browser collapses multiple spaces into a single space, you can indent lines of text without worrying about multiple spaces. This enables you to organize the HTML code into a much more readable format.

29
Q

Is there any way to keep list elements straight in an HTML file?

A

By using indents, you can keep the list elements straight. If you indent each sub nested list in further than the parent list, you can easily determine the various lists and the elements that it contains.

30
Q

Explain The Key Differences Between LocalStorage And SessionStorage Objects.

A

The key differences between localStorage and sessionStorage objects are as follows:

The localStorage object stores the data without an expiry date. However, sessionStorage object stores the data for only one session.
In the case of a localStorage object, data will not delete when the browser window closes. However, the data gets deleted if the browser window closes, in the case of sessionStorage objects.
The data in sessionStorage is accessible only in the current window of the browser. But, the data in the localStorage can be shared between multiple windows of the browser

31
Q

When is it appropriate to use frames?

A

Frames can make navigating a site much easier. If the main links to the site are located in a frame that appears at the top or along the edge of the browser, the content for those links can be displayed in the remainder of the browser window.

32
Q

What happens if you open the external CSS file in a browser?

A

When you try to open the external CSS file in a browser, the browser cannot open the file, because the file has a different extension. The only way to use an external CSS file is to reference it using tag within another HTML document.

33
Q

What is the hierarchy that is being followed when it comes to style sheets?

A

If a single selector includes three different style definitions, the definition that is closest to the actual tag takes precedence. Inline style takes priority over embedded style sheets, which takes priority over external style sheets.

34
Q

How do you create text on a webpage that allows you to send an email when clicked?

A

To change the text into a clickable link to send an email, you need to use the mailto command within the href tag. You can write it in the following way:

<a>text to be clicked</a>

35
Q

How are active links different from normal links?

A

The default color for normal and active links is blue. Some browsers recognize an active link when the mouse cursor is placed over that link. Whereas, others recognize active links when the link has the focus. Those that don’t have a mouse cursor over that link is considered a normal link.

36
Q

Are there instances where the text will appear outside of the browser?

A

By default, the text is wrapped to appear within the browser window. However, if the text is part of a table cell with a defined width, the text could extend beyond the browser window.

37
Q

What is the advantage of grouping several checkboxes together?

A

The checkboxes don’t affect one another. But, grouping these checkboxes together help to organize them. Checkbox buttons can have their name and do not need to belong to a group. A single web page can have many different groups of checkboxes.

38
Q

What happens if there is no text between the tags? Does this affect the display of the HTML file?

A

If there is no text present between the tags, there is nothing to format. Therefore, no formatting will appear. Some tags, such as the tags without a closing tag like the <img></img> tag, do not require any text between them.

39
Q

What are the limits of the text field size?

A

The default size for a text field is around 13 characters. However, if you include the size attribute, you can set the size value to be as low as 1. The maximum size value will be determined by the browser width. Also, if the size attribute is set to 0, the size will be set to the default size of 13 characters.

40
Q

What is the relationship between the border and rule attributes?

A

Default cell borders, with a thickness of 1 pixel, are automatically added between cells if the border attribute is set to a nonzero value. Similarly, If the border attribute is not included, a default 1-pixel border appears when the rules attribute is added to the tag.

41
Q

What is SVG?

A

HTML SVG is used to describe the two-dimensional vector and vector or raster graphics. SVG images and their behaviors are defined in XML text files. So as XML files, you can create and edit an SVG image with the text editor. It is mostly used for vector type diagrams like pie charts, 2-Dimensional graphs in an X, Y coordinate system.

42
Q

What is button tag?

A

The button tag is used in HTML 5. It is used to create a clickable button within the HTML form on the web page. This tag creates a “submit” or “reset” button. The button tag code is as follows:

Click Here

43
Q

List the media types and formats supported by HTML.

A

HTML supports a wide range of media formats for sound, music, videos, movies, and animations. Some of the extensions supported by each media format are:

Images– png, jpg, jpeg, gif, apng, svg, bmp, BMP ico, png ico
Audio– MIDI, RealAudio, WMA, AAC, WAV, Ogg, MP3, MP4
Video– MPEG, AVI, WMV, QuickTime, RealVideo, Flash, Ogg, WebM, MPEG-4 or MP4

44
Q

What is Cell Spacing and Cell Padding?

A

Cell Spacing is referred to as the space or gap between the two cells of the same table. Whereas, Cell Padding is referred to as the gap or space between the content of the cell and cell wall or cell border.

Example:

45
Q

What is difference between HTML and XHTML?

A

The differences between HTML and XHTML are:

HTML is an application of Standard Generalized Markup Language. Whereas, XML is an application of Extensible Markup Language.
The first one is a static Web Page whereas the later one is a dynamic Web Page.
HTML allows programmer to perform changes in the tags and use attribute minimization whereas XHTML when user need a new markup tag then user can define it in this.
HTML is about displaying information whereas XHTML is about describing the information.

46
Q

How many types of CSS can be included in HTML?

A

There are three ways to include the CSS with HTML:

Inline CSS: It is used for styling small contexts. To use inline styles add the style attribute in the relevant tag.

External Style Sheet: This is used when the style is applied to many pages. Each page must link to the style sheet using the tag. The tag goes inside the head section.

Internal Style Sheet: It is used when a single document has a unique style. Internal styles sheet needs to put in the head section of an HTML page, by using the tag in the following way:

47
Q

What are logical and physical tags in HTML?

A

Logical tags are used to tell the meaning of the enclosed text. The example of the logical tag is <strong> </strong> tag. When we enclose the text in the strong tag, it tells the browser that enclosed text is more important than other texts.

Physical tags are used to tell the browser how to display the text enclosed in the physical tag. Some of the examples of physical tags are <b>, <big>, <i>.</i></big></b>

48
Q

How can you apply JavaScript to a web page?

A

In order to make your webpage more interactive, you need JavaScript. It is a scripting language that allows you to interact with certain elements on the page, based on user input. As with CSS, there are three main ways of including JavaScript:

Inline

Certain HTML elements allow you to execute a piece of JavaScript when a certain event occurs. For example, a button allows you to run a script when you click on it. These events are accessed through attributes and differ based on the events that are available on each element. Here is an example that shows an alert with a message when the user clicks on it:

Script block

You can define a script block anywhere on the page, which will get executed as soon as the browser reaches that part of the document. This can be inside the or section of your document.

    var x = 5;
    var y = 6;
    var result = x + y;
    alert(“X + Y is equal to " + result);

Link to a JavaScript file

It allows you to keep the content of the page separate to how users interact with that content. Also, it allows you to load the same script on multiple pages. As with the script block, you can load a JavaScript file from the or .

49
Q

Name some new features which were not present in HTML but are added to HTML5?

A

DOCTYPE declaration:

section: Section tag defines a section in the document, such as a header, footer or in other sections of the document. It is used to define the structure of the document.
header: Header tag defines the head section of the document. A header section always sticks at the top of the document.
footer: Footer tag defines the footer section of the document. A footer section always sticks at the bottom of the document.
article: Article tag defines an independent piece of the content of a document.
main: The main tag defines the main section in the document which contains the main content of the document.
figcaption: Figcaption tag defines the caption for the media elements such as an image or video.

50
Q

Why Meta tags are used in HTML?

A

Meta tags in HTML are used by the developer to tell the browser about the page description, author of the template, character set, keywords and many more.

Meta tags are used for search engine optimization to tell the search engine about the page contents.

51
Q

Explain about Canvas.

A

Canvas is a pixel-based graphics and it is one of the new features of HTML5.

It provides a space in the document where we can draw graphics by using JavaScript and it is resolution dependent, hence the quality will be affected when it’s zoomed or resized.

52
Q

Explain new form elements in HTML5.

A

The new form elements that were added into HTML5 are:

Datalist – It’s used as a list of options for input control.
Keygen – This tag defines a key-pair generator (Private/Public) field.
Output – It’s used to show the result of a calculation.

53
Q

What is Quirks mode in HTML5?

A

If we do not include the element in our HTML page or Document, it will go to Quirks Mode. In this mode, the HTML element depends on the browser. Hence the content will be displayed according to the browser.

54
Q

How do you insert a comment in HTML?

A

Comments in HTML begins with “”

55
Q

How do you insert a copyright symbol on a browser page?

A

To insert the copyright symbol, you need to type © or & #169; in an HTML file.