HTML: Can you hide/ignore text elements from browser Find (CTRL+F)

后端 未结 3 634
渐次进展
渐次进展 2021-02-05 13:32

I\'ve got a web app with a fairly complicated UI, and a portion of the screen reserved for content.

If possible, I would like to make it so that when the user uses the b

3条回答
  •  别跟我提以往
    2021-02-05 14:10

    To expand on nullability's answer: You can also store the text in a data attribute like that:

    .css-text [data-content]:before {
        content: attr(data-content);
    }
    Hello, !

    Cf. https://developer.mozilla.org/en/docs/Web/Guide/HTML/Using_data_attributes#CSS_Access

提交回复
热议问题