2018-09-04画太极

作者: 菲尼克斯丶 | 来源:发表于2018-09-04 21:00 被阅读7次

第一种方法:笨方法 不停画圆即可实现。

HTML部分

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
<div id="YinYang">
  <div class="one"></div>
  <div class="two"></div>
  <div class="three"></div>
  <div class="four"></div>
</div>
</body>
</html>

Css部分

body{
  background-color: #444;
}
#YinYang{
  width:200px;
  height: 200px;
  border: 1px solid black;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(255,255,255,1) 50%, rgba(0,0,0,1) 51%, rgba(0,0,0,1) 100%);
  position: relative;
  margin:100px auto;
}

#YinYang > .one{
   
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: black;
  position: absolute;
  top:50px;
}

#YinYang > .two {
  width:100px;
  height: 100px;
  background: white;
  position: absolute;
  top:50px;
  left:100px;
  border-radius: 50%;
  
}
#YinYang > .three  {
  border: 1px solid black;
  width:25px;
  height:25px;
  background: white;
  position: absolute;
  top:85px;
  border-radius:50%;
  left:35px;
  
}
#YinYang > .four{
  border: 1px solid black;
  width:25px;
  height:25px;
  background: black;
  position: absolute;
  top:85px;
  border-radius:50%;
  left:140px;
  
}

效果图:

太极.png

第二种方法:利用伪类 before 和 after 。

HTML

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>

<div id="YinYang">
 
</div>
</body>
</html>
#YinYang  {
    width: 96px;
    height: 48px;
    background: #eee;
    border-color: red;
    border-style: solid;
    border-width: 2px 2px 50px 2px;
    border-radius: 100%;
    position: relative;
}

#YinYang::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    background: #eee;
    border: 18px solid red;
    border-radius: 100%;
    width: 12px;
    height: 12px;
}

#YinYang::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background: red;
    border: 18px solid #eee;
    border-radius:100%;
    width: 12px;
    height: 12px;
}

相关文章

  • 2018-09-04画太极

    第一种方法:笨方法 不停画圆即可实现。 HTML部分 Css部分 效果图: 第二种方法:利用伪类 before 和...

  • 画太极

    今天,我想来画一下太极。并让它转动。 用画布画出来,这样 我先把代码写出来 并旁边加注释,这样就能看的更明白了 代...

  • 2018-09-04

    2018-09-04 万千工品金秀 2018-09-04 00:21 · 字数 932 · 阅读 0 · 日记本 ...

  • 娱乐 太极图

    plotrix画太极图

  • 2018-09-04

    戴师傅 2018-09-04 2018-09-04 20:32 打开App (稻盛哲学学习会)打卡第126天 姓名...

  • 180904

    2018-09-04 #The Sense of Style The Sense of Style is not ...

  • 太极思维浅析

    太极思维浅析 徐怀清//初稿 (一) 太极 思维之辨别 中华太极文化从伏羲画八卦就标志了太...

  • 灵泉•【太极印】

    灵泉•【太极印】------中华太极文化绽放的一朵奇葩 徐怀清//撰稿 一 太极文化,从伏羲皇始画太极八卦,标志太...

  • 灵泉•太极印

    灵泉•【太极印】------中华太极文化绽放的一朵奇葩 徐怀清//撰稿 一 太极文化,从伏羲皇始画太极八卦,标志太...

  • 现代太极学的重建

    现代太极学的重建 中华太极文化,从伏羲皇始画太极八卦,一脉传承了八千多年而直到今天。太极文化,是中华文化的根脉、文...

网友评论

    本文标题:2018-09-04画太极

    本文链接:https://www.haomeiwen.com/subject/nqbnwftx.html