我正在使用这个 bootstrap one page wonder 模板开发 sinatra 网站。
http://ironsummitmedia.github.io/startbootstrap-one-page-wonder/
我想在每次访问此站点时更改 img。
所以我在 CSS 文件中注释掉了 .header-image。
/*background: url('http://placehold.it/1900x500') no-repeat center center scroll;*/
然后我写在 html 文件中。 在 header 标签内,
<meta http-equiv="Content-Style-Type" content="text/css">
并添加这个。
<header class="header-image" style="background: url('http://placehold.it/1900x500') no-repeat center center scroll;">
但它不会起作用。如何在内联 header 标记中指定背景 img?
最佳答案
将 overflow auto 赋予 body 这是因为 IE 默认将 body 高度设为 100%,广告边距会扩展其高度,因此要更改其默认行为,您可以使用 overflow auto !
body {
margin: 0;
background-color: black;
font-size: 2em;
color: white;
overflow:auto;
}
关于css - 如何指定内联 img <header> 标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26857196/