【发布时间】:2018-06-05 16:00:16
【问题描述】:
我正在使用 Ionic 3,并为此添加了一些 css 代码
示例 -
有人点击图片后需要更改填充颜色 .但它不适合我。谁能帮助我如何正确地做到这一点?
谢谢
css
clap {
/*========================
styles
=======================*/
.clap {
position: relative;
outline: 1px solid transparent;
border-radius: 0;
border: 0px solid #a750a9;
top:-0.2rem;
height: 0px; margin: 0px auto; margin-left: 2.3rem;
background: none; cursor: pointer;animation: pulse 2s infinite;
}
.clap:after {
content: "";
position: absolute;
top: 0;
left: 0;
display: block;
border-radius: 50%;
width: 44px;
height: 44px;
}
.clap:hover {
cursor: pointer;
border: 0px solid #a750a9;
transition: border-color 0.3s ease-in;
}
.clap:hover:after {
animation: shockwave 1s ease-in infinite;
}
.clap img {
width: 20px;
fill: none;
stroke: #a750a9;
stroke-width: 2px; margin-top: -1.5rem;
}
.clap img.checked {
fill: #a750a9;
stroke: #a750a9;
stroke-width: 1px;
}
}
html
<img [class.checked]="clapIconChecked" src="assets/imgs/clap.png">
.ts
export class ClapComponent {
clapIconChecked = false;
this.clapIconChecked = true;
}
}
【问题讨论】:
标签: css ionic-framework ionic3