Web Development

HTML Paragraphs and Inline Styles: Episode 4 Complete Tutorial (Updated June 2026)

Learn the HTML p tag, inline styles, and key CSS properties like color, font-size, font-family, text-align, and background-color. Watch Episode 4 free and join ABC Trainings' web development course in Pune and Aurangabad.

AB
ABC Trainings Team
June 25, 2026 — 10 min read

HTML Paragraphs and Inline Styles: Episode 4 Complete Tutorial (Updated June 2026) (Updated June 2026)

Episode 4 of our HTML series covers two things that every web developer uses constantly: the paragraph tag and inline styles. The p tag is how you put readable blocks of text on any web page — browsers automatically add spacing before and after each paragraph, and text wraps naturally to fit the screen. Inline styles, written using the style attribute inside any HTML tag, let you apply CSS properties like color, font-size, font-family, and text-align directly to individual elements without a separate stylesheet. Here's the thing: NASSCOM and Deloitte project that India needs 1.25 million AI and digital technology professionals by 2027. Web development is a central pathway to that goal, and knowing how to control text styling and layout is one of the most practical skills you'll use in every single project. What most people don't realize is that while inline styles are a quick and useful tool, there's a right time and a wrong time to use them — and knowing that distinction is what separates junior developers who write messy code from senior developers whose code is maintainable and scalable. In Episode 4, I walk you through both concepts clearly, with practical examples you can follow along. Let's jump in.

TL;DR
  • The HTML p tag creates paragraph blocks with automatic top and bottom spacing — browsers handle line wrapping automatically
  • The style attribute lets you apply inline CSS directly to any HTML element: color, font-size, font-family, text-align, background-color
  • Inline styles have the highest CSS specificity — they override external and internal stylesheets
  • Use inline styles sparingly: best for one-off overrides, not for repeated styles (use CSS classes instead)
  • NASSCOM-Deloitte: India needs 1.25 million digital tech professionals by 2027 — web fundamentals are the entry point

The HTML Paragraph Tag: How p Works and Why It Matters

The HTML paragraph element is created with the opening p tag and the closing /p tag. Everything between them is treated as a paragraph of text. Browsers automatically add a margin — typically 1em — above and below each paragraph, creating readable spacing between successive paragraphs without any CSS. Inside a paragraph, text wraps automatically based on the available width of the container, adjusting for different screen sizes. The paragraph tag is a block-level element, meaning each p starts on its own line and occupies the full available width. You cannot nest block-level elements like div, h1, or another p inside a p — doing so causes the browser to auto-close the first p tag before the nested element, leading to unintended markup. Within a paragraph, you can use inline elements like span, strong, em, a, and img freely. The br tag (line break) forces a new line within a paragraph without starting a new paragraph block — useful for poetry, addresses, or structured text where visual line breaks matter but paragraph spacing doesn't. Understanding when to use p vs br vs div is one of the earliest important decisions in HTML markup — p for genuine paragraphs of text, div for structural containers, and br only for deliberate line breaks within flowing text.

HTML Paragraphs and Inline Styles: Episode 4 Complete Tutorial (Updated June 2026)
Real student workshop at ABC Trainings

The HTML Style Attribute: Applying Inline CSS to Elements

The style attribute lets you apply CSS styling directly to any HTML element in its opening tag. The syntax is: style="property: value; property2: value2". For example,

This is styled text.

makes that specific paragraph red and 18 pixels tall. Every CSS property that works in a stylesheet also works in the style attribute — color, background-color, font-size, font-family, font-weight, text-align, margin, padding, border, and many more. Inline styles have the highest specificity in CSS — they override rules defined in external stylesheets (linked CSS files) and internal stylesheets (style blocks in the head section), except for rules marked !important. This makes them useful for one-off overrides in specific situations. The downside is that inline styles mix presentation and content in the same file, making HTML harder to read and maintain. If you apply the same styling to 50 paragraphs using inline styles, you have to change 50 lines when the design needs to update. A CSS class applied to all 50 elements requires a single change. So inline styles are a learning tool and an occasional quick fix — not a scalable production pattern.

Key CSS Properties You Can Apply with Inline Styles

The most commonly used CSS properties in inline styles are color (sets text color using named colors, hex codes, or rgb values), background-color (sets the background of the element), font-size (controls text size in pixels, em, rem, or percent), font-family (sets the typeface — often a font stack like Arial, Helvetica, sans-serif), font-weight (controls bold: normal or bold, or numeric values 100–900), text-align (aligns text: left, center, right, or justify), text-decoration (underline, line-through, or none — useful to remove default link underlines), margin (space outside the element), and padding (space inside the element between content and border). The border property adds visible borders: border: 1px solid black draws a 1-pixel solid black border around the element. Line-height sets the spacing between lines of text — a value of 1.5 or 1.6 dramatically improves readability for body text. Width and height can set explicit dimensions on block elements. All of these work identically whether you use them in the style attribute, in an internal style block, or in an external CSS file — the only difference is how they're applied and where they live in your codebase.

HTML Paragraphs and Inline Styles: Episode 4 Complete Tutorial (Updated June 2026)
Real student workshop at ABC Trainings
CSS PropertyWhat It ControlsExample ValueCommon Use
colorText color#333333 or rgb(51,51,51)Body text, headings, links
background-colorElement background color#f5f5f5 or yellowHighlights, cards, header backgrounds
font-sizeText size16px, 1rem, 1.2emBody text (16px), headings (larger)
font-familyTypefaceArial, Helvetica, sans-serifSetting brand font or fallback stack
font-weightBold levelnormal, bold, 700Emphasis, headings, UI labels
text-alignHorizontal text alignmentleft, center, right, justifyCentering headings, justified body text
line-heightLine spacing1.5, 1.6, 24pxReadability for body paragraphs

When to Use Inline Styles vs CSS Stylesheets

The rule of thumb for inline styles vs stylesheets is about maintainability and separation of concerns. Inline styles are appropriate in three scenarios: when you're learning HTML and CSS basics (it's quicker to see the effect immediately), when you're applying a style to exactly one element that will never be replicated elsewhere, or when you're generating HTML programmatically and need to apply computed styles dynamically. In all other cases, CSS classes in an external stylesheet are the professional approach. An external stylesheet can be applied to multiple pages simultaneously, edited in one place to update the entire site, cached by browsers for faster page loads, and managed by team members independently from HTML content. Internal style blocks (in the head section) are appropriate for page-specific styles that won't be used across multiple pages. The cascading hierarchy in CSS — inline styles beat internal stylesheets beat external stylesheets (when specificity is otherwise equal) — is what gives inline styles their override power. Understanding this cascade is what lets you debug CSS layout issues efficiently, which is a core skill that employers test in frontend developer interviews.

HTML Paragraphs, Styling, and the Web Developer Job Market in India

The HTML paragraph tag and inline styles appear in every web development project regardless of framework or technology stack. Even React, Vue, and Angular applications generate HTML p tags, and inline styles are used programmatically in all major JavaScript frameworks (React's style prop accepts a JavaScript object of CSS properties). NASSCOM and Deloitte project India will need 1.25 million AI and digital tech professionals by 2027 — and web development sits at the foundation of that demand. Entry-level web developers in Pune earn between 3 and 5 LPA (AmbitionBox 2025), while developers who move into full-stack roles command 8–15 LPA at companies like Infosys, TCS, Wipro, Mphasis, and Persistent Systems. What most people don't realize is that the difference between a developer who gets hired and one who doesn't isn't usually knowledge of a specific framework — it's the quality of their HTML and CSS fundamentals. Clean, accessible, well-structured HTML is what senior developers notice in code reviews and what technical interviews test at every major IT company in Pune's Hinjewadi and Magarpatta corridors.

Learn HTML Fundamentals at ABC Trainings Pune, Aurangabad and Sangli

ABC Trainings' HTML curriculum — from Episode 1 through this Episode 4 and beyond — is designed to build the kind of strong fundamentals that make you competitive in today's job market. Our free YouTube series gives you the concepts; our live classroom training in Pune (Wagholi, Hadapsar), Aurangabad/Sambhajinagar (CIDCO, Osmanpura), and Sangli gives you the hands-on practice, project work, and doubt-clearing support to actually retain and use what you learn. From Episode 4, our curriculum continues into CSS layouts, JavaScript, responsive design, and full-stack development with real-world projects you can show in interviews. Our courses are NSDC and Skill India affiliated. Placement support includes resume preparation, GitHub portfolio setup, and direct referrals to IT companies in Pune and Sambhajinagar. Under the CMYKPY stipend scheme, eligible Maharashtra IT trainees 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 near you.

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 makes it easier to complete full-stack training without financial pressure. Contact ABC Trainings to check your CMYKPY eligibility before enrolling.

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 7039169629

About 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

💬 WhatsApp 7774002496

FAQs

What does the HTML p tag do?

The HTML p tag creates a paragraph element — a block of text with automatic top and bottom margin spacing added by the browser. Text inside a p tag wraps automatically to fit the available screen width. Each p is a block-level element that starts on its own line. You cannot nest other block-level elements (like div or another p) inside a p tag; you can use inline elements like span, a, strong, and em freely within it.

What is the style attribute in HTML and how do you use it?

The style attribute lets you write CSS properties directly inside any HTML opening tag: style="property: value". For example, style="color: blue; font-size: 20px; text-align: center" makes an element blue, 20 pixels tall, and centered. Inline styles have the highest CSS specificity, meaning they override rules from external stylesheets and internal style blocks. All standard CSS properties work inside the style attribute — color, background-color, font-size, font-family, text-align, margin, padding, border, and more.

When should I use inline styles instead of an external CSS file?

Use inline styles when: you need a truly one-off style for a single element that will never be replicated, when you are generating HTML programmatically and applying computed values dynamically, or when learning and experimenting. For repeated styles, use CSS classes in an external stylesheet — this separates content from presentation, enables browser caching, and makes global style changes a single edit rather than updating dozens of inline style attributes one by one.

Does ABC Trainings offer HTML web development training in Pune for beginners?

Yes. ABC Trainings offers structured HTML, CSS, JavaScript, and full-stack web development courses at centers in Pune (Wagholi, Hadapsar), Aurangabad/Sambhajinagar (CIDCO, Osmanpura), and Sangli. This Episode 4 video is part of our free YouTube series accompanying our live classroom training. Courses are NSDC and Skill India affiliated. Call +91 7039169629 or WhatsApp 7774002496 for batch dates and fees.

A

ABC Trainings Team

Expert insights on engineering, design, and technology careers from India's trusted CAD & IT training institute with 11 years of experience and 2000+ trained professionals.