+ 5
what is the use of </span> and </div> in Html.
21 Respuestas
+ 4
There are some link in that page that point to futher info like https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements
Anyway, try to think about semantic of tags... In styling context, every content tag can be treated in different way from default (at example you can set <p> be like inline element) BUT one difference keep.. Though bad presented, its alway a paragraph. Why have to take cure of it if , at end, presentation is how we set? Well, i think that an external source explain better than me https://www.lifewire.com/why-use-semantic-html-3468271 than READ IT
After readed that, you can understand better why exist div and span.. They are NO semantic elements treated like, by default, block and inline respectively. Thats.
This is a more comprensive list of elements with semantic info https://developer.mozilla.org/en-US/docs/Web/HTML/Element
+ 5
KrOW thanks!!
+ 5
btw awesome coding KrOW
+ 5
what's your real name??
+ 5
no problem KrOW just askin , hope you don't mind .😅😅
+ 4
sorry KrOW i did that by mistake,corrected that and your help appreciated😅😅 thanks for your help!!!
+ 3
Satnam Singh elaborate
+ 3
KrOW the link was very helpful,Now i know what </Span> is but what's div can't is use <p> for that.explain the use of <div>
+ 3
KrOW upvote Q pls😁😁
+ 2
https://www.sololearn.com/discuss/1390253/?ref=app
P.S. I suggest you to read link that i posted in that question because there much differences often forgetted
+ 2
raza naqvi I almost forgotten... Because you are learning, see this code
https://code.sololearn.com/WaVusr8J1KvK/?ref=app
It contain useful links for learning programming (and some other it fields) and dont worry, i dont want upvotes but i hate when someone downvote without a why (except when its clear)
P.S. I upvote your question only because contain useful info to everyone that learning basic of html 😝
+ 2
raza naqvi Thank you 😊... You will find that its not awesome like you think when you learn more deep web development 😉
+ 2
raza naqvi Just for inform you: on SL its not allowed share personal information, then you can call me simply KrOW 😁
+ 2
Both of these are dhtml( dynamic html) tags. Used to make the content dynamic. With div tag you can make content accessible for every device(like mobile, desktop and iPad) with the help of bootstrap or css.
+ 2
KrOW , a good feast for learners. Thank you. It should reach all who loves learning.
+ 2
Brahmeswara Rao 👍👍👍
+ 1
raza naqvi 😁😁😁. You are welcome and dont worry 👍👍👍
+ 1
👍👍👍
+ 1
raza naqvi Dont worry (again), its just for inform you about SL rules 👍👍👍
+ 1
The <span> tag is an inline container used to mark up a part of a text, or a part of a document. The <span> tag is easily styled by CSS or manipulated with JavaScript using the class or id attribute. The <span> tag is much like the <div> element, but <div> is a block-level element and <span> is an inline element. It has no Default CSS Settings.
Example:
<!DOCTYPE html>
<html>
<body>
<h1>The span element</h1>
<p>My mother has <span style="color:blue;font-weight:bold">blue</span> eyes and my father has <span style="color:darkolivegreen;font-weight:bold">dark green</span> eyes.</p>
</body>
</html>
On attributes behavior:
1. Global Attributes: The <span> tag also supports the Global Attributes in HTML (https://www.w3schools.com/tags/ref_standardattributes.asp).
2. Event Attributes: The <span> tag also supports the Event Attributes in HTML(https://www.w3schools.com/tags/ref_eventattributes.asp).