Latest topics
» Peruzzi Ft. Not3s – Reason
Difference between div and span tags EmptyYesterday at 12:15 pm by Adminkunlex

» Peruzzi – Show Working
Difference between div and span tags EmptyYesterday at 12:14 pm by Adminkunlex

» Skales Ft. Akon – Kowope
Difference between div and span tags EmptyYesterday at 12:12 pm by Adminkunlex

» Qdot- German
Difference between div and span tags EmptyYesterday at 12:11 pm by Adminkunlex

» Best home workout for broad & wide chest
Difference between div and span tags EmptyTue Apr 07, 2020 10:27 am by Adminkunlex

» Nollywood Actress, Halima Abubakar Welcomes Baby Boy
Difference between div and span tags EmptyTue Apr 07, 2020 10:24 am by Adminkunlex

» What are key exercises to build a good-looking body for men?
Difference between div and span tags EmptyMon Apr 06, 2020 8:48 am by Adminkunlex

» Wild Life: Puzzle Story Android Game
Difference between div and span tags EmptyMon Apr 06, 2020 8:38 am by Adminkunlex

» Shootout 3D Android Game
Difference between div and span tags EmptyMon Apr 06, 2020 8:37 am by Adminkunlex

» 1945 - Shoot 'Em Up Android Game
Difference between div and span tags EmptyMon Apr 06, 2020 8:36 am by Adminkunlex

» Coronavirus Lockdown: 10 Ways To Beat Boredom
Difference between div and span tags EmptyFri Apr 03, 2020 8:31 pm by Adminkunlex

» Audio + Lyrics: Kcee – Sweet Mary J
Difference between div and span tags EmptyFri Apr 03, 2020 8:27 pm by Adminkunlex

» Social Etiquette: Guarding Your Tongue
Difference between div and span tags EmptyFri Apr 03, 2020 8:25 pm by Adminkunlex

» Pacific Warships: World of Naval PvP Wargame Android Game
Difference between div and span tags EmptyWed Apr 01, 2020 11:35 am by Adminkunlex

» Badlands Blade Battle Android Game
Difference between div and span tags EmptyWed Apr 01, 2020 11:33 am by Adminkunlex

» Google youtube app for java
Difference between div and span tags EmptyWed Apr 01, 2020 11:32 am by Adminkunlex

» How to use has, have and had in a sentence?
Difference between div and span tags EmptyWed Apr 01, 2020 11:28 am by Adminkunlex

» eBuddy Messenger Java App
Difference between div and span tags EmptyMon Mar 30, 2020 8:55 pm by Adminkunlex

» Google Chrome Os Jar Java App
Difference between div and span tags EmptyMon Mar 30, 2020 8:54 pm by Adminkunlex

» kasperskey Anti Virus Scanner Java App
Difference between div and span tags EmptyMon Mar 30, 2020 8:53 pm by Adminkunlex



Difference between div and span tags

Go down

Difference between div and span tags Empty Difference between div and span tags

Post by Adminkunlex on Sun Jan 19, 2020 9:17 am

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

Adminkunlex
Admin

Posts : 1342
Join date : 2019-06-08
Age : 20
Location : Osun State, Nigeria

https://9jabaze.forumotion.com

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum