Can I select only when there's no text around it?

前端 未结 4 963
执笔经年
执笔经年 2021-01-21 16:05

I would like to select anchor tags only when they\'re completely by themselves, that way I can make those look like buttons, without causing anchors within sentences to look lik

4条回答
  •  佛祖请我去吃肉
    2021-01-21 16:26

    The simple answer is: no, you can't.

    As explained here, here and here, there is no CSS selector that applies to the text nodes.

    If you could use jQuery, take a look at the contains selector.

提交回复
热议问题