2016-06-09 39 views
0

我想創建一個圓形而不是帶圓角的矩形的模態。所以它應該看起來像是一箇中間的modal-body,沒有modal-header和沒有modal-footer使模態成爲圓形

這是與模式,以確保它如何工作,而不是常規的HTML圈子。

我只是想讓它看起來像這樣。

enter image description here

+0

邊界半徑:100%與平等的寬度和高度應該做[如何畫在HTML頁面中圈?(HTTP的 – danimal

+1

可能重複: //stackoverflow.com/questions/6921792/how-to-draw-circle-in-html-page) – jmattheis

+0

@jmattheis不,它是關於模態!不在HTML頁面圈出 – Sibidharan

回答

5

您需要使用的模態中的內容的位置進行試驗,但這裏的使用border-radius工作的例子,我只是做:https://jsfiddle.net/2ahhsa4a/1/

.modal-content { 
    border-radius: 50%; 
    width: 600px; 
    height: 600px; 
    border: 15px solid #000; 
} 

你會發現我已經使用固定的width/height作爲模式,這是爲了確保它在此示例中與border-radius結合時是一個完美的圓。

+0

它看起來很滿足。我會在實施之後標記爲正確的:) – Sibidharan

+1

@Sibidharan沒問題,樂意幫忙。你當然需要調整它,但它爲你提供了一個基礎。 –

+0

當然,我知道了..我可以調整它,以適應文本,因爲我喜歡:) – Sibidharan

1

HTML

 <div class="modal-body rounded"> 
     <p>Some text in the modal.</p> 
     </div> 

CSS

.rounded {border-radius: 100%; width: 500px; height: 500px;}