0% found this document useful (0 votes)
1K views8 pages

HTML and CSS MCQs for Web Development

This document contains 31 multiple choice questions about HTML. It covers topics like HTML tags, CSS properties, advantages of separating styles into CSS files, usage of anchor tags, designing HTML forms, and differences between GET and POST methods. The questions range from basic to more advanced concepts in HTML and CSS.

Uploaded by

Shalini Kumaran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views8 pages

HTML and CSS MCQs for Web Development

This document contains 31 multiple choice questions about HTML. It covers topics like HTML tags, CSS properties, advantages of separating styles into CSS files, usage of anchor tags, designing HTML forms, and differences between GET and POST methods. The questions range from basic to more advanced concepts in HTML and CSS.

Uploaded by

Shalini Kumaran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

HTML MCQs

[Link] is HTML?
a)Hyper Text Marking Language b) Hyper Text Machine Language c)Hyper TextMiddle
Language d)Hyper Text Markup Language
2. We can add an ____ tag for inline frames.
a) <iframe> b) <framedset> c)<framename> d)<map>
3. The ____ element replicates asterisk for any keystroke.
a) password b) radio c) text d) checkbox
4. FTP Stands for ____________.
a) Field Transfer Protocol b)File Transfer Protocol c) FixTransfer Protocol d) Flexible Transfer
Protocol
5. Which tag is used to create a list that displays items with bullets?
a) <OL> b)<UL> c)<list> d)<DL>
6. Write a code for making text area?
a) <textarea> b) <input=”textarea”> c) <input type =”textbox”> d) <input type=”text area”>
7. For largest level of heading which tag is used?
a) <h1> b) <h6> c) <heading> d) <head>
8. Name some of the new features of HTML5.
HTML5 introduces a number of new elements and attributes that helps in building a modern
websites. Following are great features introduced in HTML5 −

• New Semantic Elements − These are like <header>, <footer>, and <section>.

• Forms 2.0 − Improvements to HTML web forms where new attributes have been
introduced for <input> tag.

• Canvas − This supports a two-dimensional drawing surface that you can program with
JavaScript.

• Audio & Video − You can embed audio or video on your web pages without resorting
to third-party plugins.

• Microdata − This lets you create your own vocabularies beyond HTML5 and extend
your web pages with custom semantics.
• Drag and drop − Drag and drop the items from one location to another location on a
same webpage.

9. What is Web Forms 2.0?


Web Forms 2.0 is an extension to the forms features found in HTML4. Form elements and
attributes in HTML5 provide a greater degree of semantic mark-up than HTML4 and remove
a great deal of the need for tedious scripting and styling that was required in HTML4.

10. What is the purpose of 'placeholder' attribute in HTML5?


HTML5 introduced a new attribute called placeholder. This attribute on <input> and
<textarea> elements provides a hint to the user of what can be entered in the field. The
placeholder text must not contain carriage returns or line-feeds.

11. What is the purpose of 'nav' tag in HTML5?


This tag represents a section of the document intended for navigation.

12. What is the purpose of 'aside' tag in HTML5?


This tag represents a piece of content that is only slightly related to the rest of the page.

13. What is the purpose of 'section' tag in HTML5?


This tag represents a generic document or application section. It can be used together with
h1-h6 to indicate the document structure.

14. Are HTML tags case sensitive?


No!

15. Is HTML5 backward compatible with old browsers?


Yes! HTML5 is designed, as much as possible, to be backward compatible with existing web
browsers. New features build on existing features and allow you to provide fallback content
for older browsers.

It is suggested to detect support for individual HTML5 features using a few lines of JavaScript.

16. If we don't want to allow a floating div to the left side of an element, which css property
will we use ?

[Link]

[Link]
[Link]

[Link]

Answer: B

17. Suppose we want to arragnge five nos. of DIVs so that DIV4 is placed above DIV1. Now,
which css property will we use to control the order of stack?

A.d-index

B.s-index

C. x-index

D.z-index

Answer: D

18. If we want to wrap a block of text around an image, which css property will we use ?

[Link]

[Link]

C. float

[Link]

Answer: C

19. A small piece of program that can add interactivity to your website is called as

A. Meta
B. Script
C. Marquee
D. All of above

Answer: B
20. How do you display hyperlinks without an underline?

A. a {text-decoration:no underline}

B. a {decoration:no underline}

C. a {text-decoration:none}

D. a {underline:none}

Answer: C

21. How do you display a border like this:

The top border = 10 pixels

The bottom border = 5 pixels

The left border = 20 pixels

The right border = 1pixel?

A. border-width:10px 20px 5px 1px

B. border-width:10px 1px 5px 20px

C. border-width:5px 20px 10px 1px

D. border-width:10px 5px 20px 1px

Answer: B

22. When trying to access a URL, the following message is displayed on the browser:
Server; Error 403.
What could be the reason for the message?

a. The requested HTML file is not available


b. The path to the interpreter of the script file is invalid
c. The first line of the output from the script is not a valid HTTP header
d. The requested HTML file or CGI script has insufficient permission.
Answer: D

23. The elements <DIV> and <SPAN> have the following characteristics

a. Element <DIV> inherits properties defined for <SPAN> in a stylesheet


b. Elements <SPAN> and <DIV> define content to be inline or block-level
c. <DIV> and <SPAN> are used as alternatives for the element <P>
d. <DIV> is used inside element <P>.

Answer: B

24. How will you make all paragraph elements 'RED' in color ?

[Link] {color: red;}

[Link] {color: #990000;}

[Link].p {color: #998877;}

D.p {color: red;}

Answer: D

25. HTML(Hypertext Markup Language) has language elements which permit certain actions
other than describing the structure of the web document. Which one of the following actions
is NOT supported by pure HTML (without any server or client side scripting)pages?

A. Embed web objects from different sites into the same page

B. Refresh the page automatically after a specified interval

C. Automatically redirect to another page upon download

D. Display the client time as part of the page

Answer: D
26. Consider the HTML t able definition given below:

<table border=1>

<tr>

<td rowspan=2>ab</td>

<td colspan=2> cd </td>

</tr>

<tr>

<td>ef</td>

<td rowspan=2>gh</td>

</tr>

<tr><td colspan=2>ik</td>

</tr>

</table>

The number of rows in each column and the number of columns in each row are:

A(2, 2, 3) and (2, 3, 2)

B(2, 2, 3) and (2, 2, 3)

C(2, 3, 2) and (2, 3, 2)

D(2, 3, 2) and (2, 2, 3)

Answer: C

27. Which of the following is an advantage of putting presentation information in a separate


CSS file rather than in HTML itself?

AThe content becomes easy to manage


BBecomes easy to make site for different devices like mobile by making separate CSS files

CCSS Files are generally cached and therefore decrease server load and network traffic.

DAll of the above

Answer: D

28. In a web server, ten WebPages are stored with the URLs of the form
[Link] where, var is a different number from 1 to 10 for each
Webpage. Suppose, the client stores the Webpage with var = 1 (say W1) in local machine,
edits and then tests. Rest of the WebPages remains on the web server. W1 contains several
relative URLs of the form “[Link]” referring to the other WebPages. Which one of the
following statements needs to be added in W1, so that all the relative URLs in W1 refer to the
appropriate WebPages on the web server?

A<[Link]: “[Link] href: “...[Link]”>

B <base href: “[Link]

C<[Link]: “[Link]

D<base href: “[Link] range: “...[Link]”>

Answer: B

29. Given below are several usages of the anchor tag in HTML.

<A HREF = "[Link] Me</A>

<A HREF = "/BASIC/[Link]">Test Me</A>

<A HREF = "[Link]">Test Me</A>

<A HREF = "[Link]#test">Test Me</A>

Which of the above are valid?

AI and II only

BI and III only


CI, II and III only

DI, II, III and IV

Answer: D

30. A HTML form is to be designed to enable purchase of office stationery. Required items are
to be selected (checked). Credit card details are to be entered and then the submit button is
to be pressed. Which one of the following options would be appropriate for sending the data
to the server. Assume that security is handled in a way that is transparent to the form design.

AOnly GET

B Only POST

CEither of GET or POST

DNeither GET nor POST

Answer: B

31. In XML, DOCTYPE declaration specifies to include a reference to __________ file.

A Document type Definition

BDocument type declaration

CDocument transfer definition

DDocument type language

Answer: A

Common questions

Powered by AI

Separating presentation information into a CSS file provides several advantages including easier management of content, the ability to quickly adapt the site for different devices like mobile by creating separate CSS files, and reduced server load and network traffic due to CSS files being cached. These benefits collectively enhance the performance and adaptability of a webpage .

HTML5 improves the semantic structure of web documents by introducing new elements and attributes such as <header>, <footer>, <section>, and <nav>. These elements provide clearer semantic layout and eliminate the need for ambiguous containers, thus enhancing accessibility and SEO .

The drag-and-drop feature of HTML5 enhances user interaction by allowing elements to be moved within the web page environment, providing a more intuitive and engaging user experience. This feature is beneficial in applications requiring visual arrangement of components, such as organizing tasks or uploading files .

In XML, the DOCTYPE declaration is used to include a reference to a Document Type Definition (DTD) file, which identifies the structure and legal elements and attributes. In HTML, DOCTYPE is also crucial for defining document type but primarily ensures browsers render the page using the standards mode rather than quirks mode. The DOCTYPE in XML serves a more formal verification role .

The canvas element introduced in HTML5 has significantly impacted web design by providing a two-dimensional drawing surface that can be programmed with JavaScript. This enhancement allows developers to create complex graphics, dynamic visual effects, and interactive content without reliance on external plugins, facilitating a richer user experience .

The 'z-index' CSS property helps in controlling the stack order of overlapping elements. This is crucial for aesthetic and functional design where certain components must visually prioritize above others, such as dropdown menus or popup windows .

The <nav> tag in HTML5 is significant as it represents a section of the document intended specifically for navigation. This clarity in structure aids in both SEO and accessibility, making it easier for assistive technologies to interpret the document's purpose and structure .

HTML5 facilitates multimedia content integration by introducing <audio> and <video> elements, allowing developers to embed media directly into web pages without reliance on external plugins like Flash, which were necessary in previous HTML versions. This integration supports a range of codecs and formats, promoting widespread accessibility and functionality .

HTML5's backward compatibility significantly impacts web development positively by ensuring new features build on existing ones, allowing developers to provide fallback content for older browsers while gradually introducing modern features. This aids in a smoother transition and wider accessibility across user bases with varying browser capabilities .

The 'placeholder' attribute in HTML5 provides users with a hint of what can be entered in an <input> or <textarea> field. It acts as a guide to inform users about the kind of data expected, improving usability by reducing input errors .

You might also like