What is the difference between DIV and SPAN in HTML?

devquora
devquora

Posted On: Feb 22, 2018

 

The difference between span and div is that a span element is in-line and usually used for a small chunk of HTML inside a line (such as inside a paragraph) whereas a div (division) element is block-line (which is basically equivalent to having a line-break before and after it) and used to group larger chunks of code.

<div id="scissors">
    <p>This is <span class="paper">crazy</span></p>
</div>

Further Reading: 

http://www.htmldog.com/guides/html/intermediate/spandiv/

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    HTML Interview Questions

    What is HTML and what is it used for?

    HTML, created by Berners-Lee in 1991, is a widely used language that structures webpages. It stands for HyperText Markup Language. HTML uses markup tags to define elements within a document, forming t..

    HTML Interview Questions

    What does HTML stand for?

    HTML, short for Hypertext Markup Language, is essential for web applications and pages. Developed by Tim Berners-Lee in 1980, it forms the foundation of the World Wide Web along with CSS and JavaScrip..

    HTML Interview Questions

    In which year HTML was first proposed?

    In 1980, Tim Berners-Lee proposed document sharing at CERN, leading to ENQUIRE's prototype. HTML Tags, publicly described in 1991, revolutionized computing, making Berners-Lee a pioneering figure in t..