0% found this document useful (0 votes)
23 views3 pages

HTML Css Js Interview Qa Tcs Ninja

The document contains a comprehensive set of interview questions and answers related to HTML, CSS, and JavaScript, focusing on fundamental concepts and differences between elements and properties. It covers topics such as the purpose of HTML, CSS styling methods, JavaScript data types, and the distinctions between various programming constructs. This resource is particularly useful for preparing for technical interviews in web development.

Uploaded by

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

HTML Css Js Interview Qa Tcs Ninja

The document contains a comprehensive set of interview questions and answers related to HTML, CSS, and JavaScript, focusing on fundamental concepts and differences between elements and properties. It covers topics such as the purpose of HTML, CSS styling methods, JavaScript data types, and the distinctions between various programming constructs. This resource is particularly useful for preparing for technical interviews in web development.

Uploaded by

rasalsharvari5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

HTML, CSS, and JavaScript Interview

Q&A - TCS Ninja


HTML Interview Q&A
1. What is HTML?
HTML (HyperText Markup Language) is the standard language used to create web pages.

2. Difference between HTML and HTML5?


HTML5 includes new semantic elements, multimedia support, and APIs. It's more powerful
than previous HTML versions.

3. What are semantic tags in HTML5?


Semantic tags like <article>, <section>, <nav>, and <footer> clearly define the content's role.

4. Difference between <div> and <span>?


<div> is a block-level element, while <span> is inline.

5. How do you create a hyperlink in HTML?


Using <a href='url'>text</a>.

6. Purpose of alt attribute in images?


Provides alternative text for images if they can't be displayed.

7. Types of lists in HTML?


Ordered (<ol>), Unordered (<ul>), and Definition (<dl>).

8. Use of the <meta> tag?


Provides metadata like character set, author, description, and viewport settings.

9. How do forms work in HTML?


They collect user input using elements like <input>, <textarea>, <button>, and send it to the
server.
10. Difference between id and class attributes?
id is unique; class can be shared across elements.

CSS Interview Q&A


1. What is CSS and why is it used?
CSS (Cascading Style Sheets) is used to style HTML elements (color, layout, font, etc.).

2. Types of CSS?
Inline, Internal, and External.

3. Difference between id and class in CSS selectors?


id uses # (unique); class uses . (can be reused).

4. Inline vs Internal vs External CSS?


Inline: inside element; Internal: in <style>; External: linked .css file.

5. How does the box model work?


Content → Padding → Border → Margin.

6. What is specificity in CSS?


Rules for which style is applied based on selector types.

7. CSS positioning types?


Static, Relative, Absolute, Fixed, Sticky.

8. Pseudo-classes and pseudo-elements?


:hover (pseudo-class), ::before (pseudo-element).

9. How to make a website responsive?


Use media queries, flexible layouts, and relative units.

10. em vs rem vs % vs px?


em: relative to parent; rem: root; %: relative to container; px: fixed size.
JavaScript Interview Q&A
1. What is JavaScript?
JavaScript is a scripting language for creating dynamic web content.

2. Difference between var, let, and const?


var: function-scoped; let/const: block-scoped; const: can't be reassigned.

3. JavaScript data types?


String, Number, Boolean, Null, Undefined, Object, Symbol (ES6).

4. What is hoisting?
JavaScript moves declarations to the top before code execution.

5. == vs ===?
== compares values; === compares values and types.

6. What is a callback function?


A function passed as an argument to another function.

7. What is an event?
An action like click, hover, or keypress that JavaScript can handle.

8. What is the DOM?


Document Object Model – represents the page structure in a tree format.

9. Synchronous vs Asynchronous JS?


Synchronous: one task at a time; Asynchronous: allows non-blocking tasks.

10. Arrow functions vs regular functions?


Arrow functions are shorter and don't bind their own 'this'.

You might also like