[英]scrollbar in IE is working but not in chrome
我有一個如下表,滾動條在 IE 11 中使用 scroll=yes 工作,但在 Chrome 中同樣不起作用。任何建議或幫助將不勝感激。 謝謝你。
table, td { border: 1px solid black; border-collapse: collapse; padding: 5px; text-align: left; }
<body scroll="yes" scrolling="yes"> <table style="width:100%"> <tr> <td width="25%"><label>name </label></td> <td width="75%"><input type="text"></td> </tr> <tr> <td width="25%"><label>last name </label></td> <td width="75%"><input type="text"></td> </tr> <tr> <td width="25%"><label>middle name </label></td> <td width="75%"><input type="text"></td> </tr> <tr> <td width="25%"><label> name </label></td> <td width="75%"><input type="text"></td> </tr> </table>
除了 Internet Explorer 之外,其他任何東西都不支持 body 元素上的這些屬性。 事實上,Mozilla Developer Network 網站並沒有將其列為屬性: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
我建議在 css 中執行此操作,而不是使用overflow
、 overflow-x
或overflow-y
只需將overflow-y:auto
添加到您的 body 標記中即可。 (或overflow-y:scroll
)
table, td { border: 1px solid black; border-collapse: collapse; padding: 5px; text-align: left; }
<body scroll="yes" scrolling="yes" style='overflow-y: auto;'> <table style="width:100%"> <tr> <td width="25%"><label>name </label></td> <td width="75%"><input type="text"></td> </tr> <tr> <td width="25%"><label>last name </label></td> <td width="75%"><input type="text"></td> </tr> <tr> <td width="25%"><label>middle name </label></td> <td width="75%"><input type="text"></td> </tr> <tr> <td width="25%"><label> name </label></td> <td width="75%"><input type="text"></td> </tr> </table>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.