# About the style of the checkbox

**URL:** <https://discourse.joplinapp.org/t/about-the-style-of-the-checkbox/8359>\
**Category:** Support\
**Created:** [2 May 2020 12:43 UTC](https://discourse.joplinapp.org/t/about-the-style-of-the-checkbox/8359 "2020-05-02T12:43:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![4SM](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/4sm/32/2805_2.png) [@4SM](https://discourse.joplinapp.org/u/4SM)\
**Post date:** [2 May 2020 12:43 UTC](https://discourse.joplinapp.org/t/about-the-style-of-the-checkbox/8359/1 "2020-05-02T12:43:14Z")

</div>

Hello, everyone.  
How to edit in userstyle.css to achieve the effect as an image?

![](https://i.imgur.com/d3TyYaV.png)

---

<div class="post-metadata">

**Author:** ![ylc395](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/ylc395/32/11357_2.png) [@ylc395](https://discourse.joplinapp.org/u/ylc395)\
**Post date:** [3 May 2020 05:21 UTC](https://discourse.joplinapp.org/t/about-the-style-of-the-checkbox/8359/2 "2020-05-03T05:21:16Z")

</div>

你是想说如何写CSS才能让checkbox获得图中所示样式？  
Did you mean that how to write CSS to make checkboxes look like what the image shows?

```
/* Base for label styling */
li.md-checkbox [type="checkbox"]:not(:checked),
li.md-checkbox [type="checkbox"]:checked {
    position: absolute;
    left: -9999px;
}

li.md-checkbox [type="checkbox"]:not(:checked) + label,
li.md-checkbox [type="checkbox"]:checked + label {
    position: relative;
    padding-left: 1.5em;
    cursor: pointer;
}

/* checkbox aspect */
li.md-checkbox [type="checkbox"]:not(:checked) + label:before,
li.md-checkbox [type="checkbox"]:checked + label:before {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 1em; height: 1em;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 1px;
}

/* checked mark aspect */
li.md-checkbox [type="checkbox"]:not(:checked) + label:after,
li.md-checkbox [type="checkbox"]:checked + label:after {
    content: '\2713\0020';
    position: absolute;
    top: .3em; left: .3em;
    font-size: .9em;
    line-height: 0.8;
    transition: all .2s;
    font-family: 'Lucida Sans Unicode', 'Arial Unicode MS', Arial;
}

/* checked mark aspect changes */
li.md-checkbox [type="checkbox"]:not(:checked) + label:after {
    opacity: 0;
    transform: scale(0);
}

li.md-checkbox [type="checkbox"]:checked + label:after {
    opacity: 1;
    transform: scale(1);
}
```

---

<div class="post-metadata">

**Author:** ![4SM](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/4sm/32/2805_2.png) [@4SM](https://discourse.joplinapp.org/u/4SM)\
**Post date:** [3 May 2020 05:40 UTC](https://discourse.joplinapp.org/t/about-the-style-of-the-checkbox/8359/3 "2020-05-03T05:40:21Z")

</div>

不行。我其实是想要模仿 Evernote 的复选框样式 ：(  
 ![](https://i.imgur.com/ytTtCaR.png)

---

<div class="post-metadata">

**Author:** ![ylc395](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/ylc395/32/11357_2.png) [@ylc395](https://discourse.joplinapp.org/u/ylc395)\
**Post date:** [3 May 2020 05:58 UTC](https://discourse.joplinapp.org/t/about-the-style-of-the-checkbox/8359/4 "2020-05-03T05:58:31Z")

</div>

你改对CSS文件了么？应该改这个：

 ![图片](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/2X/5/50e87c6d780d213c2d48fdb328f8a5dddeebc1d9.png)  
生效后的样子是：  
 ![图片](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/2X/4/472454c0a0bd3d4924682e990e95f38344ed9391.png)

---

<div class="post-metadata">

**Author:** ![4SM](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/4sm/32/2805_2.png) [@4SM](https://discourse.joplinapp.org/u/4SM)\
**Post date:** [3 May 2020 06:35 UTC](https://discourse.joplinapp.org/t/about-the-style-of-the-checkbox/8359/5 "2020-05-03T06:35:31Z")

</div>

还是不行。这是我的全部css内容。

```
 /* For styling the rendered Markdown */

body{
  font-family:"Noto Sans CJK SC";
  font-size: 16px;
  color: #000000;
  line-height: 1.45
}

mark {
  background: #fff9a6 !important;
  padding: 1px 3px;
}

a .resource-icon {
  display: none;
}
a[href='#'] {
  color: #69a932;
}
a{
  color: #0014ed;
}

p {
    font-size: 16px;
}

body, th, td, .inline-code {
    font-size: 16px;
}

hr {
  border: 1px solid #999999;
}

h1, h2, h3, h4, h5, h6 {
  margin: 10px 0 10px;
  padding: 0;
  font-weight: bold;
  -webkit-font-smoothing: antialiased;
  cursor: text;
  position: relative; }

h1 {
	font-size: 28px !important;
	color: black;
	border-bottom: none	
}

h2 {
  font-size: 24px !important;
  color: black;
}

h3 {
  font-size: 18px;
}

h4 {
  font-size: 16px;
}

h5 {
  font-size: 14px; }

h6 {
  color: #777777;
  font-size: 14px; }

.inline-code {
    border: 1px solid #3b3b3b;
	border-radius: 2px;
    background-color: #e8e8e8;
    padding: 0;
    padding: 4px 4px 4px 4px;
	color: #000000;
    font-size: 1em;
}
.hljs {
    border: 1px solid #3b3b3b;
	border-radius: 2px;
    background-color: #e8e8e8;
    padding: 0;
    padding: 2px 4px 0px 4px;
    font-size: 1em;
}
.hljs-keyword, .hljs-symbol, .hljs-number, .hljs-built_in, .hljs-string {
    color: #000000;
}

code {
    font-family: Noto Sans CJK SC;
    background-color: #e8e8e8;
    color: #000000;
    padding: 0 2px 0 2px;
}

pre {
    overflow: auto;
    white-space: pre;
    white-space: pre-wrap;
    word-wrap: break-word;
}

blockquote {
  border-left: 11px solid #3b3b3b;
  background-color: #e8e8e8;
  color: #000000; 
  padding: 0.5em 15px;
  margin: 15px 0; 
  opacity: 1;
 }
  blockquote > :first-child {
    margin-top: 0; }
  blockquote > :last-child {
    margin-bottom: 0; }

/* Base for label styling */
li.md-checkbox [type="checkbox"]:not(:checked),
li.md-checkbox [type="checkbox"]:checked {
    position: absolute;
    left: -9999px;
}

li.md-checkbox [type="checkbox"]:not(:checked) + label,
li.md-checkbox [type="checkbox"]:checked + label {
    position: relative;
    padding-left: 1.5em;
    cursor: pointer;
}

/* checkbox aspect */
li.md-checkbox [type="checkbox"]:not(:checked) + label:before,
li.md-checkbox [type="checkbox"]:checked + label:before {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 1em; height: 1em;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 1px;
}

/* checked mark aspect */
li.md-checkbox [type="checkbox"]:not(:checked) + label:after,
li.md-checkbox [type="checkbox"]:checked + label:after {
    content: '\2713\0020';
    position: absolute;
    top: .3em; left: .3em;
    font-size: .9em;
    line-height: 0.8;
    transition: all .2s;
    font-family: 'Lucida Sans Unicode', 'Arial Unicode MS', Arial;
}

/* checked mark aspect changes */
li.md-checkbox [type="checkbox"]:not(:checked) + label:after {
    opacity: 0;
    transform: scale(0);
}

li.md-checkbox [type="checkbox"]:checked + label:after {
    opacity: 1;
    transform: scale(1);
}

```

---

<div class="post-metadata">

**Author:** ![ylc395](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/ylc395/32/11357_2.png) [@ylc395](https://discourse.joplinapp.org/u/ylc395)\
**Post date:** [3 May 2020 08:15 UTC](https://discourse.joplinapp.org/t/about-the-style-of-the-checkbox/8359/6 "2020-05-03T08:15:32Z")

</div>

我把CSS换成你的之后也可以生效。可能是版本问题？我的是最新版

Joplin 1.0.201 (prod, win32)

Client ID: 97bf3e8d9de64968b1b1965cbeafc9a3  
Sync Version: 1  
Profile Version: 28

Revision: e65af8c1 (master)

---

<div class="post-metadata">

**Author:** ![4SM](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/4sm/32/2805_2.png) [@4SM](https://discourse.joplinapp.org/u/4SM)\
**Post date:** [3 May 2020 12:19 UTC](https://discourse.joplinapp.org/t/about-the-style-of-the-checkbox/8359/7 "2020-05-03T12:19:24Z")

</div>

我的也是这个版本。是便携版。不会是这个原因？：(  
 ![](https://i.imgur.com/FV73HD2.png)
