You got to be kidding. Span tag got absolutely no influence on SEO if used with proper word spacing. As far as semantics. When used with class to identify certain span value attribute than it’s perfectly semantic (has meaning)
>Span tag got absolutely no influence on SEO if used with proper word spacing.
It is a domain so there shouldn’t be any word spacing. I don’t think it will actually affect SEO, but I prefer to be on the safe side when possible since I have no access to the algorithm of Google.
There is nothing semantic when a tag is used purely for styling purposes. Of course in such a case a compromise needs to be made somewhere. A span is one way, JS is another. I am not sure which would be better, and maybe there is a 3rd way which is better than both and which I didn’t think of.
This is perfect example of where a span element should be used. Div and span each have no semantic value, but were created for such use – to tailor html to your own needs. They can add value and meaning to the content with attributes, but its not necessary.
Most people disagree with that. But as I said I prefer to stay on the safe side when possible and be certain that the whole domain is read as a single term by the search engines (and that is more than just spacing).
Anyway, it is really not a huge deal. If there is no better way of targeting that part of the text then I will either add a span or use JS. Thanks for your help.
Maybe in the future there will be some pseudo-element like “::first-letter”, but instead of targeting just the first letter it will allow you to target a range within text.
Honestly, it doesn’t make much sense to me anyway. A `` is **not** a word separator and specifically does **not** convey any semantic meaning on its own. It’s *intended* for use as a styling hook. It’s the simplest (and entirely correct) solution.
>Here’s one way, but expect you’re looking for something more flexible
Thanks for that. What I am trying to do is to visually split “my-domain.com” in three lines like this:
I tried things like restraining the div size and playing with the word-break property but I couldn’t get it to work exactly as I want it. I think at some point I got it almost in some way, but the dash was stack on the “my” instead on the “domain”! This is why I concluded that I need to target “-domain” in order to get what I want, but maybe I am wrong.
>and that somebody doesn’t explain their case very well. In fact, when pressed, he admits:
Yes, I know. But he is number #7 contributor in stackexchange and he claims that he noticed that from personal experience. He is probably wrong, but I would prefer to avoid going the span way if possible.