It’s getting better. I now know how to select the first and last child of the tds, but I’d like to single out the second and third as well so I can indent them. Seems that nth-child would limit the compatibility.
Any suggestions?
It’s getting better. I now know how to select the first and last child of the tds, but I’d like to single out the second and third as well so I can indent them. Seems that nth-child would limit the compatibility.
Any suggestions?
I think you’re right. The table works fine for most mobile devises without having to switch.
As I mentioned above, I wanted to avoid that selector because it’s not as compatible as I would like. But, since it’s all I could find, I went ahead and used it. I’m pretty sure it won’t break anything. At worst, it just won’t render.
Critiques for the results? Suggestions?
There are other methods of targeting specific cells, but I would be grateful if you would please explain in more detail about the problems you forsee with the nth-child selector.?
One of my goals is to make my site work on all browsers, or as many as possible. Towards that, I look to use tools compatible with all browsers, or as many as possible. It’s my understanding that the nth-child selector is not universally compatible.
In the end, I decided the nth-child selector is compatible enough. As mentioned, I think the worst that can happen is that it won’t render.
Looks better than “enough” to me.
I think where the fragility lies is if and when the number / order of children changes. If you think this is a possibility, I think it would be a good idea to leave a comment like
<!-- these rows are styled using n-th child -->
<tr>
<td>
Off-Topic
Is it me or does that look more canine than vulpine?
I’ve always thought it looked more like a young dragon.
That’s not an uncommon goal but one that is usually unrealistic until after the designer takes a realistic look at the numbers of each version of each device in the wild and decides which ones are “musts” and which ones are “nice to have”. Coding for “all” devices is expensive and rarely worth the cost (impractical vs impossible). I hear “code for all browsers” quite frequently, but during subsequent discussion I’ve not met anyone who insisted on coding for Netscape.
You sound like you’re well read on the subject. But “just in case” you missed “can i use”, check this out. I’m not taking sides, just throwing out another reference source. nth-child() and the plus (adjacent sib selector) each boast 98%+ cross browser compatibility so it seems like a tossup to me.
http://caniuse.com/#search=nth-child()
As always, exceptions are handled on a case by case basis.
Guilty as charged. I’m lazy with the comments. And it’s true, I often go back an look at what I’ve done as I scratch my head.
Doesn’t look much like a fox. I think the designer took into account what would happen to the image if it were folded like that.
Vulpine - I manage to learn something every day.
I knew as soon as I posted that, that I’d been way too lax with my language. Of course I don’t even try to check if my coding is compatible with “all” or even “most” browsers and devices. I check to see which are the predominant browsers (this has changed over the seven years I’ve done so) and keep the top four or five handy. That seems reasonable to me.
I’m grateful to everyone for your feedback and suggestions. Several of you have become my gurus. Thanks for being here.
Now that I’ve had a better chance to look in detail, that’s a great link that links to other great info. Thanks you.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.