Divs and Spans in HTML

 Divs and Spans in HTML


Divs and spans are HTML elements used for grouping and styling content. A div is a block-level element used for grouping larger sections of content, while a span is an inline element used for grouping smaller sections of content.


html


<div>

  <h1>Section Heading</h1>

  <p>Some text goes here.</p>

</div>


<p>Some <span>inline</span> text goes here.</p>

In this example, the div contains a section heading and some text, while the span is used to apply styling to a specific part of a sentence.

No comments:

Post a Comment

The Importance of Cybersecurity in the Digital Age

 The Importance of Cybersecurity in the Digital Age Introduction: In today's digital age, where technology is deeply intertwined with ev...