What is the difference between span and div

0 votes
What tag should i used in order to wrap sections of a document. Can someone explain the main difference between them.
Jan 16, 2020 in Web Development by anonymous
• 37,530 points

recategorized Jan 21, 2020 by Niroj 1,759 views
div : has display type block and takes right and left space and starts in new dive.we can add padding and margin in all sides

span: has display inline and dont start in new line.we cannot add top and bottom padding but left and right can be added.

Hi @kulkarniradnyas17@gmail.com, 

Thank you for your contribution to the Edureka Community.

Register/Sign up on the community to gain points for further contributions. You may ask questions, answer, upvote, and downvote an answer. Each of these would fetch you points and you could be among the top contributors and win exciting merchandise from Edureka. 

1 answer to this question.

0 votes

The div should be used to wrap sections of a document, while use spans to wrap small portions of text, images, etc. 

The <div> element is used while creating css based layouts in html, whereas <span> element is used to stylize texts.

answered Jan 16, 2020 by Niraj

edited Jan 21, 2020 by Niroj

Related Questions In Web Development

+1 vote
9 answers

What is the difference between web design and web development?

A designer designs the web pages and ...READ MORE

answered Jan 22, 2020 in Web Development by Niroj
• 82,780 points
450 views
+1 vote
1 answer

What is the relationship between angularjs Scope with controller/view?

Let us consider the below block: <div ng-controller="emp"> ...READ MORE

answered Jan 20, 2020 in Web Development by Niroj
• 82,780 points

edited Jan 21, 2020 by Niroj 257 views
0 votes
3 answers

Explain the difference between visibility:hidden; and display:none?

display:none means that the tag in question will ...READ MORE

answered Dec 13, 2020 in Web Development by Gitika
• 65,930 points
47,969 views
0 votes
1 answer
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
2,724 views
0 votes
1 answer

Using/Handling colon inside a JSF generated HTML element ID in CSS selector

Yes, you can.  Just Backslash (\) the colon.  Like ...READ MORE

answered Nov 14, 2018 in Others by DataKing99
• 8,240 points
1,352 views
0 votes
1 answer

What is a css selector and where is it used?

CSS Selector is a combination of element ...READ MORE

answered Nov 21, 2018 in Data Analytics by Kalgi
• 52,370 points
187 views
0 votes
1 answer

How many methods of including css in an HTML document?

Hello fignithi, yes!!,you can use external file for css ...READ MORE

answered Jan 16, 2020 in Web Development by Niraj

reshown Jan 16, 2020 by Sirajul 218 views
0 votes
1 answer

What does cors means in Angularjs and what the use of it?

CORS is Cross Origin Resource Sharing which means you ...READ MORE

answered Jan 29, 2020 in Web Development by kartik
• 37,530 points
2,243 views