2014-01-13 110 views
2

有沒有辦法在HTML元素上有橢圓曲線邊框? 它應該是這樣的:創建橢圓曲線邊框

example

灰色區域是我的一般頭,黑色區域我對每個視圖的內容。 它得到的設置是這樣的:

_Layout.cshtml看起來是這樣的:

<body> 
    <div data-role="page" data-theme="a"> 
     <div data-role="header"> 
       @Html.Partial("_LoginPartial") 
     </div> 
     <div data-role="content"> 
      @RenderBody() 
     </div> 
    </div> 
    @Scripts.Render("~/bundles/jquery", "~/bundles/jquerymobile") 
    @RenderSection("scripts", required: false) 
</body> 

的重要組成部分是_LoginPartial.cshtml,這是灰色地帶。 現在我想讓這個元素看起來像我的照片。

如果您需要更多信息,請讓我知道。

回答

6

尋找類似的東西:?

演示http://jsfiddle.net/abhitalks/e36uD/1/

標記

<div class="container"> <!-- your data-role="page" --> 
    <div class="top"></div> <!-- your data-role="header" --> 
    <div class="content"></div> <!-- your data-role="content" --> 
</div> 

CSS

.container { 
    width: 300px; height: 300px; 
    background-color: #000; 
} 
.top { 
    height: 100px; 
    background-color: #ccc; 
    border-radius: 0 0 45% 45%; 
} 

與其他* shorthands *border-radius也是:top right bottom left;

+0

我特別想找'border-radius:0 0 45%45%'這一行,謝謝! –