css border-radius & yin-yang & taiji
css border-radius & yin-yang & taiji

solution
css border-radius & tabs effect
https://codepen.io/xgqfrms/full/ZEbyMyz
See the Pen css border-radius & tabs effect by xgqfrms
(@xgqfrms) on CodePen.
@charset "UTF-8";
*{
box-sizing: border-box;
margin: 0;
padding: 0;
}
.box{
width: 100vw;
height: auto;
min-height: 100px;
display: flex;
flex-wrap: nowrap;
flex-flow: row;
align-items: center;
justify-content: space-between;
border: 1px solid #ccc;
padding: 0;
}
.item {
width: 50%;
height: 100px;
line-height: 100px;
text-align: center;
}
.item-selected{
background: #000;
}
.item-unselected{
background: #fff;
}
.item-left{
border-radius: 0 25px 0 0;
-webkit-border-radius: 0 25px 0 0;
-moz-border-radius: 0 25px 0 0;
-ms-border-radius: 0 25px 0 0;
-o-border-radius: 0 25px 0 0;
position: relative;
}
.item-right{
border-radius: 0 0 0 25px;
-webkit-border-radius: 0 0 0 25px;
-moz-border-radius: 0 0 0 25px;
-ms-border-radius: 0 0 0 25px;
-o-border-radius: 0 0 0 25px;
position: relative;
}
.item-unselected .item-left,
.item-unselected .item-right {
color: #fff;
background: #000;
}
.item-selected .item-left,
.item-selected .item-right {
color: #000;
background: #fff;
}
<section>
<div class="box">
<div class="item item-selected">
<div class="item-left">VIP</div>
</div>
<div class="item item-unselected">
<div class="item-right">Others</div>
</div>
</div>
</section>
"use strict";
/**
*
* @author xgqfrms
* @license MIT
* @copyright xgqfrms
* @created 2020-04-28
* @modified
*
* @description css border-radius
* @augments
* @example
* @link
*
*/
const log = console.log;
const items = [...document.querySelectorAll(`.item`)];
const updateSelected = (items, selectedItem) => {
items.forEach(item => {
item.classList.remove(`item-selected`);
item.classList.add(`item-unselected`)
});
selectedItem.classList.remove(`item-unselected`);
selectedItem.classList.add(`item-selected`)
}
for (const item of items) {
const flag = item.dataset.flag || false;
if(!flag) {
item.dataset.flag = true;
item.addEventListener(`click`, (e) => {
const className = e.target.getAttribute(`class`);
switch (className) {
case `item-left`:
case `item-right`:
updateSelected(items, e.target.parentElement);
break;
default:
break;
}
});
}
}
refs
https://www.w3schools.com/css/css3_borders.asp
https://css-tricks.com/almanac/properties/b/border-radius/
css yin-yang
https://codepen.io/xgqfrms/pen/VwvWdzV

https://coursesweb.net/css/yin-yang-css_cs
https://blog.logrocket.com/how-to-create-yin-yang-symbol-pure-css/
https://css-tricks.com/creating-yin-yang-loaders-web/

See the Pen animated illustration: how to ☯ out of 3 components by xgqfrms
(@xgqfrms) on CodePen.
https://gist.github.com/felipecabargas/6574545
css border-radius & yin-yang & taiji的更多相关文章
- CSS border三角、圆角图形生成技术简介
http://www.zhangxinxu.com/wordpress/?p=794 一.前言 利用CSS的border属性可以生成一些图形,例如三角或是圆角.纯粹的CSS2的内容,没有兼容性的问题, ...
- CSS border边框属性教程(color style)
CSS 边框即CSS border-border边框样式颜色.边框样式.边框宽度的语法结构与应用案例教程篇 一.CSS 边框基础知识 CSS 边框即CSS border是控制对象的边框边线宽度.颜色. ...
- css border
CSS border用于设置HTML元素(如div)的边框,包括边框的宽度.颜色和样式.本文章向码农介绍CSS border边框属性详细内容,感兴趣的码农可以参考一下. CSS 边框即CSS bord ...
- CSS Border(边框)
CSS Border(边框) 一.CSS 边框属性 CSS边框属性允许你指定一个元素边框的样式和颜色. 示例效果: 二.边框样式 边框样式属性指定要显示什么样的边界. border-style属性用来 ...
- CSS border gradient color All In One
CSS border gradient color All In One CSS Gradient Borders border-image-source & border-image-sli ...
- [CSS]border边框
border: 1px solid #ccc; /*1像素 实线 灰色*/可分割成:border-width:1px;border-style: solid; border-color: #00 ...
- css border制作小三角形状及气泡框(兼容IE6)
先看下CSS盒模型 一个盒子包括: margin+border+padding+content 上下左右边框交界处出呈现平滑的斜线. 利用这个特点, 通过设置不同的上下左右边框宽度或者颜色可以得到小三 ...
- CSS border系列
本文更新版链接 一.border 关于border的3个属性,分别为border-width.border-style.border-color. 其中,border-color默认为元素内容的前景色 ...
- CSS border 属性和 border-collapse 属性
border 简写属性在一个声明设置所有的边框属性. 可以按顺序设置如下属性: border-width border-style border-color 如果不设置其中的某个值,也不会出问题,比如 ...
- CSS border 生成三角
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xht ...
随机推荐
- How Load Balancing Policies Work
How Load Balancing Policies Work https://docs.cloud.oracle.com/en-us/iaas/Content/Balance/Reference/ ...
- get uuid
https://wx2.qq.com/?&lang=zh_CN /** * 启动二维码登录 */ function doQrcodeLogin() { loginFactory.getUUID ...
- Sapphire: Copying GC Without Stopping the World
https://people.cs.umass.edu/~moss/papers/jgrande-2001-sapphire.pdf Many concurrent garbage collectio ...
- py, pyc, pyw, pyo, pyd Compiled Python File (.pyc) 和Java或.NET相比,Python的Virtual Machine距离真实机器的距离更远
https://my.oschina.net/renwofei423/blog/17404 1. PyCodeObject与Pyc文件 通常认为,Python是一种解释性的语言,但是这种说法 ...
- JavaScript常用工具方法
JavaScript常用工具方法 1.日期格式化 2.将日期字符串转换为Date,字符串格式为(yyyy-mm-dd hh:mm:ss) 3.JS获取当天00:00:00时间和23:59:59的时间 ...
- 3.centos 7执行service iptables save报错问题
1.报错 [root@localhost ~]# service iptables save The service command supports only basic LSB actions ( ...
- UML——关系
一.宏观导图: 二.细节 1.关联:指的是类与类之间的结构性关系,即整体-部分关系.一般的关联关系中有单向的和双向的. 特殊关联中的,有聚合和组合,其实我更愿意用英文去理解,这些人翻译的让我很恶 ...
- linux学习之---在linux服务器上跑一段Java代码
经常在windows上进行开发,有时候,需要在Linux环境上跑一些程序测下代码,要怎么办才好嘞? 假设你对Java常用命令和linux常用命令已经基本熟悉,就可以直接按照以下步骤来啦,默认linux ...
- D - LOL UVALive - 8521 (状压dp)
https://nanti.jisuanke.com/t/A1616 思路:dp[i][j]表示前i列里面选了情况j有多少种组合方案 #include<bits/stdc++.h> usi ...
- Codeforces Round #652 (Div. 2) E. DeadLee(贪心)
题目链接:https://codeforces.com/contest/1369/problem/E 题意 Lee 有 $n$ 种不同种类的食物和 $m$ 个朋友,每种食物有 $w_i$ 个,每个朋友 ...