📜  css 背景图片大小适合屏幕 - CSS 代码示例

📅  最后修改于: 2022-03-11 14:47:27.976000             🧑  作者: Mango

代码示例3
html {
    height: 100%;
}
body {
    color: #999;
    background: url('../images/background/main_bg.jpg') no-repeat center center fixed;
    font-family: 'Roboto', sans-serif;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}