Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
CSS3-一对一分割、边界、三角形_Css_Border_Gradient - Fatal编程技术网

CSS3-一对一分割、边界、三角形

CSS3-一对一分割、边界、三角形,css,border,gradient,Css,Border,Gradient,我在尝试这样做时遇到了麻烦: 我设法做到了这样: display: table-cell; vertical-align: middle; background: rgb(245,245,245); /* Old browsers */ background: -moz-linear-gradient(top, rgba(245,245,245,1) 0%, rgba(230,230,230,1) 100%); /* FF3.6+ */ background: -webkit-gradien

我在尝试这样做时遇到了麻烦:

我设法做到了这样:

display: table-cell;
vertical-align: middle;

background: rgb(245,245,245); /* Old browsers */
background: -moz-linear-gradient(top, rgba(245,245,245,1) 0%, rgba(230,230,230,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(245,245,245,1)), color-stop(100%,rgba(230,230,230,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(245,245,245,1) 0%,rgba(230,230,230,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(245,245,245,1) 0%,rgba(230,230,230,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(245,245,245,1) 0%,rgba(230,230,230,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(245,245,245,1) 0%,rgba(230,230,230,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#e6e6e6',GradientType=0 ); /* IE6-9 */
对于文本的主容器,以及:

width: 0;
height: 0;
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 40px solid #FEEDDD;
display: inline-block;
做三角形。然后我会把数字放在圆圈内的绝对位置

但我想不出三角形的“边界”是如何像其他div一样渐变的,也不能给它一个白色的外边界


谢谢你

虽然您可能能够做到这一点,但仍然可以在各种浏览器之间保持良好的回退,并取得成功。。。我希望你在尝试的时候能拔出一大块头发。我的建议是在Photoshop中制作一些背景图像,并将这些项目分成三个不同的元素

  • 透明白色圆圈的元素,可包含 台阶#

  • 具有类的元素,用于应用橙色渐变背景的已完成步骤

  • 另一个元素具有单独的灰色渐变类

  • 这样做可以使所有元素保持“方形”,而不必担心三角形或圆形元素的支持。只需将文本覆盖在适当的位置


    我知道这可能不是你所要求的css3方式来完成一切,但我相信这样做可以让你保持简单和精益,这绝对是可能的

    不久前,我创建了一个带有渐变箭头的后退按钮。看见 所以只要改变方向,颜色,调整大小到你想要的,但是我想你已经有了主意

    HTML:

    <button>Rejoignez le groupe</button>
    


    如果太混乱,需要一些指导来更改方向、大小和颜色,请告诉我。

    尝试此链接,您可能需要使用一些:before和:after伪类来完成您想要的内容非常好的网站,谢谢,但是从我所看到的,它使用了我在其他地方看到的相同技术,所以我想这将很难实现我想要做的(或者只是我没有足够的技能来管理它…)我更新了css、html和fiddle,使它们具有正确的方向,并且文本就是你在截图中看到的文本我在我这边做的(我喜欢理解事物:))并最终得出结论:太棒了!我会将白色圆圈设置为绝对值,以便它显示需要显示的位置。我不明白的是,你怎么能用这个来得到我需要的结果:第一次除法完成了,但是你怎么能在他的邻居身上设置它,这样他的灰色就会在三角形上下出现?看起来不错,做得很好!要处理邻居的问题,最简单的方法是对css进行小的更改,即使用为邻居留下的空白,div将位于彼此的顶部。z索引可以将它们设置为正确的顺序。这样地:
    button {
      position: relative;
      display: inline-block;
      border: 1px solid #555555;
      margin: 0;
      font-size: 12px;
      color: inherit;
      cursor: pointer;
      height: 30px;
      padding: 0 10px;
      margin-right: 10px;
      font-weight: bold;
      -webkit-box-sizing: border-box;
      -moz-box-sizing: border-box;
      box-sizing: border-box;
      background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #eeeeee), color-stop(100%, #888888));
      background: -webkit-linear-gradient(top, #eeeeee, #888888);
      background: -moz-linear-gradient(top, #eeeeee, #888888);
      background: -o-linear-gradient(top, #eeeeee, #888888);
      background: linear-gradient(top, #eeeeee, #888888);
      -webkit-border-radius: 4px;
      -moz-border-radius: 4px;
      -ms-border-radius: 4px;
      -o-border-radius: 4px;
      border-radius: 4px;
      text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
      -webkit-box-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
      -moz-box-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
      box-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
    }
    
    button:after {
      clip: rect(14px, 14px, 28px, 1px);
      -webkit-transform: skewX(-35deg);
      -moz-transform: skewX(-35deg);
      -ms-transform: skewX(-35deg);
      -o-transform: skewX(-35deg);
      transform: skewX(-35deg);
      content: "";
      top: 0;
      position: absolute;
      height: 100%;
      width: 8%;
      right: -10px;
      border-right: inherit;
      background: inherit;
      -webkit-box-shadow: inherit;
      -moz-box-shadow: inherit;
      box-shadow: inherit;
    }
    
    button:before{
      clip: rect(1px, 14px, 14px, 1px);
      background: red;
      -webkit-transform: skewX(35deg);
      -moz-transform: skewX(35deg);
      -ms-transform: skewX(35deg);
      -o-transform: skewX(35deg);
      transform: skewX(35deg);
      content: "";
      top: 0;
      position: absolute;
      height: 100%;
      width: 8%;
      right: -10px;
      border-right: inherit;
      background: inherit;
      -webkit-box-shadow: inherit;
      -moz-box-shadow: inherit;
      box-shadow: inherit;
    }