【问题标题】:How to get a ovel shape by using html5, css3 [duplicate]如何使用html5,css3获得椭圆形[重复]
【发布时间】:2015-01-02 20:38:05
【问题描述】:
<!DOCTYPE html>
 <head>
 <title> Oval shape</title>
 </head>
 <body>
 <div style="width:400px; height:400px; background-color:#ff0;">Oval</div>

  <p> This is Oval shape by using html5, css3.</p>
 <body>
</html> 

我写了这样的代码..我想要 div 标签为椭圆形..你能告诉我...

【问题讨论】:

标签: html css css-shapes


【解决方案1】:

html

 <div id="oval">Oval</div> <p> This is Oval shape by using html5, css3.</p>

css

#oval {
width: 200px;
height: 100px;
background: red;
-moz-border-radius: 100px / 50px;
-webkit-border-radius: 100px / 50px;
border-radius: 100px / 50px;
}

请看下面的链接

http://jsfiddle.net/Mithun146/b4k20ruw/

【讨论】:

  • 是的,我明白了.. thakyou...
  • 很遗憾,这不是响应式解决方案。
【解决方案2】:

您可以使用边框半径来允许动态尺寸。我还要指出 真的 这个 css 不需要前缀:

div{
  height:100px;
  width:200px;
  border-radius:50%;
  background-color: #ff0;
  }
&lt;div&gt;&lt;/div&gt;

【讨论】:

    猜你喜欢
    • 2012-04-23
    • 2021-08-15
    • 1970-01-01
    • 1970-01-01
    • 2021-11-19
    • 1970-01-01
    • 1970-01-01
    • 2011-10-08
    • 1970-01-01
    相关资源
    最近更新 更多