Is it considered bad style to always use
<div> instead of using, say,
<span>? I know that using specific tags like
span better convey the purpose of the node, but is it actually frowned upon to always use
For example, if I were to have an inline style:
<div class="hello">Hello, my name is <div class="name-div">John Doe</div></div>
<div class="hello">Hello, my name is <span class="name-span">John Doe</span></div>
name-div class would have
display: inline set. Is either way considered fine or is there a commonly accepted preference?
Here is an actual example so that maybe this won't be off-topic:
<div class="online">You have been online for <span class="time">30</span> days.</div>
Where the desired output is something like:
You have been online for 30 days.
(i.e. the 30 has some special styling).
In this case, is it really considered "bad" to use a
inline styling rather than
span? I feel that arguments can be made either way in that
span is obviously more accurately describing the function of that node, but you could also say it's preferable to minimize the variety of tags for the sake of consistency across browsers (and choose not to use things like
strong in lieu of special styling on a