SlideShare a Scribd company logo
2
Most read
3
Most read
6
Most read
SPAN and DIV By Biswadip Goswami (C) Biswadip Goswami,  [email_address]
Introduction The <span> and <div> tags are very useful when dealing with Cascading Style Sheets. People tend to use the two tags in a similar fashion, but they serve different purposes.  (C) Biswadip Goswami,  [email_address]
<DIV> The <div> tag defines logical divisions (defined) in your Web page. It acts a lot like a paragraph tag, but it divides the page up into larger sections.  <div> also gives you the chance to define the style of whole sections of HTML. You could define a section of your page as a call out and give that section a different style from the surrounding text.  (C) Biswadip Goswami,  [email_address]
More about <Div> The <div> tag gives you the ability to name certain sections of your documents so that you can affect them with style sheets or Dynamic HTML.  One thing to keep in mind when using the <div> tag is that it breaks paragraphs. It acts as a paragraph end/beginning, and while you can have paragraphs within a <div> you can't have a <div> inside a paragraph.  (C) Biswadip Goswami,  [email_address]
Attributes in <div> Because the <center> tag has been deprecated in HTML 4.0, it is a good idea to start using <div style=&quot;text-align: center;&quot;> to center the content inside your div. The primary attributes of the <div> tag are:  style  class  id  <div id=&quot;scissors&quot;> <p>This is <strong class=&quot;paper&quot;>crazy</strong></p> </div>  (C) Biswadip Goswami,  [email_address]
SPAN The <span> tag has very similar properties to the <div> tag, in that it changes the style of the text it encloses. But without any style attributes, the <span> tag won't change the enclosed items at all.  <div id=&quot;scissors&quot;>   <p>This is <span class=&quot;paper&quot;>crazy</span></p>   </div>   (C) Biswadip Goswami,  [email_address]
The difference The primary difference between the <span> and <div> tags is that <span> doesn't do any formatting of it's own. The <div> tag acts includes a paragraph break, because it is defining a logical division in the document. The <span> tag simply tells the browser to apply the style rules to whatever is within the <span>.  a span element is in-line and usually used for a small chunk of in-line HTML 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. (C) Biswadip Goswami,  [email_address]
Example <span style=&quot;color : #f00;&quot;>2ndWord</span> Span tag - syntax <SPAN Attribute=value>  * text OR tags span applies to * </SPAN> Allowed Attributes: ID = string CLASS = string STYLE = string TITLE = string LANG = Language (i.e. RU - Russian) DIR = ltr|rtl; specifies if text reads left to right or right to left. SCRIPTING EVENTS = string (C) Biswadip Goswami,  [email_address]
Thank You ! For assistance with your ASP.Net requirements contact: Biswadip Goswami Primary e-mail:  [email_address] Alt e-mail:  [email_address] Webpage:  http://people.cognobytes.com/biswadip (C) Biswadip Goswami,  [email_address]

More Related Content

PPTX
HTML Semantic Elements
PPT
Advanced Cascading Style Sheets
PPT
PPTX
Html n CSS
PPT
How Cascading Style Sheets (CSS) Works
PPTX
Html5 semantics
PPSX
Introduction to Html5
HTML Semantic Elements
Advanced Cascading Style Sheets
Html n CSS
How Cascading Style Sheets (CSS) Works
Html5 semantics
Introduction to Html5

What's hot (20)

PPTX
Html form tag
PPT
Introduction to Cascading Style Sheets (CSS)
PPTX
PPTX
Basic HTML
PDF
Bootstrap
PPTX
Html links
PPT
cascading style sheet ppt
PDF
jQuery for beginners
PPT
Css Ppt
PPTX
Anchor tag HTML Presentation
PDF
Div tag presentation
PPTX
Html5 and-css3-overview
PPTX
Html ppt
PPT
CSS for Beginners
PPT
CSS Basics
PPTX
HTML (Web) basics for a beginner
PPTX
Html table
ODP
Introduction of Html/css/js
PPTX
Introduction to HTML+CSS+Javascript.pptx
Html form tag
Introduction to Cascading Style Sheets (CSS)
Basic HTML
Bootstrap
Html links
cascading style sheet ppt
jQuery for beginners
Css Ppt
Anchor tag HTML Presentation
Div tag presentation
Html5 and-css3-overview
Html ppt
CSS for Beginners
CSS Basics
HTML (Web) basics for a beginner
Html table
Introduction of Html/css/js
Introduction to HTML+CSS+Javascript.pptx
Ad

Viewers also liked (14)

PPTX
The history of social networks: how it all began
PDF
A Brief History Of Social Media
PPTX
History of Social Media
PPT
Social networking
PPTX
PPTX
10 things that make a good music video
PPT
Html & Css presentation
PPT
Ip addressing
PPT
Digital Storytelling
PPTX
Brief history of social media
PPT
Introduction to photoshop
PPTX
Presentation on Adobe Photoshop
PPTX
Introduction to HTML and CSS
PPS
Ip address
The history of social networks: how it all began
A Brief History Of Social Media
History of Social Media
Social networking
10 things that make a good music video
Html & Css presentation
Ip addressing
Digital Storytelling
Brief history of social media
Introduction to photoshop
Presentation on Adobe Photoshop
Introduction to HTML and CSS
Ip address
Ad

More from Biswadip Goswami (13)

PPTX
TSHOOT Solution for CISCO DEMO
PPT
Java for the Beginners
PPT
Random GSE Presentation
PPTX
Windows Vista Tour
PPT
Visual Studio Toolbox Unleashed
PPT
ASP_NET Features
PPT
Your First ASP_Net Project Part - 2
PPT
Three tier Architecture of ASP_Net
PPT
Your First ASP_Net project part 1
PPT
Html Layout
PPT
Html Layouts
TSHOOT Solution for CISCO DEMO
Java for the Beginners
Random GSE Presentation
Windows Vista Tour
Visual Studio Toolbox Unleashed
ASP_NET Features
Your First ASP_Net Project Part - 2
Three tier Architecture of ASP_Net
Your First ASP_Net project part 1
Html Layout
Html Layouts

Recently uploaded (20)

PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Machine learning based COVID-19 study performance prediction
PDF
Electronic commerce courselecture one. Pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
KodekX | Application Modernization Development
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Big Data Technologies - Introduction.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Machine learning based COVID-19 study performance prediction
Electronic commerce courselecture one. Pdf
Digital-Transformation-Roadmap-for-Companies.pptx
NewMind AI Monthly Chronicles - July 2025
KodekX | Application Modernization Development
“AI and Expert System Decision Support & Business Intelligence Systems”
Big Data Technologies - Introduction.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Approach and Philosophy of On baking technology
Per capita expenditure prediction using model stacking based on satellite ima...
Dropbox Q2 2025 Financial Results & Investor Presentation
Encapsulation_ Review paper, used for researhc scholars
NewMind AI Weekly Chronicles - August'25 Week I
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
20250228 LYD VKU AI Blended-Learning.pptx
Empathic Computing: Creating Shared Understanding
Review of recent advances in non-invasive hemoglobin estimation
The Rise and Fall of 3GPP – Time for a Sabbatical?

Span and Div tags in HTML

  • 1. SPAN and DIV By Biswadip Goswami (C) Biswadip Goswami, [email_address]
  • 2. Introduction The <span> and <div> tags are very useful when dealing with Cascading Style Sheets. People tend to use the two tags in a similar fashion, but they serve different purposes. (C) Biswadip Goswami, [email_address]
  • 3. <DIV> The <div> tag defines logical divisions (defined) in your Web page. It acts a lot like a paragraph tag, but it divides the page up into larger sections. <div> also gives you the chance to define the style of whole sections of HTML. You could define a section of your page as a call out and give that section a different style from the surrounding text. (C) Biswadip Goswami, [email_address]
  • 4. More about <Div> The <div> tag gives you the ability to name certain sections of your documents so that you can affect them with style sheets or Dynamic HTML. One thing to keep in mind when using the <div> tag is that it breaks paragraphs. It acts as a paragraph end/beginning, and while you can have paragraphs within a <div> you can't have a <div> inside a paragraph. (C) Biswadip Goswami, [email_address]
  • 5. Attributes in <div> Because the <center> tag has been deprecated in HTML 4.0, it is a good idea to start using <div style=&quot;text-align: center;&quot;> to center the content inside your div. The primary attributes of the <div> tag are: style class id <div id=&quot;scissors&quot;> <p>This is <strong class=&quot;paper&quot;>crazy</strong></p> </div> (C) Biswadip Goswami, [email_address]
  • 6. SPAN The <span> tag has very similar properties to the <div> tag, in that it changes the style of the text it encloses. But without any style attributes, the <span> tag won't change the enclosed items at all. <div id=&quot;scissors&quot;> <p>This is <span class=&quot;paper&quot;>crazy</span></p> </div> (C) Biswadip Goswami, [email_address]
  • 7. The difference The primary difference between the <span> and <div> tags is that <span> doesn't do any formatting of it's own. The <div> tag acts includes a paragraph break, because it is defining a logical division in the document. The <span> tag simply tells the browser to apply the style rules to whatever is within the <span>. a span element is in-line and usually used for a small chunk of in-line HTML 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. (C) Biswadip Goswami, [email_address]
  • 8. Example <span style=&quot;color : #f00;&quot;>2ndWord</span> Span tag - syntax <SPAN Attribute=value> * text OR tags span applies to * </SPAN> Allowed Attributes: ID = string CLASS = string STYLE = string TITLE = string LANG = Language (i.e. RU - Russian) DIR = ltr|rtl; specifies if text reads left to right or right to left. SCRIPTING EVENTS = string (C) Biswadip Goswami, [email_address]
  • 9. Thank You ! For assistance with your ASP.Net requirements contact: Biswadip Goswami Primary e-mail: [email_address] Alt e-mail: [email_address] Webpage: http://people.cognobytes.com/biswadip (C) Biswadip Goswami, [email_address]