Logo/

HTML Core Concepts

Log in

Made with ScholarlyMake flashcards like these from your own notes

HTML Core Concepts

Questions and answers

240 cards
  1. Question:What is the primary role of HTML in modern web pages?

    Answer:Indicates elements to include and their order

  2. Question:How does CSS complement HTML in web development?

    Answer:Styles and formats HTML elements

  3. Question:What is the purpose of JavaScript in webpages?

    Answer:Manipulates elements programmatically and responds to user actions

  4. Question:What is a markup language?

    Answer:Language with parts rendered and parts instructing interpretation

  5. Question:What does 'rendering' mean in the context of HTML?

    Answer:Transforming HTML text into visual representation

  6. Question:How are HTML elements typically demarcated?

    Answer:Using opening and closing tags like ...

  7. Question:What is the purpose of the tag in HTML?

    Answer:Delimits paragraphs

  8. Question:How can elements be nested in HTML?

    Answer:One element inside another, like text

  9. Question:What are attributes in HTML elements?

    Answer:Qualifiers providing additional information, like style='color:red'

  10. Question:What is the latest version of HTML mentioned?

    Answer:HTML 5

  11. Question:What is a document type declaration in HTML?

    Answer:Starts document, like <!DOCTYPE html>

  12. Question:What is the role of the element?

    Answer:Contains metadata like

  13. Question:What is the purpose of the element?

    Answer:Contains visible content

  14. Question:How are comments added in HTML?

    Answer:Using <!-- comment -->

  15. Question:What does the lang attribute in do?

    Answer:Specifies language for accessibility and search engines

  16. Question:Why does HTML largely ignore carriage returns?

    Answer:To focus on structural markup over formatting

  17. Question:How is a line break inserted in HTML?

    Answer:Using tag

  18. Question:What happens to leading and trailing spaces in HTML?

    Answer:Typically ignored

  19. Question:How are multiple spaces preserved in HTML?

    Answer:Using non-breaking space &nbsp;

  20. Question:What is a thematic break line in HTML?

    Answer:tag for horizontal rule

  21. Question:How are comments structured in HTML?

    Answer:<!-- comment text --> ignoring line breaks inside

  22. Question:Why is the ampersand (&) special in HTML?

    Answer:Used to mark up special characters

  23. Question:What is the HTML code for ampersand?

    Answer:&amp;

  24. Question:What is a non-breaking space in HTML?

    Answer:&nbsp; prevents line breaks

  25. Question:HTML code for less than sign?

    Answer:&lt;

  26. Question:HTML code for greater than sign?

    Answer:&gt;

  27. Question:HTML code for quotation mark?

    Answer:&quot;

  28. Question:HTML code for apostrophe?

    Answer:&apos;

  29. Question:What is the structure of a hyperlink in HTML?

    Answer:text

  30. Question:What can the visible text in a hyperlink contain?

    Answer:HTML elements like images or formatted text

  31. Question:What does a relative href like 'Pages/file.pdf' mean?

    Answer:Path relative to current directory

  32. Question:What is the element used for?

    Answer:Groups navigation hyperlinks

  33. Question:What are the basic building blocks of HTML?

    Answer:Elements or tags

  34. Question:How is text formatting generally done in HTML?

    Answer:Using CSS or inline style attributes

  35. Question:What is the purpose of the element?

    Answer:Contact information for document author

  36. Question:What does the element do?

    Answer:Bold text

  37. Question:Purpose of element?

    Answer:Quoted section from another source

  38. Question:What is used for?

    Answer:Title of a work

  39. Question:element purpose?

    Answer:Piece of computer code

  40. Question:What indicates deleted text in HTML?

    Answer:element

  41. Question:element usage?

    Answer:Defining instance of a term

  42. Question:Purpose of element?

    Answer:Emphasized text, often italicized

  43. Question:What is for?

    Answer:Footer for document or section

  44. Question:Hierarchy of heading elements?

    Answer:to for levels

  45. Question:element role?

    Answer:Header for document or section

  46. Question:What does element indicate?

    Answer:Text in alternate voice or mood

  47. Question:element purpose?

    Answer:Indicates added text

  48. Question:for what?

    Answer:Keyboard input

  49. Question:Purpose of element?

    Answer:Highlighted text

  50. Question:element characteristics?

    Answer:Preformatted text preserving spaces and breaks

  51. Question:for short quotations?

    Answer:Yes, adds quotes automatically

  52. Question:element meaning?

    Answer:No longer accurate text

  53. Question:purpose?

    Answer:Sample program output

  54. Question:for smaller text?

    Answer:Yes, like fine print

  55. Question:element role?

    Answer:Important text, often bold

  56. Question:for subscript?

    Answer:Yes, like H2O

  57. Question:usage?

    Answer:Heading for element

  58. Question:for superscript?

    Answer:Yes, like x²

  59. Question:element purpose?

    Answer:Date or time

  60. Question:for underlined text?

    Answer:Stylistically different text

  61. Question:element?

    Answer:Variable in math or code

  62. Question:purpose?

    Answer:Possible line-break opportunity

  63. Question:Which HTML elements are deprecated in HTML5?

    Answer:, , , ,

  64. Question:Purpose of element?

    Answer:Abbreviation with title attribute

  65. Question:element role?

    Answer:Links content to machine-readable value

  66. Question:What is for?

    Answer:Self-contained article

  67. Question:element usage?

    Answer:Content aside from main page

  68. Question:purpose?

    Answer:User-toggleable additional details

  69. Question:role?

    Answer:Generic section container

  70. Question:element?

    Answer:Main content of document

  71. Question:default spacing?

    Answer:Space above and below

  72. Question:for what?

    Answer:Thematic grouping in document

  73. Question:purpose?

    Answer:Inline generic container

  74. Question:What causes inconsistencies in browser rendering?

    Answer:Evolving standards and device variations

  75. Question:What is browser detection?

    Answer:Identifying browser type/version for compatibility

  76. Question:Why is feature detection preferred over browser detection?

    Answer:Focuses on capabilities, not browser identity

  77. Question:How do and support multiple formats?

    Answer:Multiple elements, browser picks supported

  78. Question:What is the CSS @media rule for?

    Answer:Apply styles based on device characteristics

  79. Question:How is feature detection done in JavaScript?

    Answer:Check for objects, properties, or try creation

  80. Question:What is the primary role of CSS in web pages?

    Answer:Styles HTML elements

  81. Question:Ways to include CSS in HTML?

    Answer:Inline, in-file , external

  82. Question:How can JavaScript alter CSS?

    Answer:Modify style attributes on the fly

  83. Question:CSS precedence hierarchy?

    Answer:JS > inline > in-file > external, later overrides earlier

  84. Question:Where should elements go in HTML5?

    Answer:Anywhere, but traditionally in

  85. Question:What is a CSS rule-set?

    Answer:Selector { declarations }

  86. Question:What is a CSS declaration?

    Answer:property: value;

  87. Question:Example of element selector?

    Answer:h3 {color: blue;}

  88. Question:What is inline CSS?

    Answer:style='property: value;' in element

  89. Question:How are CSS comments written?

    Answer:/* comment */ multi-line

  90. Question:Latest CSS version?

    Answer:CSS3

  91. Question:What is a class selector in CSS?

    Answer:.className { styles }

  92. Question:How to select specific type and class?

    Answer:h3.center { styles }

  93. Question:ID selector in CSS?

    Answer:#idName { styles }

  94. Question:Grouping selectors?

    Answer:h1, h2, h3 { styles }

  95. Question:Rule for no space between value and unit in CSS?

    Answer:margin-left:20px not 20 px

  96. Question:CSS specificity order?

    Answer:IDs > classes > elements, !important highest

  97. Question:How to set page background?

    Answer:body {background-color: lightblue;}

  98. Question:What are shorthand CSS properties?

    Answer:Set multiple granular properties at once

  99. Question:What is @keyframes in CSS?

    Answer:For animations without JavaScript

  100. Question:@media rule purpose?

    Answer:Device-specific styles

  101. Question:CSS pseudo-properties like content?

    Answer:Add material before/after elements

  102. Question:Link states in CSS?

    Answer::link, :visited, :hover, :active

  103. Question:Zebra-striped tables with CSS?

    Answer:tr:nth-child(even) {background-color: #f2f2f2;}

  104. Question:Responsive table with scroll?

    Answer:...

  105. Question:Ways to add JavaScript to webpage?

    Answer:Event attributes, elements, external src

  106. Question:What does document.write do?

    Answer:Adds text to document

  107. Question:Example of altering element with JS?

    Answer:document.getElementById('id').innerHTML = 'text'

  108. Question:Single-line JS comment?

    Answer:// text

  109. Question:Multi-line JS comment?

    Answer:/* text */

  110. Question:How to declare a variable in JS?

    Answer:var x;

  111. Question:Primitive variable types in JS?

    Answer:String, Number, Date, Boolean

  112. Question:What is an array in JS?

    Answer:Indexed collection, zero-based

  113. Question:Undefined variable value?

    Answer:When not assigned

  114. Question:Does redeclaring var keep value?

    Answer:Yes, retains previous

  115. Question:JS variable naming rules?

    Answer:Letters, digits, _, $, start with letter/$/_ , case-sensitive, no reserved words

  116. Question:Variable scope in JS?

    Answer:Local inside functions, global outside

  117. Question:How to create string variable?

    Answer:var x = 'text';

  118. Question:String indexing in JS?

    Answer:Zero-based, x[0] first char

  119. Question:Regular expression format?

    Answer:/pattern/modifiers

  120. Question:JS number types?

    Answer:Single type, with/without decimal or exponent

  121. Question:How to create date object?

    Answer:new Date() or with params

  122. Question:Boolean values?

    Answer:true or false

  123. Question:Array instantiation?

    Answer:var a = ['item1', 'item2'];

  124. Question:JS object creation?

    Answer:var obj = {prop:'value'};

  125. Question:Access object property?

    Answer:obj.prop or obj['prop']

  126. Question:What are object methods?

    Answer:Functions as properties

  127. Question:JS statements purpose?

    Answer:Instructions executed by browser

  128. Question:How are JS statements separated?

    Answer:Semicolons

  129. Question:Code blocks in JS?

    Answer:{ statements }

  130. Question:Function example in JS?

    Answer:function name() { code }

  131. Question:What are statement identifiers in JavaScript?

    Answer:Reserved words that start statements and cannot be used as variable names

  132. Question:List some JavaScript statement reserved words

    Answer:break, continue, do, for, if, return, switch, throw, try, catch, var, while

  133. Question:How are JavaScript statements executed?

    Answer:One by one in the order written, unless flow control like for, if, or while adjusts it

  134. Question:What is a JavaScript function?

    Answer:A block of code executed as a discrete unit

  135. Question:How is a basic function defined in JavaScript?

    Answer:Using function keyword followed by name and curly braces with code inside

  136. Question:What does the example function do?

    Answer:Sets innerHTML of element with id 'element' to 'Hello'

  137. Question:What are function parameters in JavaScript?

    Answer:Names listed in the function definition that receive values

  138. Question:How are multiple parameters separated in a function?

    Answer:By commas

  139. Question:How do you invoke a function with a parameter?

    Answer:By calling the function name with argument in parentheses, e.g., func2('Hello World')

  140. Question:What are function arguments?

    Answer:Values passed to the function that are assigned to parameters

  141. Question:What naming rules apply to function names?

    Answer:Letters, digits, underscores, dollar signs; same as variables

  142. Question:What does the return statement do in a function?

    Answer:Stops execution and returns the specified value

  143. Question:How do you distinguish a function object from invoking it?

    Answer:Function name refers to object; name() invokes it

  144. Question:What is event handling in JavaScript?

    Answer:Assigning functions to specific events to respond to user actions

  145. Question:What are examples of events in JavaScript?

    Answer:Loading a page, clicking a button, moving a mouse

  146. Question:How is event handling linked to HTML elements?

    Answer:By assigning functions to event attributes of elements

  147. Question:What method handles global events like page load?

    Answer:document.addEventListener('load', function())

  148. Question:What is the Document Object Model (DOM)?

    Answer:Interface for JavaScript to access and manipulate HTML elements

  149. Question:What is the root node of the DOM tree?

    Answer:element

  150. Question:What are the two sub-elements of the root in DOM?

    Answer:and

  151. Question:What can JavaScript do with DOM elements?

    Answer:Change attributes, add/remove elements, react to events

  152. Question:What is the aim of the W3C DOM standard?

    Answer:Platform and language-neutral interface to access and update document content, structure, style

  153. Question:What are the three parts of the DOM?

    Answer:Core DOM, XML DOM, HTML DOM

  154. Question:What programming approach does DOM use?

    Answer:Object-oriented, with elements as objects having properties and methods

  155. Question:How do you access an element by ID in DOM?

    Answer:document.getElementById('id')

  156. Question:What does innerHTML property do?

    Answer:Sets or gets the HTML content inside an element

  157. Question:Provide an example of using getElementById and innerHTML

    Answer:document.getElementById('example').innerHTML = 'hello'

  158. Question:What method returns elements by tag name?

    Answer:document.getElementsByTagName('name')

  159. Question:What method returns elements by class name?

    Answer:document.getElementsByClassName('name')

  160. Question:What method uses CSS selectors for elements?

    Answer:document.querySelectorAll('CSSSelector')

  161. Question:How do you change an element's inner HTML?

    Answer:element.innerHTML = 'HTMLcontent'

  162. Question:How do you change an element's attribute?

    Answer:element.attribute = value or element.setAttribute('attribute', value)

  163. Question:What method creates a new HTML element?

    Answer:document.createElement('element')

  164. Question:What method adds a child element?

    Answer:document.appendChild('element')

  165. Question:What method removes a child element?

    Answer:document.removeChild('element')

  166. Question:What is a node in the DOM?

    Answer:Branching point in the tree structure

  167. Question:What types of nodes exist in DOM?

    Answer:Element nodes, attribute nodes, text nodes, comment nodes

  168. Question:What is a NodeList?

    Answer:Collection of nodes, like child nodes of an element

  169. Question:How is the HTML document accessed via Window?

    Answer:window.document

  170. Question:What are Attr objects in DOM?

    Answer:Representations of HTML element attributes

  171. Question:What is a NamedNodeMap?

    Answer:Unordered collection of nodes, like attributes of an element

  172. Question:What can XMLHTTPRequest do?

    Answer:Send, request, and receive data from server after page load

  173. Question:How are JavaScript statements separated?

    Answer:By semicolons

  174. Question:What composes JavaScript language elements?

    Answer:Values, operators, expressions, keywords, comments

  175. Question:What are number literals in JavaScript?

    Answer:Fixed numbers with or without decimals, e.g., 100 or 10.1

  176. Question:How are string literals written?

    Answer:Within double or single quotes, e.g., 'a' or "35"

  177. Question:How are variables declared?

    Answer:Using var keyword, e.g., var x;

  178. Question:What is the assignment operator?

    Answer:Equal sign (=)

  179. Question:What is an expression in JavaScript?

    Answer:Combination of values, variables, and operators

  180. Question:How is string concatenation done?

    Answer:Using + operator, e.g., 'a' + ' b'

  181. Question:How are comments denoted in JavaScript?

    Answer:// for single line, /* */ for multi-line

  182. Question:What rules apply to identifiers?

    Answer:First character: letter, _, or $; then letters, digits, _, $

  183. Question:Is JavaScript case sensitive?

    Answer:Yes, e.g., firstName ≠ FirstName

  184. Question:What is lower camel case in JavaScript?

    Answer:First word lowercase, subsequent words capitalized, e.g., firstName

  185. Question:What character set does JavaScript use?

    Answer:Unicode

  186. Question:How can you insert text into HTML using JavaScript?

    Answer:element.innerHTML = text

  187. Question:What method writes to browser output?

    Answer:document.write()

  188. Question:How do you show an alert?

    Answer:window.alert()

  189. Question:How do you log to console?

    Answer:console.log()

  190. Question:Where can script elements be placed in HTML?

    Answer:or

  191. Question:What is the Infinity property?

    Answer:Positive infinity number (-Infinity for negative)

  192. Question:What does NaN represent?

    Answer:Not-a-Number from invalid numeric operations

  193. Question:What does undefined indicate?

    Answer:Variable not assigned a value

  194. Question:What does Boolean() convert to?

    Answer:true or false

  195. Question:What does decodeURI() do?

    Answer:Decodes a URI

  196. Question:What is the purpose of encodeURI()?

    Answer:Encodes a URI

  197. Question:What does eval() execute?

    Answer:String as script code

  198. Question:What does isFinite() check?

    Answer:True if argument is finite number

  199. Question:What does isNaN() return?

    Answer:True if argument is NaN

  200. Question:What does Number() convert to?

    Answer:A number

Showing the first 200 of 240 cards. Open All cards to see the rest.