在html中,scrolling的中文意思為“滾動”;它是iframe標簽的一個屬性,用于規(guī)定是否在iframe中顯示滾動條,語法格式“<iframe scrolling="值">”,可設置的屬性值有auto、yes、no。
本教程操作環(huán)境:windows7系統(tǒng)、HTML5版、Dell G3電腦。
HTML <iframe> 標簽的 scrolling 屬性
scrolling 屬性規(guī)定是否在 iframe 中顯示滾動條。默認地,如果內容超出了 iframe,滾動條就會出現在 iframe 中。
語法格式:
<iframe scrolling="value">
屬性值 | 描述 |
---|---|
auto | 在需要的情況下出現滾動條(默認值)。 |
yes | 始終顯示滾動條(即使不需要)。 |
no | 從不顯示滾動條(即使需要)。 |
示例:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <p>顯示滾動條的 iframe:</p> <iframe src="https://www.php.cn" width="200" height="200" scrolling="yes"> <p>您的瀏覽器不支持 iframe 標簽。</p> </iframe> <p>沒有滾動條的 iframe :</p> <iframe src="https://www.php.cn" width="200" height="200" scrolling="no"> <p>您的瀏覽器不支持 iframe 標簽。</p> </iframe> </body> </html>
推薦教程:《html視頻教程》