Interview FrontEnd
Interview FrontEnd
Summary with Key Points: • Provide Metadata: Meta tags offer information about the
web page, such as author, character set, description, and viewport settings.
• Placed in <head>: Meta tags reside in the <head> section and are crucial for SEO,
mobile responsiveness, and search engine crawling.
• Not Visible to Users: Although not directly seen by users, meta tags influence
browser behavior, SEO, and social sharing.
Meta tags play a vital role in controlling how web pages interact with search engines,
mobile devices, and social media platforms. Although some tags like keywords have
lost importance, others, such as viewport and charset, remain essential for modern
web development.
1. Basic Structure
plaintext
Copy code
<table>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
</table>
2. Adding a Caption
plaintext
Copy code
<table>
</table>
plaintext
Copy code
<table>
</table>
plaintext
Copy code
<table>
</table>
plaintext
Copy code
<style>
</style>
<table>
</table>
plaintext
Copy code
<style>
</style>
plaintext
Copy code
<table>
</table>
plaintext
Copy code
<style>
</style>
<div class="table-responsive">
<table>
</table>
</div>
Quick Recap:
HTML tables are powerful tools for displaying structured data in a tabular format.
Adding CSS enhances presentation with borders, alignment, and padding. Responsive
design ensures usability across different screen sizes. Attributes like colspan, rowspan,
and scope improve accessibility and layout flexibility.
1. Block-Level Elements
• Characteristics:
plaintext
Copy code
<div style="border: 1px solid black;">This is a block-level element.</div>
2. Inline Elements
• Characteristics:
plaintext
Copy code
4. Inline-Block Elements
• Behavior: Remain inline but allow width and height adjustments like block elements.
plaintext
Copy code
<span style="display: inline-block; width: 100px; height: 50px; background-color:
lightgrey;">Inline Block</span>
plaintext
Copy code
Quick Recap:
1. Responsive Design
• How It Works: Adjusts content seamlessly based on screen size and orientation.
• Primary Technique: Uses relative units (%, em, rem) and CSS media queries.
plaintext
Copy code
<style>
.container {
</style>
2. Adaptive Design
• How It Works: Loads a fixed layout based on specific device types or breakpoints.
• Primary Technique: Uses CSS breakpoints for switching between layouts.
plaintext
Copy code
<style>
.container {
</style>
<div class="container">Adaptive Container</div>
Explanation: This container switches between 100%, 80%, and 60% widths based on
the screen size.
Technology CSS media queries, flexible grids Predefined layouts with detection
Responsive Design
• Example: News websites and blogs with content that flows across various screen
sizes.
Adaptive Design
• Example: E-commerce platforms or dashboards optimized for tablets and phones.
Quick Recap
• Definition: In quirks mode, browsers render the page similar to how older
browsers (like Internet Explorer 5) would, to maintain compatibility with legacy
websites.
• Rendering: The browser relaxes certain CSS rules, such as margin collapsing
and box model behavior (e.g., width includes padding and borders).
Example:
html
Copy code
<html>
<head>
</head>
<body>
</div>
</body>
</html>
• In quirks mode, the width of the <div> will include padding and borders,
resulting in less available space for content inside the box.
o Total width: 100px (width) + 10px (padding on both sides) + 2px (border on
both sides) = 124px
• Rendering: CSS rules, such as the box model, are applied correctly (i.e., the
width only applies to the content, and padding/borders are added outside).
Example:
html
Copy code
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</div>
</body>
</html>
o Total width: 100px (content width) + 10px (padding on both sides) + 2px
(border on both sides) = 124px total, but the content area is still 100px.
• When Used: Some DOCTYPEs (such as XHTML 1.0 Transitional) trigger almost
standards mode.
Example:
html
Copy code
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
</head>
<body>
<table>
<tr>
</td>
</tr>
</table>
</body>
</html>