【问题标题】:How to create one side circular effect [duplicate]如何创建一侧圆形效果[重复]
【发布时间】:2013-09-20 08:18:23
【问题描述】:

您好所有开发人员和网页设计师,我想使用 twitter bootstrap 创建一个单侧圆形效果,例如 this picture。左侧有一条圆形曲线,右侧有矩形直线,但是矩形对其左侧有影响,您可以在图片中看到,我怎样才能创建这样的东西? 谢谢。

【问题讨论】:

  • 这与引导程序有什么关系?
  • @Mostafa Safarian 图像无法在此处显示。请重新更新图片
  • 在 SO 上有一个类似的问题。有一些解决方案:stackoverflow.com/questions/10501488/…
  • 谢谢keaukraine!这就是我想要的。

标签: html css


【解决方案1】:

这样

demo

css

.circle {
  width: 300px;
  height: 300px;
  border-radius: 150px;
  -webkit-border-radius: 150px;
  -moz-border-radius: 150px;
  background-color:blue;
}

多点赞links

【讨论】:

    【解决方案2】:

    试试这个圆形图像。

    HTML:

    <div class="circular"></div>
    

    CSS:

    .circular {
      width: 300px;
      height: 300px;
      border-radius: 150px;
      -webkit-border-radius: 150px;
      -moz-border-radius: 150px;
      background: url(http://link-to-your/image.jpg) no-repeat;
    }
    

    或者

    HTML:

    <div class="circular"><img src="http://link-to-your/image.jpg" alt="" /></div>
    

    CSS:

    .circular {
        width: 300px;
        height: 300px;
        border-radius: 150px;
        -webkit-border-radius: 150px;
        -moz-border-radius: 150px;
        background: url(http://link-to-your/image.jpg) no-repeat;
    }
    
    .circular img {
        opacity: 0;
        filter: alpha(opacity=0);
    }
    

    Demo

    【讨论】:

    【解决方案3】:

    看看this demo

    CSS

    body {
        background-color: #555;
    }
    #outer {
        margin: 100px auto;
        background-color: black;
        border-radius: 10px;
        width: 600px;
        height: 200px;
        text-align: center;
        color: white;
        font-size: 25px;
        line-height: 200px;
    }
    
    #inner {
        width: 200px; height: 200px;
        position: relative;
        background: url(http://i.imgur.com/fqct5Us.gif) center;
        border-radius: 1000px;
        overflow: hidden;
        border: 10px solid black;
        float: left;
        -webkit-transform: scale(1.4);
           -moz-transform: scale(1.4);
            -ms-transform: scale(1.4);
             -o-transform: scale(1.4);
                transform: scale(1.4);
    }
    
    #inner:before {
        content: '';
        position: absolute;
        height: 200px; width: 50px;
        left: 30px; bottom: -110px;
        display: inline-block;
        background-color: black;
        -webkit-transform: rotate(-45deg);
           -moz-transform: rotate(-45deg);
            -ms-transform: rotate(-45deg);
             -o-transform: rotate(-45deg);
                transform: rotate(-45deg);
    }
    

    HTML

    <div id="outer">
            I am lorem. &larr; Huh?
        <div id="inner">
        </div>
    </div>
    

    【讨论】:

      猜你喜欢
      • 2015-02-28
      • 1970-01-01
      • 2015-08-23
      • 1970-01-01
      • 2021-04-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-28
      相关资源
      最近更新 更多