ad

Tuesday, February 4, 2025

Top 15 HTML MCQ With Answers part(8)

 Top 15 HTML  MCQ With Answers 

Top 10 HTML  MCQ With Answers part(8)


1] heading tag should contain most important keywords for seo use?

    a) <h1>  b) <h7>   c) <h5>  d) <h6>

Answer a) <h1>


2] how does google treat <h1> tags?

  a] primary heading for seo
  b] paragraph
  c] link
  d] goole ignores <h1> tag

Answer a) primary heading for seo

 
3] can <h1> styled using css?

  a)  yes
  b) no

 Answer a) yes


4] what is the purpose of the <q> tag in html language?

  
  a) To display quoted text 
  b) large text
  c) create a blockquote
  d) insert images

Answer a) to display quoted text

5] which attribute is commonly use <q>  tag?

  a) cite
  b) src
  c) alt
  d) href

Answer a) cite

6] which tag is use for long quotations in html language?

  a) <blockquote>
  b) <q>
  c) <em>
  d) <quote>

Answer a) <blockquote>


7) <q> tag is a example?

  a) Block-level element
  d) Semantic element
  c) Inline element
  d) Both d) & C

  Answer d) Both d) & C


8] How can style the <q> tag using css?


  a) q{font-style:italic;}
  b) q:before {content: "[";} q:after { content: "] ";}
  c) All above
  d) q {font-weight:bold;}

Answer c) All above


9] HTML tag is use to define a paregraph?

  a) <p>   b) <para>    c) <text>   d) <paragraph>

Answer a) <p>

 10] <p> tag a block-level or inline element?

     a)Block-level    b) lnline    c) Both    d) none

Answer a) Block-level

11] property controls the space between lines inside a paragraph?

  a) text-spacing   b) word-spacing
  c) text-spacing     d) letter-spacing

Answer d) word-spacing

12] What values can the align attribute of <p> tag?

   
   a) left,right,center,justify    b) start,end
   c) inline, block             d) top, middle, center,justify

Answer a) left,right,center,justify


13] what is the correct center a paragraph using css?

     a) <p align="center">    b) <p align-middle="true">
   c) <p position="middle">      d) <p style="text-align:center;">

Answer d) <p style="text-align:center;">


14] paragraph using css html language?
     

    a) margin      b) gap     c) padding     d) spacing

Answer a) margin


15] CSS property controls the space inside a paragraph?

 
    a) width   b) padding  c) margin    d) line-height

Answer b)padding


Sunday, February 2, 2025

Top 10 HTML MCQ With Answers part(7)

 Top 10 HTML  MCQ With Answers 

Top 10 HTML  MCQ With Answers part(7)




1] What is the largest heading tag in HTML language

a) <h6>
b) <h4>
c) <h3>
d) <h1>

Answer:  d) <h1>

2] How many heading tags  in HTML language?

a) 4
b) 11
c) 6
d) 7

Answer:  c) 6

3] Which of the following is  smallest heading tag in html language?

a) <h1>
b) <h3>
c) <h6>
d) <h2>

Answer:  c) <h6>


4] Which HTML tag is used to define a main heading in html language?

a) <head>
b) <h1>
c) <title>
d) <p>

Answer: b) <h1>


5]correct sequence of heading tag from largest to smallest in html language  ?

a) <h1><h2><h3><h4><h5><h6>
b) <h6><h5><h4><h6><h2><h1>
c) <h3><h4><h1><h2><h5><h6>
d) <h1><h3><h2><h5><h4><h6>

Answer: a) <h1><h2><h3><h4><h5><h6>


6]  tag is most suitable for the main title of a webpage html ?

a) <h6>
b) <h3>
c) <h1>
d) <title>

Answer: c) <h1>

7]  tag is most suitable for the main title of a webpage html ?

a) <h6>
b) <h3>
c) <h1>
d) <title>

Answer: c) <h1>

8]  Which heading tag should be use for subheadings under html <h1> tag?

 a) <h2>
 b) <h3>
 c) <h4>
 d) <h7>

Answer: a) <h2>

9]  Which attribute is used to align a paragtaph in HTML language?

 a) align
 b) text-align
 c) position
 d) location

 Answer: a) align

10] which heading tags should be use for smallest subheading?

  a) <h1>
  b) <h3>
  c) <h6>
  d) <h5>

Answer c) <h6>


Saturday, February 1, 2025

Top 15 HTML MCQ With Answers part(6)


Top 15 HTML  MCQ With Answers

Top 25 HTML  MCQ With Answers part(6)


 1] What is the correct file extension for a HTML files?

a) .htm
b) .html
c) .css
d) .web

Answer: a


2] What is the purpose of the <br>?

a) To break text into two columns
b) To insert a line break
c) To add a border
d) To insert a blank line

Answer: b


3] How can you create a numbered list in HTML language?

a) <ul>
b) <ol>
c) <li>
d) <nl>

Answer: b


4] Which attribute is use to specify a unique identifier for an HTML tag?

a) class
b) name
c) style
d) id

Answer: d] id


5] Which tag is used to link an external CSS file in the <head> section in html tag?

A) <css>
B) <link>
C) <style>
D) <script>

Answer: B) <link>


6] What is the purpose of the used to <meta charset="UTF-8"> tag?

A) Defines the page language
B) Specifies the character encoding
C) Links JavaScript files
D)  Loads external stylesheets 

Answer: B) Specifies the character encoding


7]  Which <meta> tag is use for search engine optimization (SEO)?

A) <meta viewport>
B) <meta name="description">
C) <meta http-equiv="refresh">
D) <meta charset>  

Answer: B) <meta name="description">


8] Which <meta> tag is use to refresh a page automatically?

A)  <meta auto-update>
B) <meta http-equiv="refresh" content="5">
C) <meta refresh>
D) <meta name="refresh"> 

Answer: B) <meta http-equiv="refresh" content="5">


9] What does <meta name="keywords"> tag?

A) Defines the page title
B) Helps search engines index the page
C) Specifies the page’s author
D) Controls viewport scaling

Answer: B) Helps search engines index the page


10] Which <meta> tag is use to define the author of a webpage?

A) <meta name="author">
B) <meta name="creator">
C) <meta name="publisher">
D) <meta author>

Answer: A) <meta name="author">


11] What is the default alignment of text in an HTML tag?

a) Center
b)  Justify 
c) Right
d)  Left

Answer: d] left


12] Where should the <link>  be placed in an HTML document?

A) Inside <body>
B) Inside <head>
C) At the bottom of <body>
D) Before <html>

Answer: B) Inside <head>


13]Which tag is use to define inline CSS in <head> section?

A) <css>
B) <link>
C) <style>
D) <script>

Answer: C) <style>


14] Which attribute in the <link> tag specifies the location of an external file?

A) href
B) src
C) path
D) location

Answer: A) href


15] Which <meta> tag is use to make a webpage responsive?

A) <meta viewport>
B) <meta http-equiv="X-UA-Compatible">
C) <meta name="responsive">
D)  <meta charset="UTF-8">

Answer: A) <meta viewport>



Friday, January 31, 2025

Top 25 HTML MCQ With Answers(part 5)


Top 25 HTML  MCQ With Answers



Top 25 HTML  MCQ With Answers


1] Which of the following is client-side scripting language

a) JavaScript

b)PHP

c) HTML

d) Java

Answer: a) JavaScript


2] Which tag is use to include JavaScript in an HTML file?

a) <java>
b) <javascript>
c) <script>
d) <scripting>

Answer: c) <script>

3] JavaScript is a _______ language.

a) Server-side-language
b) Client-side
c) Compiled
d) Assembly

Answer: b) Client-side

4] What is the correct syntax for external JavaScript file?

a) <script src="script.js">

b) <script href="script.js">

c) <script ref="script.js">

d) <script link="script.js">

Answer: a) <script src="script.js">


5] Which function is used to display an alert box in JavaScript language?

a) alertBox()
b) msgBox()
c) alert()
d) display()

Answer: c) alert()


6] Which keyword is define a JavaScript variable?

a) var

b) let

c) const

d) All of the above

Answer: d) All of the above


7]What will type of ([]) return in JavaScript language?

a) object
b) array
c) list
d) undefined

Answer: a) object


8] What is the correct way to write a comment in JavaScript language ?

a) <!-- This is a comment -->
b) // This is a comment
c) /* This is a comment */
d) Both b and c

Answer: d) Both b and c


9] Which of the following is NOT a JavaScript framework?

a) React
b) Angular
c) Django
d) Vue

Answer: c) Django


10] Which event is triggered when a user clicks an HTML element?

a) onmouseover
b) onclick
c) onload
d) onsubmit

Answer: b) onclick


11] How do you call a function named myFunction in JavaScript language?

a) call myFunction();
b) myFunction();
c) call function myFunction();
d) execute myFunction();

Answer: b) myFunction();


12] Which of the following is use to loop through an array in JavaScript language?

a) for
b) while
c) forEach
d) All of the above

Answer: d) All of the above


13] What is the purpose of the return statement in JavaScript language?

a) Stops function execution
b) Returns a value from a function
c) Both a and b
d) None of the above

Answer: c) Both a and b


14] What will console.log(2 + "2") output?

a) 14
b) "22"
c) 28
d) Error

Answer: b) "22"

15] How do you declare a function in JavaScript language?

a) function myFunction() {}

b) def myFunction() {}

c) function: myFunction() {}

d) func myFunction() {}

Answer: a) function myFunction() {}


16] Which method converts a string to uppercase in JavaScript language?

a) upperCase()
b) toUpperCase()
c) makeUpperCase()
d) convertUpperCase()

Answer: b) toUpperCase()


17] What  output of console.log(typeof null)?

a) null
b) object
c) undefined
d) string

Answer: b) object


18] How do you write an IF statement in JavaScript language?

a) if (x == 5) {}
b) if x == 5 then {}
c) if x = 5 {}
d) if x == 5 {}

Answer: a) if (x == 5) {}


19] What is the output of console.log(3 == "3")?

a) true
b) undefined
c) Error
d) defined

Answer: a) true


20] What does NaN stand for in JavaScript?

a) Not a Name
b) Not a Number
c) Null and None
d) New and Next

Answer: b) Not a Number


21] How do you access an HTML element with the ID demo using JavaScript language?

a) document.getElementById("demo")
b) document.querySelector("#demo")
c) Both a and b
d) None of the above

Answer: c) Both a and b


22] Which function is used to add an event listener in JavaScript language?

a) addEventListener()

b) attachEvent()

c) onEvent()

d) setEventListener()

Answer: a) addEventListener()


23] Which property is used to change the HTML content using JavaScript language?

a) innerHTML

b) textContent

c) Both a and b

d) None of the above

Answer: c) Both a and b


24] How do you remove an HTML element using JavaScript language?

a) removeElement()

b) deleteElement()

c) removeChild()

d) removeNode()

Answer: c) removeChild()


25] Which method stops event propagation?

a) stopPropagation()
b) preventDefault()
c) cancelBubble()
d) stopEvent()

Answer: a) stopPropagation()

Related Post 

html login in form

Wednesday, January 29, 2025

Top 25 HTML MCQ With Answers(part 4)

 

Top 20 HTML  MCQ With Answers

Top 20 HTML  MCQ With Answers (part 4)


1] Which of the following is not a valid HTTP method?

a) GET
b)DELETE
c) FETCH
d)  POST 

Answer: c) FETCH

2] What is the primary purpose of a firewall?

a) To block unauthorized access
b) To increase browsing speed
c) To filter email spam
d) To optimize search results

Answer: a) a) To block unauthorized access

3]  What is "phishing"?

a) A method to steal personal information
b) A tool to browse the web
c) A way to protect sensitive data
d) A program for managing emails

Answer: a) A method to steal personal information

4] Which device connects a local network to the Internet?

a) Router
b) Firewall
c) Modem
d) Switch
  

Answer: a) Router

5] What is the purpose of the <frame> tag in HTML?

a) To create hyperlinks
b) To divide the browser window into multiple sections
c) To add images to a web page
d) To embed videos in a web page 

Answer: b)   To divide the browser window into multiple sections


6]  Which tag is used to define a frameset in HTML?

a) <frameset>
b) <border> 
c) <iframe>
d) <frame>

Answer: a) <frameset>

7] Can the <frame> tag be used in HTML5?

a)  Only with JavaScript
b) No, it is obsolete in HTML5
c) Only in specific browsers
d) Yes, it is fully supported

Answer: b) No, it is obsolete in HTML5


8]What is the correct attribute to specify the URL of a document in a <frame>?

a) src
b) target
c) link
d) 
href 

Answer: a)  src


9] Which element replaces <frame> in HTML5?

a) <section>
b) <div>  
c) <iframe>
d) <main>

Answer: c)  <iframe>


10] What does the <frameset> tag replace in an HTML document?

a) <html>
b) <head>
c) <body>
d) <footer>

Answer: c) <body>

11] How do you define the number of columns in a frameset?

a) Using the cols attribute 
b) Using the rows attribute
c) Using the columns attribute
d) Using the span attribute

Answer: a ) Using the cols attribute 

12] How do you specify the size of frames in a frameset?

a) Using percentages or pixel values in the rows and cols attributes
b) Using CSS only
c) Using the width and height attributes
d) Using the size attribute

Answer: a) Using percentages or pixel values in the rows and cols attributes


13] What is the purpose of the noresize attribute in the <frame> tag?

a) To prevent resizing of the frame by the user
b) To disable the frame
c) To hide the frame
d) To prevent content loading

Answer: a)  To prevent resizing of the frame by the user


14] What attribute is used to specify the spacing between frames in a frameset?

a)  margin
b) framespacing
c)frameborder 
d) border

Answer: b) framespacing


15] Which attribute is used to add a border to a frame?

a) frameborder
b) border
c) style
d) style

Answer: a) frameborder

16] Can <frame> tags be nested inside other <frame> tags?

a) Yes, they can be nested
b) No, nesting is not allowed
c) Only in specific browsers
d) Only with an <iframe> tag

Answer: a) Yes, they can be nested


17] What does the scrolling attribute in a <frame> do?

a) Enables or disables scrollbars in the frame
b) Adds vertical scrollbars only
c) Adds horizontal scrollbars only
d) Locks the frame content

Answer: a) Enables or disables scrollbars in the frame


18] How do you provide alternative content for browsers that do not support frames?

a) Use the <noframes> tag
b) Use the <iframe> tag  
c) Use the <alt> tag
d) Use the <fallback> tag

Answer: a)  Use the <noframes> tag

 19] Which of the following is a valid value for the scrolling attribute in a <frame>?

a) auto, yes, or no
b) on or off
c) enable or disable 
d) true or false

Answer: a)  autoyes, or no

20] Which attribute is used to give a frame a unique identifier?

a) name
b) id
c) title
d) target

Answer: a) name

21] What is the default value of the frameborder attribute?

a) 1
b) 0
c) true
d) auto

Answer: a


22] Which attribute is used to specify the name of a frame?

a) name
b) id
c) title
d) target

Answer: a

 23] What is the purpose of the <noframes> tag?

a) To provide alternative content for non-frame-supporting browsers
b) To create nested frames
c) To hide frames
d) To add scrollbars to frames

Answer: a


24] Which HTML version deprecated the <frame> tag?

a) HTML 4.0
b) HTML 5
c) XHTML 1.0
d) HTML 3.2

Answer: b

25] What does the target="_blank" attribute in a link do?

a) Opens the link in a new tab or window
b) Opens the link in the same frame
c) Redirects the user to a blank page
d) Prevents the link from opening

Answer: a