div class=grid-item onclick=windowopenhttpswwwbaiducom _blank span格子1span divdiv 里需要写一行大字一行小字。如何实现。
可以在 div 中添加两个 span 标签,一个用于大字,一个用于小字,例如:
<div class="grid-item" onclick="window.open('https://www.baidu.com', '_blank')">
<span class="big-text">大字</span>
<span class="small-text">小字</span>
</div>
然后可以使用 CSS 样式来设置大字和小字的样式,例如:
.big-text {
font-size: 24px;
font-weight: bold;
}
.small-text {
font-size: 16px;
color: #999;
}
这样就可以在 div 中显示一行大字和一行小字了。
原文地址: http://www.cveoy.top/t/topic/cw6X 著作权归作者所有。请勿转载和采集!