Latest topics
The most tagged keywords
Difference between div and span tags
9jabaze - Entertainment | Webmaster | Browsing Tricks | Games/Apps Hub :: Technology Forums :: Blogging
Page 1 of 1
Difference between div and span tags
In HTML there are two types of elements.
1. Block Level Elements
2. Inline Level Elements
The “div” belongs to the block level elements. That means the moment you define anything within div tag, it takes the entire block of the page until you define a width for it.
1<div class="container">
2 <p>Hello World!</p>
3</div>
Now this will take the width of entire page until the
code below shows up.
1<div class="container" style="width:80%">
2 <p>Hello World!</p>
3</div>
Above div tag will consume 80% of the page to print
the text. Also if you define two div tags it will appear
below. That’s why it’s called block level elements.
Inline level elements never consume the entire page
but only the part where it is used. Even if you define
two span tags, it will appear inline with other.
1<span>Text1</span>
2<span>Text2</span>
Even if you define it below, it will printed on the
page as
Text1Text2
You can try this out on an editor and test it with any
browser. Hope I cleared your doubt.
Add on’s:
Other block level elements are <p>, <iframe>, <h1> till
<h6> etc
Other inline level elements are <a>, <strong>, <em>,
<sub>, <sup> etc
Source
1. Block Level Elements
2. Inline Level Elements
The “div” belongs to the block level elements. That means the moment you define anything within div tag, it takes the entire block of the page until you define a width for it.
1<div class="container">
2 <p>Hello World!</p>
3</div>
Now this will take the width of entire page until the
code below shows up.
1<div class="container" style="width:80%">
2 <p>Hello World!</p>
3</div>
Above div tag will consume 80% of the page to print
the text. Also if you define two div tags it will appear
below. That’s why it’s called block level elements.
Inline level elements never consume the entire page
but only the part where it is used. Even if you define
two span tags, it will appear inline with other.
1<span>Text1</span>
2<span>Text2</span>
Even if you define it below, it will printed on the
page as
Text1Text2
You can try this out on an editor and test it with any
browser. Hope I cleared your doubt.
Add on’s:
Other block level elements are <p>, <iframe>, <h1> till
<h6> etc
Other inline level elements are <a>, <strong>, <em>,
<sub>, <sup> etc
Source
Similar topics
» Mybb SEO: How To Add Meta Tags to Your Forum
» Download Page File Tags Like Zealwap, Unlimitedapps and Weezywap For Xtgem
» Wapkiz, Vmwap, Wapelf And Xtgem Meta Tags To Increase Google Search Crawling-Get More Visitors
» Download Page File Tags Like Zealwap, Unlimitedapps and Weezywap For Xtgem
» Wapkiz, Vmwap, Wapelf And Xtgem Meta Tags To Increase Google Search Crawling-Get More Visitors
9jabaze - Entertainment | Webmaster | Browsing Tricks | Games/Apps Hub :: Technology Forums :: Blogging
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Sun Jul 21, 2024 1:27 pm by Litifyed
» Optimal Сasual Dating - Authentic Damsels
Fri Jun 14, 2024 10:59 pm by Litifyed
» Superlative Сasual Dating - Verified Ladies
Wed Mar 06, 2024 11:12 pm by Litifyed
» Wapkiz 2020 Code: wapkiz register page responsive design Code
Thu Aug 13, 2020 5:15 pm by Hasty06
» 2020Bbnaija : Why I Can’t Be In A Relationship With Ozo – Nengi
Mon Jul 27, 2020 9:44 pm by Adminkunlex
» Can You Have S*x On Your First Date? Check Out What Actress, Debbie Shokoya Has To Say About This
Mon Jul 27, 2020 6:44 am by Adminkunlex
» Nigerian Singer, Seunfunmi Stephen, Recounts How Her Husband Was Killed By Stray Bullet
Mon Jul 27, 2020 6:41 am by Adminkunlex
» Olakunle Churchill Shares Photo Of Himself And Actress Rosy Meurer As He Writes On The Importance Of Loyalty
Mon Jul 27, 2020 6:39 am by Adminkunlex
» Ubi Franklin Reveals What Happened To Him When He Visited A Hospital Amid COVID-19 Pandemic
Mon Jul 27, 2020 6:37 am by Adminkunlex
» Vardy Wins Premier League Golden Boot, Beats Ings, Aubameyang & Sterling
Mon Jul 27, 2020 5:07 am by Adminkunlex
» The Right Way To Preach About Hell - Milton Goh
Mon Jul 27, 2020 5:03 am by Adminkunlex
» “Surgery For What?” – Regina Daniels Shows Off Hot Body After Childbirth (Video)
Sun Jul 26, 2020 9:12 pm by Adminkunlex
» I Got Pregnant As A Virgin At 23 – Wathoni
Sun Jul 26, 2020 8:24 pm by Adminkunlex
» #Bbnaija2020: Wathoni Kisses Kiddwaya During BBNaija Truth Or Dare Game
Sun Jul 26, 2020 8:20 pm by Adminkunlex
» Bbnaija: Kiddywaya Gropes Erica’s Breast While Dancing And She Reacts
Sun Jul 26, 2020 8:17 pm by Adminkunlex
» “I Hope To Collaborate With Rihanna & Drake Soon” – Rema
Sun Jul 26, 2020 11:54 am by Adminkunlex
» “Girls That Give Threesome With Their Friend Have A Special Place In Heaven” – Naira Marley
Sun Jul 26, 2020 11:50 am by Adminkunlex
» “To Be A Boss, You Must Be A Servant” – Frodd Recounts On His Humble Beginnings
Sun Jul 26, 2020 11:48 am by Adminkunlex
» “Stop Pressuring Us With Your Beauty”, Actress Queen Nwokoye Begs Ini Edo
Sun Jul 26, 2020 11:46 am by Adminkunlex
» You Look Like A Weed Smoker – Lady Fires Adekunle Gold Over New Look
Sun Jul 26, 2020 11:43 am by Adminkunlex