KeyDifference – divvsspan
HTML是一种广泛使用的语言来开发web页面。它stands for Hyper Text Markup Language. The term Hyper refers to linking to other web resources on the internet. The term Markup refers to the ability to create formatted text with images and other multimedia resources. Hyperlinks are the main components in HTML that make all web resources connect together. There are several versions of HTML. They are HTML 2.0, 3.2, 4.01 andHTML5. Basically, HTML is a text document with tags. It tells the Web browser the way to structure the web page to display it. The div and span are two tags in HTML. Each HTML element has a default display value depending on the type of the element. So, they can be a block or inline elements. This article discusses the difference between div and span. Thekey differencebetween div and span is thatdiv is a block level element while span is an inline element.
CONTENTS
1.Overview and Key Difference
2.What is div
3.What is span
4.Similarities Between div and span
5.Side by Side Comparison – div vs span in Tabular Form
6.Summary
What is div?
All html documents start with a document type declaration. Today the most common version of HTML is HTML5. Therefore, the type declaration is . All html tags should be included inside the and tags. The necessary details of the web page are included inside the
tag. The visible web page is written inside the tag. There are tags for each purpose. Thetag is used to paragraphs. The
, etc. are used for headings. The content inside the starting and ending tag is known as an element. e.g.
This is a paragraph
.Each HTML element has a default display value depending on the type of the element. The default display values can either be block or inline. The block level elements always start with a new line. These elements take whole available width. Some examples of block level elements are
,