html - 这段CSS代码的解释

标签 html css

我需要知道这段代码到底做了什么......或者如何使用它......实际上我用它来重复图像作为菜单的背景......需要解释......

url("images/home_bg.jpg") repeat-x scroll 0 0 transparent

最佳答案

它是 background CSS 属性的简写。正是由于这个原因,速记不是一个好主意:很难弄清楚什么是什么。

长版是这样的:

background-image: url("images/home_bg.jpg");
background-repeat: repeat-x;                  /* Repeat image horizontally */
background-attachment: scroll;                /* Whether image is fixed 
                                                 or scrolls with page */
background-position: 0 0;                     /* x position, y position */
background-color: transparent;

Docs on the background properties

关于html - 这段CSS代码的解释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2793541/

相关文章:

android - 哪个卷轴最适合安卓 : PhoneGap

php - HTML 电子邮件模板在邮件中丢失颜色

javascript - 我可以使用 iframe 来解决内存泄漏吗?

html - 如何删除内联/内联 block 元素之间的空间?

html - 背景图像不显示

php - 在 HTML 表格中每 n 个单元格创建一个新行

html - Outlook 显示矩形而不是 li 元素符号列表

html - 很棒的字体没有加载到我的 apache 中

html - Web Speech API - iOS 中的语音识别

javascript - 缩放时设置元素的重力?