When using html editors, part of the "extra" code they add are usually these <span> </span> tags that I have no idea what they are for, since when I delete them from the page, nothing changes.
<div> tags cause a line to break but <span> tags do not.
For example, if I write <div style="color:red">Red text</div> it will output that on a new line.
However say I want to have a line of black text but only one word in red I'd use sentence...... <span style="color:red">Red text</span> ......sentence.
A <div> is a BLOCK level element and is used to define distinct parts of a document and structural divisions.
Block elements have an implied line break before and after.
A <span> is an INLINE element and these are used as presentation elements only.
__________________ And how can we win, when fools can be kings
spans is a simpler div for me. It's easy to change the div and make it act like a span via CSS but sometimes it's easier to add span tags.
The most common use of span tags for me is when I add "read more" button on an article that I write and publish on some of my blogs. Blogger requires that users mark the mask content with span tags.
Wow, thanks for your explanations.
I had some articles to code in html and this <span> tag has helped me a lot, saving many codes.
It's really useful once you learn what it is for.