HTML Attributes and Headings: Episode 3 Tutorial for Beginners (Updated June 2026) (Updated June 2026)
Episode 3 of our HTML series covers two of the most important concepts you'll use in every single web page you ever build: attributes and headings. HTML attributes are the name-value pairs that live inside HTML opening tags and control how elements behave and appear. Without attributes, a link tag has no destination, an image tag has no source, and a form input has no type. Attributes are what make HTML elements actually functional. And headings — h1 through h6 — are the structural hierarchy of your content: the signal that tells both human readers and search engine crawlers what a page is about and how its content is organized. Here's the thing: NASSCOM and Deloitte project that India will need 1.25 million AI and digital tech professionals by 2027. Every single web developer, frontend engineer, and full-stack developer in that cohort works with HTML attributes and headings every day. What most people don't realize is that heading structure is one of the most important on-page SEO signals Google uses — a page with a single, well-chosen h1 and logically nested h2 and h3 headings ranks better than the same content without that structure. I've been teaching HTML at ABC Trainings for years, and the students who understand attributes and headings deeply write better code, build better pages, and get hired faster. Let's get into Episode 3.
- HTML attributes are name-value pairs inside opening tags that control element behavior: href, src, alt, class, id, style, target
- Every HTML element has a set of global attributes (class, id, style, title, lang) plus element-specific attributes
- HTML headings h1–h6 create content hierarchy — h1 is the page title, h2 are sections, h3 are sub-sections
- A page should have exactly one h1 tag — using multiple h1 tags dilutes SEO and confuses screen readers
- NASSCOM-Deloitte project 1.25 million digital tech professionals needed in India by 2027 — HTML is the entry point
What Are HTML Attributes? Syntax and How Name-Value Pairs Work
An HTML attribute provides additional information about an element and is always written inside the opening tag. The syntax is: attributename="value". For example, in
, src and alt are attributes. Attributes come in name-value pairs separated by the equals sign, and the value is enclosed in double quotes (single quotes also work but double quotes are the universal standard). Some attributes are boolean — their presence alone activates them, without a value: disabled, checked, required, readonly, selected. For instance, makes the input field mandatory without needing required="true". Attributes are case-insensitive in HTML5 (though lowercase is the convention), and you can include multiple attributes in any order on a single tag. The browser reads all attributes in the opening tag before rendering the element. Understanding the distinction between elements (what content is) and attributes (what that content does or how it behaves) is one of the foundational concepts of HTML — and one that trips up beginners who confuse tags with their modifiers.

The Most Important HTML Attributes Every Developer Uses Daily
While HTML has dozens of attributes, a core set appears constantly across virtually every web project. The href attribute (on the a tag) specifies the link destination — the URL the link navigates to when clicked. Without href, an anchor tag is just styled text with no function. The src attribute (on img, script, and iframe tags) specifies the source file path or URL. The alt attribute (on img) provides alternative text for accessibility and SEO — it's what screen readers announce and what appears if the image fails to load. The class attribute assigns one or more CSS class names to an element, enabling stylesheet targeting: class="btn btn-primary" can apply multiple styles. The id attribute provides a unique identifier to a single element on a page, used for JavaScript targeting and anchor links. The style attribute applies inline CSS directly (though external CSS classes are preferred for maintainability). The target attribute on anchor tags controls where the link opens (target="_blank" opens in a new tab). The type attribute on input elements specifies the input's behavior: text, email, password, number, checkbox, radio, submit. The placeholder attribute adds hint text inside an empty input field. Knowing these attributes fluently — what they do, what elements accept them, and when each is appropriate — is what makes you productive as a frontend developer from day one.
HTML Headings h1 to h6: Content Hierarchy and SEO
HTML headings create the structural outline of a page's content. There are six heading levels: h1 through h6. The h1 is the most important — it represents the primary topic of the entire page and functions as the page title. Every page should have exactly one h1 tag, and it should contain the main target keyword (which is why heading structure is central to on-page SEO). The h2 tags represent major sections of the page, h3 tags are sub-sections within h2 sections, and h4–h6 are progressively smaller sub-divisions used for complex hierarchical content. Browsers render headings with decreasing default font sizes from h1 to h6, and you can override all visual styling with CSS while maintaining the semantic hierarchy in the HTML. Here's why this matters for SEO: Google's search crawler reads heading tags to understand what each section of a page is about — a page with a clear h1 containing the primary keyword, h2 tags covering related topics, and h3 tags with specific sub-points is more index-friendly than the same content presented as a wall of paragraphs. Accessibility is equally important: screen readers use heading structure to create a navigable outline of the page — users can jump between headings without reading every paragraph, which is how many visually impaired users navigate content-heavy pages.

| Attribute | Used On | Purpose | Example |
|---|---|---|---|
| href | <a> | Link destination URL | href="https://abctrainings.in" |
| src | <img>, <script> | Source file path or URL | src="photo.webp" |
| alt | <img> | Alternative text for accessibility and SEO | alt="ABC Trainings workshop" |
| class | All elements | CSS and JS targeting (multiple allowed) | class="btn btn-primary" |
| id | All elements | Unique identifier (one per page) | id="main-heading" |
| target | <a> | Controls where link opens | target="_blank" |
| placeholder | <input> | Hint text inside empty input field | placeholder="Enter your email" |
| type | <input> | Input field behavior | type="email" |
Common Attribute Mistakes Beginners Make and How to Avoid Them
There are several attribute mistakes that beginners make repeatedly, and knowing them upfront saves you hours of debugging. The most common mistake is using the same id attribute on multiple elements — id values must be unique on a page. JavaScript's getElementById and CSS selector #myId both target exactly one element, so duplicate ids create unpredictable behavior. Another common mistake is forgetting the alt attribute on img tags — it fails accessibility checks and hurts SEO. Omitting quotes around attribute values is technically allowed in some cases but breaks when values contain spaces or special characters: alt=A cool photo breaks on the space. Using target="_blank" without rel="noopener noreferrer" is a security vulnerability (the opened page can access your page via window.opener). For headings, skipping levels is a common mistake — jumping from h1 directly to h3 without an h2 breaks the semantic outline and confuses screen readers. Always use headings in order and never use heading tags just to make text visually large — use CSS font-size for that, and reserve heading tags for content structure. These are the kinds of details that senior developers check in code reviews, and knowing them in advance positions you as a professional from early in your HTML learning.
Web Development Career Scope in India 2026: Skills Employers Demand
Web development employers in 2026 look for developers who understand HTML at a deeper level than just making things appear on screen. NASSCOM and Deloitte project 1.25 million digital tech professionals needed by 2027 — and frontend web skills are one of the largest categories within that demand. Job descriptions at companies like Infosys (Pune, Hinjewadi), TCS (Pune), Wipro (Hinjewadi), Mphasis (Pune), and KPIT Technologies list semantic HTML, accessibility standards (WCAG 2.1), and SEO-aware markup as explicit requirements alongside JavaScript framework knowledge. Entry-level web developers in Pune earn 3–5 LPA (AmbitionBox 2025), with junior frontend developers at product companies earning 4–7 LPA. The pathway from HTML fundamentals (episodes 1–7 of our series) to a job-ready full-stack developer takes roughly 6–9 months of focused training. What most people don't realize is that the shortcut is not to rush to React or Angular while skipping HTML fundamentals — the shortcut is to nail HTML, CSS, and JavaScript deeply, because the frameworks become vastly easier once your foundations are solid. Heading structure, attributes, and semantic markup are the first indicators senior developers look at when evaluating a junior developer's code quality.
Start Your HTML Journey at ABC Trainings Pune, Aurangabad and Sangli
ABC Trainings' free HTML video series — Episode 3 is this tutorial on attributes and headings — is part of our complete web development learning path. The free YouTube episodes give you the concepts; our live classroom training in Pune (Wagholi, Hadapsar), Aurangabad/Sambhajinagar (CIDCO, Osmanpura), and Sangli gives you hands-on practice, project work, and direct instructor support. Our web development curriculum covers HTML 1 through 7, CSS (Flexbox, Grid, Responsive Design), JavaScript (DOM, events, AJAX, ES6+), and full-stack frameworks, with real projects that go into your portfolio. Courses are NSDC and Skill India affiliated, and our placement support connects you with IT companies in Pune's Hinjewadi and Magarpatta technology corridors, as well as IT firms in Aurangabad's CIDCO business district. Under the CMYKPY stipend scheme, eligible Maharashtra students receive ₹6,000–₹10,000 per month during their internship. Call +91 7039169629 or WhatsApp 7774002496 to join the next HTML-to-full-stack batch and start building your web development career today.
Under the Chief Minister Yuva Karya Prashikshan Yojana (CMYKPY), Maharashtra IT students enrolled in approved web development training programs can receive a monthly stipend of ₹6,000–₹10,000 during their internship. This government support helps freshers complete skill training without financial burden. Ask ABC Trainings about CMYKPY eligibility when you enroll for our HTML and web development courses.Get the Web Development Brochure + Fees + Batch Dates on WhatsApp
Free 1:1 counselling. Placement track record. CMYKPY/PMKVY eligibility check.
💬 Get Brochure on WhatsApp📞 Call 7039169629About the author: Amit Kulkarni. 8 yrs leading IT training at ABC Trainings, ex-Infosys.
Visit Our Centers
- Wagholi (Pune): 1st Floor, Laxmi Datta Arcade, Pune-Ahilyanagar Highway. Call 7039169629
- Hadapsar (Pune HQ): 1st Floor, Shree Tower, opp. Vaibhav Theater, Magarpatta. Call 7039169629
- Cidco (Chh. Sambhajinagar): Kalpana Plaza, opp. Eiffel Tower, N-1 Cidco. Call 7039169629
- Osmanpura (Chh. Sambhajinagar): S.S.C Board to Peer Bazar Road, near Jama Masjid. Call 7039169629
- Sangli: Shubham Emphoria, 1st Floor, Above US Polo Assn., Sangli-Miraj Rd, Vishrambag. Weekend batches available. Call 7039169629
FAQs
What are HTML attributes and how do they work?
HTML attributes are name-value pairs written inside the opening tag of an HTML element that provide additional information about how the element should behave or appear. The syntax is: attributename="value". For example, href tells an anchor tag where to navigate, src tells an img tag where to find the image file, and alt describes the image for screen readers and search engines. Without attributes, many HTML elements cannot perform their core function.
Why should every page have only one h1 heading?
Each page should have exactly one h1 tag because h1 is interpreted by search engines as the primary topic of the entire page — it carries significant SEO weight. Multiple h1 tags dilute this signal and confuse Google's understanding of your page's focus topic, potentially harming your search ranking. Multiple h1 tags also break the semantic outline that screen readers present to visually impaired users. Every page should have one h1 (the page title), multiple h2 tags (major sections), and h3–h6 for sub-sections.
What is the difference between class and id attributes in HTML?
The class attribute can be assigned to multiple elements on the same page and each element can have multiple classes (separated by spaces). It's used for CSS styling and JavaScript targeting of groups of elements. The id attribute must be unique on a page — only one element should have a given id value. It's used for JavaScript's getElementById, CSS's hash selector (#myId), and anchor links (href="#myId"). Use class for styling patterns across multiple elements, and id for targeting one specific unique element.
Does ABC Trainings offer HTML training for beginners in Pune and Aurangabad?
Yes. ABC Trainings offers structured HTML, CSS, JavaScript, and full-stack web development courses for beginners at centers in Pune (Wagholi, Hadapsar), Aurangabad/Sambhajinagar (CIDCO, Osmanpura), and Sangli. This Episode 3 video is part of our free YouTube HTML series that accompanies live classroom training. Courses are NSDC and Skill India affiliated. Call +91 7039169629 or WhatsApp 7774002496 for batch dates, fees, and CMYKPY eligibility.



