下雨咯
下雨咯
  • 发布:2018-01-23 14:41
  • 更新:2018-01-24 10:17
  • 阅读:1453

CSS样式问题

分类:MUI
复制代码style="border: 2px solid white; border-radius: 50%;"


请问:圆边框目前是白色, 怎么把下半园的圆边框做成绿色,上半圆保持


白色。。。

2018-01-23 14:41 1 条评论 负责人:无 分享
已邀请:
1***@qq.com

1***@qq.com - 碧蓝天空自由飞

<template>
<div class="bluetooth-test-button-layout" @click="testBluetooth">
<div class="test">
<div class="centertest"></div>
</div>
<p>点击监测蓝牙</p>
</div>
</template>

<style>
.test{
width: 200px;
height:200px;
/ border-radius: 100px;
border-color: transparent;
background: yellow;
/
position: absolute;
left: 0px;
top:100px;
}
.test:before{
content:'';
position: absolute;
left:0px;
top:0px;
width:200px;
height:100px;
background: blue;
border-top-left-radius: 100px;
border-top-right-radius: 100px;
}
.test:after{
content:'';
position: absolute;
left:0px;
top:100px;
width:200px;
height:100px;
background: red;
border-bottom-left-radius: 100px;
border-bottom-right-radius: 100px;
}

.centertest{
width: 98%;
height: 98%;
position: absolute;
z-index: 100;
background: yellow;
border-radius: 100%;
left: 1%;
top:1%;
}

1***@qq.com

1***@qq.com - 天下风云出我辈

.circle{
width:200px;
height:200px;
border-style:solid;
border-width:10px;
border-radius:50%;
border-color:#f00 #f00 #f0f #f0f;
transform: rotate(-45deg);

复制代码        }  
        .portrait{  
            width:200px;  
            height:200px;  
            background-image: url(http://g.hiphotos.baidu.com/image/pic/item/c8ea15ce36d3d539f09733493187e950342ab095.jpg);  
            background-size:contain;  
            background-position: center;  
            background-repeat: no-repeat;  
            border-radius:50%;  
            transform: rotate(45deg);  
        }  

以下为html内容
<div class="circle">
<div class="portrait"></div>
</div>

1***@qq.com

1***@qq.com - 碧蓝天空自由飞

width: 200px;
height:200px;
border-radius: 100px;
border-left: 1px solid green;
border-right: 1px solid green;
border-top: 1px solid red;
border-bottom : 1px solid red;

1***@qq.com

1***@qq.com - 碧蓝天空自由飞

上下左右自己调一下就行了,我这个测试的好像上下一个颜色,左右一个颜色

  • 下雨咯 (作者)

    ....哈哈哈你确定?调一下就行了?

    2018-01-23 15:02

  • 1***@qq.com

    看下面的那个方法,上面的那个应该不符合你的要求

    2018-01-23 15:05

1***@qq.com

1***@qq.com - 碧蓝天空自由飞

上面的好像也不行,不过你可以通过before 与 after 实现before做上面的一半 after做下面的一半
css:
.example:before{
content:'';
....
}

.example:after{
...
}

.example就是你框子的样式名称

王者地带

王者地带 - 5+混合APP开发教程网 | http://www.html5-app.com | 咨询QQ: 2564034335

复制代码//可以实现的方式挺多的  

<!doctype html>  
<html>  

    <head>  
        <meta charset="UTF-8">  
        <title></title>  
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />  
        <link href="css/mui.min.css" rel="stylesheet" />  
        <style>  

            .avatar  
            {  
           position: relative;   
           width:200px;   
           height: 200px;  
           margin: 50px;      
            }  
            .avatar img  
             {  
                width:200px;   
                height: 200px;  
                border-radius:200px;   
                padding:6px;   
                position: absolute;  
                z-index:1;  
             }  
            .avatar:after,.avatar:before  
            {  
            content:"";   
            position: absolute;  
            top: 0;  
            width:200px;  
            height:100px;   
            background-color: white;  
            border-radius:50%/100% 100%  0 0;  
             }  
            .avatar:before   
            {  
            top:auto;  
            bottom:0;  
            background-color:green;  
            transform:rotate(180deg);  
            -webkit-transform:rotate(180deg);  
            }  
        </style>  
    </head>  

    <body>  

    <div class="avatar">  
     <img src="img/avatar.jpg"/>  
     </div>  

    </body>  

</html>  
寒寒

寒寒

设置边框颜色

该问题目前已经被锁定, 无法添加新回复

  • 标题 / 粗斜体
  • 代码片段
  • 超链接 / 图片 / 视频
  • 列表 / 引用

文章内容较多时,可以用标题分段 :

## 大标题 
### 小标题

斜体 / 粗体 :

**粗体** 
*斜体*
***粗斜体***

代码片段 :

``` javascript
代码片段
```

超链接 :

[链接文字](链接地址) 例: [百度](http://www.baidu.com)

图片 :

![图片说明](图片地址) 例: ![百度logo](http://www.baidu.com/img/bdlogo.gif)

视频 :

!![视频说明](视频地址) 例: !![优酷视频](http://youku.com)

有序列表 :

1. 123
2. 123
3. 123

无序列表 :

- 123
- 123
- 123

引用 : ( 双回车后结束引用 )

> 引用内容
引用内容
引用内容