u[JSON Fetch Request example] { text-underline-offset: 3px; }
<h1><u>JSON Fetch Request example</u></h1>
在上面的代码中,我无法偏移下划线.但我可以选择a标签,因为我下面的代码按照mdn文章工作(ps:我无法找到mdn文章):一个二个一个一个
anauzrmj1#
你可以给元素添加一个CSS类,也可以用.querySelector来选择元素。
.querySelector
.r{ color: red; }
<p>This is a <u>test</u> of the selection of u elements w JavaScript.</p> <p>This is a <u class=r>test</u> of the selection of u elements w/o JavaScript.</p>
1条答案
按热度按时间anauzrmj1#
你可以给元素添加一个CSS类,也可以用
.querySelector
来选择元素。