gpt4 book ai didi

javascript - 表格单元格中的内联 CSS 元素溢出

转载 作者:行者123 更新时间:2023-12-02 18:51:16 25 4
gpt4 key购买 nike

我创建了一个脚本,可以动态插入包含表中内容的表行。问题是,我使用 <span><a>单元格内的标签以显示多章节条目。如果视口(viewport)太小,元素不会换行,而是溢出单元格,从而被作者姓名覆盖。

Screencap

网站链接:http://hunpony.hu/hunfic/

插入的动态 HTML(示例):

<span class="chapter-list">
<a href="https://sites.google.com/site/ponydocs/home/nite/eljonek-az-unnepek/prologus" target="_blank" data-hasqtip="true" oldtitle="Prológus" title="">Pr</a>
<a href="https://sites.google.com/site/ponydocs/home/nite/eljonek-az-unnepek/i" target="_blank" data-hasqtip="true" oldtitle="1. fejezet" title="">1</a>
<a href="https://sites.google.com/site/ponydocs/home/nite/eljonek-az-unnepek/ii" target="_blank" data-hasqtip="true" oldtitle="2. fejezet" title="">2</a>
<a href="https://sites.google.com/site/ponydocs/home/nite/eljonek-az-unnepek/iii" target="_blank" data-hasqtip="true" oldtitle="3. fejezet" title="">3</a>
<a href="https://sites.google.com/site/ponydocs/home/nite/eljonek-az-unnepek/iv" target="_blank" data-hasqtip="true" oldtitle="4. fejezet" title="">4</a>
<a href="https://sites.google.com/site/ponydocs/home/nite/eljonek-az-unnepek/v" target="_blank" data-hasqtip="true" oldtitle="5. fejezet" title="">5</a>
<a href="https://sites.google.com/site/ponydocs/home/nite/eljonek-az-unnepek/vi" target="_blank" data-hasqtip="true" oldtitle="6. fejezet" title="">6</a>
<a href="https://sites.google.com/site/ponydocs/home/nite/eljonek-az-unnepek/vii" target="_blank" data-hasqtip="true" oldtitle="7. fejezet" title="">7</a>
<a href="https://sites.google.com/site/ponydocs/home/nite/eljonek-az-unnepek/viii" target="_blank" data-hasqtip="true" oldtitle="8. fejezet" title="">8</a>
<a href="https://sites.google.com/site/ponydocs/home/nite/eljonek-az-unnepek/epilogus" target="_blank" data-hasqtip="true" oldtitle="Epilógus" title="">Ep</a>
<a href="https://sites.google.com/site/ponydocs/home/nite/eljonek-az-unnepek/elmulnak-az-unnepek" target="_blank" data-hasqtip="true" oldtitle="Utószó" title="">Usz</a>
</span>

一些 CSS 规则:

td.title .chapter-list {
list-style:none;
padding:0;
margin:0;
font-variant: small-caps;
white-space: nowrap;
padding-right:0;
}
td.title .chapter-list:before { content: "(fejezetek: " }
td.title .chapter-list:after { content: ")" }
td.title .chapter-list a {
white-space: nowrap;
margin:0px 3px;
padding-bottom:0;
}
td.title .chapter-list a:after { content:", " }
td.title .chapter-list a:last-child:after { content: "" !important }

最佳答案

我已经在 Firebug 中检查过这一点。删除 td.title .chapter-listtd.title .chapter-list awhite-space: nowrap;添加这个来代替

td.title .chapter-list,
td.title .chapter-list a
{
white-space: normal;
}

关于javascript - 表格单元格中的内联 CSS 元素溢出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15797008/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com