是否可以在不影响子元素不透明度的情况下设置背景图像的不透明度?
页脚中的所有链接都需要一个自定义项目符号(背景图像),自定义项目符号的不透明度应为50%.
<div id="footer">
<ul>
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
<li><a href="#">Link 3</a></li>
<li><a href="#">Link 4</a></li>
<li><a href="#">Link 5</a></li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
#footer ul li {
background: url(/images/arrow.png) no-repeat 0 50%;
}
Run Code Online (Sandbox Code Playgroud)
我尝试将列表项的不透明度设置为50%,但是链接文本的不透明度也是50% - 并且似乎没有办法重置子元素的不透明度:
#footer ul li {
background: url(/images/arrow.png) no-repeat 0 50%;
/* will also set the opacity of the link text */
opacity: 0.5;
}
Run Code Online (Sandbox Code Playgroud)
我也尝试过使用rgba,但这对背景图片没有任何影响:
#footer ul li {
/* rgba doesn't apply to the background image */
background: rgba(255, 255, 255, …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用git的新(作为git 1.7.11)目录diff命令与Beyond Compare 3作为difftool,但是没有创建临时文件.
例如:
git difftool --dir-diff <branch1> <branch2>
Beyond Compare打开与正确目录和列出的已更改文件的目录比较.
但是,当我点击任何文件时,我收到以下错误:
Unable to load C:\Users\<username>\AppData\Local\Temp\git-difftool.yG8V5\left\<path to some file>: The system cannot find the path specified
所以,我检查一下C:\Users\<username>\AppData\Local\Temp\git-difftool.yG8V5目录是否存在而不是.
超越比较3作为非目录差异和合并的difftool工作正常.
我正在使用git for Windows(msysgit)1.8.0.
以下是相关的.gitconfig设置:
# External Visual Diff/Merge Tool
[diff]
tool = bc3
[difftool "bc3"]
path = "C:/Program Files (x86)/Beyond Compare 3/BComp.exe"
[merge]
tool = bc3
[mergetool "bc3"]
keepTemporaries = false
trustExitCode = true
keepBackup = false
path = "C:/Program Files (x86)/Beyond Compare 3/BComp.exe"
Run Code Online (Sandbox Code Playgroud) 我刚刚在Windows 7上使用Ruby 1.9.2安装了Compass 0.11.5.
我的开发环境设置为对所有文件使用Unix行结尾.
我创建了一个初始的sass-test项目,并注意到它创建的所有文件都有Windows行结尾.我将现有的.css文件从另一个项目(带有unix行结尾)移动到sass文件夹中,并将扩展名更改为.scss.我运行'compass compile'命令为这个新文件生成.css文件,它创建的.css文件有Windows行结尾.
我在Compass文档中找不到任何配置选项来强制Compass生成带有Unix行结尾的文件.
是否可以将Compass配置为在Windows上生成带有Unix行结尾的文件?
经过进一步调查后,可以选择将配置选项从Compass传递给Sass.
Property Name Type Description
sass_options Hash These options are passed directly to the Sass compiler. For more details on the format of sass options, please read the sass options documentation.
Run Code Online (Sandbox Code Playgroud)
Sass有一个生成unix行结尾的选项:
:unix_newlines
如果为true,则在编写文件时使用Unix样式的换行符.只有在Windows上有意义,并且只有当Sass正在编写文件时(在Rack,Rails或Merb中,直接使用Sass :: Plugin时,或者在使用命令行可执行文件时).
似乎将以下行添加到sass-test项目的config.rb文件应该可以解决问题:
sass_options = {:unix_newlines => true}
Run Code Online (Sandbox Code Playgroud)
但是,它对创建的.css文件没有任何影响 - 它们仍然具有Windows行结尾.
我有一个使用Git的项目,我已经从master分支到重命名目录.
分支中的重命名按预期工作.当我切换回主分支时,目录有其原始名称,但是还有一个空的目录树,其名称在分支中将其更改为.
这是预期的行为吗?我错过了一步吗?
我只需要删除这些空目录树吗?
我知道Git不跟踪空目录,这可能是一个因素.
我目前的工作流程是:
# create and checkout a branch from master
/projects/demo (master)
$ git checkout -b rename_dir
# update paths in any affected files
# perform the rename
/projects/demo (rename_dir)
$ git mv old_dir new_dir
# add the modified files
/projects/demo (rename_dir)
$ git add -u
# commit the changes
/projects/demo (rename_dir)
$ git commit -m 'Rename old_dir to new_dir'
Run Code Online (Sandbox Code Playgroud)
我达到了这一点,一切都如预期:
# old_dir has been renamed new_dir
/projects/demo (rename_dir)
$ ls
new_dir
Run Code Online (Sandbox Code Playgroud)
当我切换回master时出现问题:
/projects/demo (rename_dir)
$ …Run Code Online (Sandbox Code Playgroud) 我在一个分支中有多个提交.当我推送这些提交以进行代码审查时,我们的代码审查工具会为每个提交创建一个审核.
为了避免这种情况,我想将多个提交合并到一个提交中.与此同时,我不想失去承诺的历史.是否可以仅为审查创建新分支,并将我的主分支中的所有提交合并到我的审核分支中的单个提交中?我该怎么做呢?
git ×3
branch ×1
compass-sass ×1
css ×1
css3 ×1
directory ×1
git-branch ×1
git-commit ×1
line-endings ×1
msysgit ×1
newline ×1
opacity ×1
rename ×1
sass ×1
windows ×1