创建复杂的CSS形状(说话气泡)

创建复杂的CSS形状(说话气泡),css,border,shape,css-shapes,Css,Border,Shape,Css Shapes,在附件链接完整CSS中创建形状的最佳选项或方法是什么?是否可行 例如,我用CSS平行四边形进行了研究和测试,但还没有取得任何成功 请参见此处的形状-->> 不完全是您想要的,但我在玩CSS3的透视图和旋转,并制作了以下内容: body { color: #FFF; font-family: sans-serif; } .outer { position: relative; height: 120px; width: 120px; margin:

在附件链接完整CSS中创建形状的最佳选项或方法是什么?是否可行

例如,我用CSS平行四边形进行了研究和测试,但还没有取得任何成功

请参见此处的形状-->>


不完全是您想要的,但我在玩CSS3的透视图和旋转,并制作了以下内容:

body {
    color: #FFF;
    font-family: sans-serif;
}

.outer {
    position: relative;
    height: 120px;
    width: 120px;
    margin: 50px;
    padding:10px;
    perspective:150;
    -webkit-perspective:150;
}

.inner {
    border-radius: 15px;
    padding:50px;
    position: absolute;
    background-color: #80BFFF;
    transform: rotateY(10deg);
    -webkit-transform: rotateY(10deg);
    box-shadow: -4px -4px 0px #3399FF;
}

.inner:after {
    content: ' ';
    position: absolute;
    width: 0;
    height: 0;
    left: 20px;
    top: 115px;
    border: 15px solid;
    border-color: #80BFFF transparent transparent #80BFFF;
}
那是我的HTML资料

<div class="outer">
    <div class="inner">Yay!</div>
</div>

耶!

我有一个想法,那就是只需一个元素就可以完成——而且它是可以完成的,我只是不认为这样做是最好的解决方案

HTML

<div class='speech-bubble'>Hello!</div>
.speech-bubble {
  position: relative;
  margin: .5em auto;
  padding: 1em;
  width: 10em; height: 4em;
  border-radius: .25em;
  transform: rotate(-4deg) rotateY(15deg);
  background: #629bdd;
  font: 2em/4 Century Gothic, Verdana, sans-serif;
  text-align: center;
}
.speech-bubble:before, .speech-bubble:after {
  position: absolute;
  z-index: -1;
  content: '';
}
.speech-bubble:after {
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: inherit;
  transform: rotate(2deg) translate(.35em, -.15em) scale(1.02);
  background: #f4fbfe;
}
.speech-bubble:before {
  border: solid 0 transparent;
  border-right: solid 3.5em #f4fbfe;
  border-bottom: solid .25em #629bdd;
  bottom: .25em; left: 1.25em;
  width: 0; height: 1em;
  transform: rotate(45deg) skewX(75deg);
}

到目前为止你得到了什么提供尽可能多的关于您所取得的进展的信息是一个好主意。您必须使用多个元素和大量CSS3转换,但这是可能的。先自己动手,遇到问题再回来;)你是对的!稍后我将分享代码。现在不是在我的工作站上。还有一个有趣的问题是;你们会怎么做?是不是不该把所有的精力都放在CSS中呢。或者你会仅仅使用图像(通过sprite)产生额外的请求……是的,你可以这样做。事实上很容易。我现在要做一个演示。:)谢谢我会试试这个,并回答我的想法。