別人的博客文章的代碼塊經常能看到Mac風格,很好看,於是找到了這種方法
效果圖:
實現:
1.打開Vs Code,隨便新建一個.md文件 (markdown文件)
2.在該文件添加以下代碼,右鍵預覽效果即可。
3.mac風格的代碼塊就實現啦
<html>
<style>
.mac {
width:10px;
height:10px;
border-radius:5px;
float:left;
margin:10px 0 0 5px;
}
.b1 {
background:#E0443E;
margin-left: 10px;
}
.b2 { background:#DEA123; }
.b3 { background:#1AAB29; }
.warpper{
background:#121212;
border-radius:5px;
width:400px;
}
</style>
<div class="warpper">
<div class="mac b1"></div>
<div class="mac b2"></div>
<div class="mac b3"></div>
<div>
<br>
</html>
```cpp
#include<iostream>
using namespace std;
int main(){
return 0;
}
原理
就是在代碼塊的前面新增一個模塊樣式,是不是很簡單捏~
var template