我正在尝试创建一个CSS按钮并使用以下内容添加一个图标:after,但图像永远不会出现.如果我用'background-color:red'替换'background'属性,那么会出现一个红色框,所以我不确定这里有什么问题.
HTML:
<a class="button green"> Click me </a>
Run Code Online (Sandbox Code Playgroud)
CSS:
.button {
padding: 15px 50px 15px 15px;
color: #fff;
text-decoration: none;
display: inline-block;
position: relative;
}
.button:after {
content: "";
width: 30px;
height: 30px;
background: url("http://www.gentleface.com/i/free_toolbar_icons_16x16_black.png") no-repeat -30px -50px no-scroll;
background-color: red;
top: 10px;
right: 5px;
position: absolute;
display: inline-block;
}
.green {
background-color: #8ce267;
}
Run Code Online (Sandbox Code Playgroud)
谢谢你的任何提示.
我已经从使用命令API的Chrome文档中加载了此示例扩展.
的manifest.json
{
"name": "Sample Extension Commands extension",
"description": "Press Ctrl+Shift+F (Command+Shift+F on a Mac) to open the browser action popup, press Ctrl+Shift+Y to send an event (Command+Shift+Y on a Mac).",
"version": "1.0",
"manifest_version": 2,
"background": {
"scripts": ["background.js"],
"persistent": false
},
"browser_action": {
"default_popup": "browser_action.html"
},
"commands": {
"toggle-feature": {
"suggested_key": { "default": "Ctrl+Shift+Y" },
"description": "Send a 'toggle-feature' event to the extension"
},
"_execute_browser_action": {
"suggested_key": {
"default": "Ctrl+Shift+F",
"mac": "MacCtrl+Shift+F"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
background.js
chrome.commands.onCommand.addListener(function(command) { …Run Code Online (Sandbox Code Playgroud) 我正在使用clickable修改器Surface并希望创建一个自定义指示,以使表面(及其内容)在按下时显示 0.5 alpha。但似乎该指示只能用于绘制额外的 UI。
Surface按下时如何以 0.5 alpha 重新绘制?
Surface(
modifier = Modifier.clickable(interactionSource = remember { MutableInteractionSource() }, indication = CustomIndication, onClick = onClick)
) {
...
}
Run Code Online (Sandbox Code Playgroud) 我在C中使用SHA1的这种实现.在Windows上工作正常,但它不能在Unix上输出正确的哈希值(在Ubuntu和Mac OS 10.8上尝试过).此外,在Ubuntu上,它从同一个消息输出不同的哈希值.
我想我可以使用其他实现,只是好奇为什么会发生这种情况.
编辑
谢谢,你们是对的.把它改成了
typedef unsigned int UINT4;
Run Code Online (Sandbox Code Playgroud)
似乎工作正常.