Developer Q&A Portfolio
Demonstrating fundamental concepts through code and clear explanations.
View My AnswersDemonstrating fundamental concepts through code and clear explanations.
View My Answers
<!DOCTYPE html>
This is the document type declaration. It's the very first thing in an HTML document and tells the browser which version of HTML to expect (in this case, HTML5). It is not an HTML tag, but an instruction.
<html>
This is the root element of the page. All other elements must be descendants of this tag. It typically includes the lang attribute to declare the language of the page content (e.g., <html lang="en">).
<head>
The header section contains meta-information about the HTML document that is not displayed directly on the page. Essential elements within <head> include:
<meta charset="UTF-8">
Specifies the character encoding, typically UTF-8, to handle most characters correctly.
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Important for responsiveness on different devices.
<title>
Sets the title that appears in the browser tab or window title bar.
<link>
Used to link external resources, most commonly CSS stylesheets.
<script>
Can be used to include JavaScript (often placed near the closing </body> as well for performance).
<body>
The body section contains the visible page content. This includes all the text, images, links, tables, and other elements that a user sees and interacts with. This is where you put your main content elements like...
To highlight my name as a heading, I would use one of the heading tags, typically <h1> for the main heading.
I'm Ali Hossin Pik, a dedicated learner based in Dakshin Barasat, West Bengal. Having completed my H.S. in 2019, I’m currently focused on mastering the Full Stack Development (FSD) course at PW Skills. My core drive is to continually explore new technologies and skills. While I enjoy diving deep into new things, my true passion and current sole hobby is coding — reflecting my commitment to building a strong technical foundation.
<!-- This is an HTML comment--
<h1>Welcome to my website</h1>
The mistake in the code is in the HTML comment syntax. The correct syntax for an HTML comment is <!-- comment text -->. The closing part of the comment is missing the exclamation mark. Here is the corrected code:
<!-- This is an HTML comment -->
<form action="/submit" method="post">
<label for="name">Name:</label>
<input type="text" id="name" name="name" placeholder="type your full name" required><br><br>
<label for="country">Country:</label>
<select id="country" name="country" placeholder="select" required>
<option value="" disabled selected>Select your country</option>
<option value="usa">United States</option>
<option value="uk">United Kingdom</option>
<option value="canada">Canada</option>
<option value="australia">Australia</option>
<option value="india">India</option>
</select><br><br>
<button type="submit">Submit</button>
</form>
<h2>My Favorite Fruits</h2>
<ul>
<li>Mango</li>
<li>Banana</li>
<li>Apple</li>
<li>Orange</li>
<li>Grapes</li>
</ul>
<h2>Top 3 Programming Languages</h2>
<ol>
<li>JavaScript</li>
<li>Python</li>
<li>Java</li>
</ol>
Ravi can leave a note in his HTML file by using HTML comments. HTML comments are not displayed in the browser when the page is rendered, making them ideal for leaving notes for other developers. The syntax for an HTML comment is as follows:
<!-- This is a comment -->
Such notes are useful for several reasons:
<form>
<input name="email">
<select>
<option>India</option>
</select>
<button>Send</buton>
</form>
The errors in the provided form snippet are fixed follows:
Here is the corrected version of the form snippet with the necessary fixes applied:
<form>
<label for="email">Email:</label> <!-- Added label for better accessibility -->
<input type="email" id="email" name="email" placeholder="your email addres" required> <br> <!-- Added type attribute and required attribute -->
<label for ="country">country:</label> <!-- Added label for better accessibility -->
<select name="country" required> <!-- Added name attribute and required attribute --> <br>
<option value="india">India</option><!-- Added value attribute and it's better to add multiple country-->
<option value="usa">usa<option>
<option value="chaina">chaina<option>
</select> <br>
<button type="submit">Send</button> <!-- Corrected closing tag -->
</form>