Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个没有文本的跨度,它看起来像一个图像,它有背景和填充。但它不执行 onclick 事件。该怎么办?我是否需要将跨度更改为其他所有内容?
确保跨度内有东西,例如:
<span> </span>
据我所知,如果您希望其背景可见,则需要为跨度设置宽度和高度。至少你需要在 span 中包含一个空格
<span style='height:20px; width:100px; display:block;'> & n b s p ;</span>
不需要空间或任何东西,它工作得很好,没有任何变化,那是我的错!