如何在html中绘制一侧弯曲的矩形

时间:2016-11-25 15:25:03

标签: html css html5 svg

是否可以在html中绘制顶部弯曲的矩形? 形状应该显示在html页面的底部,因为它需要页脚。

enter image description here

2 个答案:

答案 0 :(得分:2)

您可以使用充当分隔符的SVG。



<main>
  <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 100 100" preserveAspectRatio="none">
    <path d="M0 0 C 50 100 50 100 100 0 Z"></path>
  </svg>
</main>
<footer></footer>
&#13;
{{1}}
&#13;
&#13;
&#13;

答案 1 :(得分:1)

试试这个: 这应该只显示第一步: - )

.wrapper {
  width: 500px;
  height: 200px;
  border: 1px solid black;
  border-top: none;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.wrapper:before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 80%;
  border: 1px solid black;
  left: 0;
  top: -50%;
  z-index: 2;
}

您可以使用top(%)和半径来满足您的需求 希尔是小提琴:https://jsfiddle.net/tbm2jgbk/

相关问题