The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> what is the difference between div tag and span tag ??
deb1
post Jun 11 2020, 09:16 AM
Post #1


Member
***

Group: Members
Posts: 99
Joined: 7-May 20
Member No.: 27,330



please can someone tell me what is the difference between div tag and span tag ??
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jun 11 2020, 10:02 AM
Post #2


.
********

Group: WDG Moderators
Posts: 8,462
Joined: 10-August 06
Member No.: 7



Please start new threads instead of posting in old ones.

(This post was originally posted in https://forums.htmlhelp.com/index.php?showtopic=293 )
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
deb1
post Jun 11 2020, 10:46 AM
Post #3


Member
***

Group: Members
Posts: 99
Joined: 7-May 20
Member No.: 27,330



QUOTE(LetsLearnCodingTogether24 @ Jun 11 2020, 10:26 AM) *

for anyone still having problems like these, I can personally vouch for a course I took on Udemy.

It's https://www.udemy.com/course/html-css-and-j...veloper-course/


is it free or do we have to pay for the course?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
deb1
post Jun 11 2020, 12:10 PM
Post #4


Member
***

Group: Members
Posts: 99
Joined: 7-May 20
Member No.: 27,330



what is the difference between div and span tags in html?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 11 2020, 01:50 PM
Post #5


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,879
Joined: 9-August 06
Member No.: 6



One is block level and one is inline.

https://htmlhelp.com/reference/html40/block.html

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
deb1
post Jun 11 2020, 02:26 PM
Post #6


Member
***

Group: Members
Posts: 99
Joined: 7-May 20
Member No.: 27,330



QUOTE(pandy @ Jun 11 2020, 01:50 PM) *

One is block level and one is inline.

https://htmlhelp.com/reference/html40/block.html


Can you please write a html coding for me on here where it shows how to use span and div tag in it. it will be easier for me to understand that way smile.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 11 2020, 02:43 PM
Post #7


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,879
Joined: 9-August 06
Member No.: 6



We already talked about this. Use DIV to group things together or when no other block level element fits.

SPAN is similar to DIV in that it lacks features in itself, but it's inline (text level). If you want a word to stand out because it's important, you'd probably use EM and style it to your heart's content.

CODE
This is <em>important</em>.


But if you want to make all words have different colors because you think it looks pretty (just a dumb example), you don't want to use a meaningful element, but you still need something to apply CSS to, so SPAN is your choice.

CODE
<span>Nothing</span> <span>here</span> <span>is</span> <span>of</span> <span>importance</span>.


In the first example important will stand out even without CSS. The browser may make it bold or italic. In the second example all the words will look the same without CSS. SPAN doesn't carry any meaning.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
deb1
post Jun 11 2020, 02:54 PM
Post #8


Member
***

Group: Members
Posts: 99
Joined: 7-May 20
Member No.: 27,330



QUOTE(pandy @ Jun 11 2020, 02:43 PM) *

We already talked about this. Use DIV to group things together or when no other block level element fits.

SPAN is similar to DIV in that it lacks features in itself, but it's inline (text level). If you want a word to stand out because it's important, you'd probably use EM and style it to your heart's content.

CODE
This is <em>important</em>.


But if you want to make all words have different colors because you think it looks pretty (just a dumb example), you don't want to use a meaningful element, but you still need something to apply CSS to, so SPAN is your choice.

CODE
<span>Nothing</span> <span>here</span> <span>is</span> <span>of</span> <span>importance</span>.


In the first example important will stand out even without CSS. The browser may make it bold or italic. In the second example all the words will look the same without CSS. SPAN doesn't carry any meaning.
\


OK understand it now . thank you again for explaining it to me.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
deb1
post Jun 11 2020, 02:58 PM
Post #9


Member
***

Group: Members
Posts: 99
Joined: 7-May 20
Member No.: 27,330



Just wondering is BOOTSTRAP a part of html also ? what is the difference between html and bootstrap?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 11 2020, 03:52 PM
Post #10


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,879
Joined: 9-August 06
Member No.: 6



You already asked that and I answered it here.
https://forums.htmlhelp.com/index.php?s=&am...st&p=139399
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
deb1
post Jun 11 2020, 11:56 PM
Post #11


Member
***

Group: Members
Posts: 99
Joined: 7-May 20
Member No.: 27,330



QUOTE(deb1 @ Jun 11 2020, 02:54 PM) *

QUOTE(pandy @ Jun 11 2020, 02:43 PM) *

We already talked about this. Use DIV to group things together or when no other block level element fits.

SPAN is similar to DIV in that it lacks features in itself, but it's inline (text level). If you want a word to stand out because it's important, you'd probably use EM and style it to your heart's content.

CODE
This is <em>important</em>.


But if you want to make all words have different colors because you think it looks pretty (just a dumb example), you don't want to use a meaningful element, but you still need something to apply CSS to, so SPAN is your choice.

CODE
<span>Nothing</span> <span>here</span> <span>is</span> <span>of</span> <span>importance</span>.


In the first example important will stand out even without CSS. The browser may make it bold or italic. In the second example all the words will look the same without CSS. SPAN doesn't carry any meaning.
\


OK understand it now . thank you again for explaining it to me.



You explained the <em> tag and the <span> tag which i understand now . can you please also show me the coding for the <div> tag so that i can understand that
as well smile.gif

This post has been edited by deb1: Jun 11 2020, 11:57 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 12 2020, 04:24 AM
Post #12


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,879
Joined: 9-August 06
Member No.: 6



HTML 5 offers new elements that can be used instead of DIV in many cases. But lets pretend they don't exist.

A typical use of DIV in a HTML 4.01 page could look like this.

CODE
<div id="header">...</div>

<div id="topnav">...</div>

<div id="sidebar">...</div>

<div id="main">...</div>

<div id="footer">...</div>

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 5th July 2020 - 02:01 AM