2

重複の可能性:
cssのみを使用して円を描く

送信ボタンの形を長方形から円形に変更する方法はありますか?

円形のシャッピングされた画像ソリューションを使用したくありません。私はcssスタイルからのようにボタンの他​​のすべての特徴が欲しいです。

4

6 に答える 6

14

プロパティを使用border-radiusします。

例:

.button {
    width: 100px;
    height: 100px;
    background-color: #000;
    border: solid 1px #000;
    border-radius: 50%
}

上記の例では、通常の円が表示されます。

少し丸みを帯びた形状が必要な場合は、次のことを試してください。

.button {
    width: 100px;
    height: 30px;
    background-color: #000;
    border: solid 1px #000;
    border-radius: 5px
}

ライブデモ:通常の円
ライブデモ:丸みを帯びた形状
ライブデモ:テキスト付きの入力ボタン

于 2012-07-26T14:25:58.020 に答える
5

Your question is already answered but I recommend you Twitter Bootstrap.

It is a HTML/CSS framework which allows you make great buttons (among others) easily.

This buttons are "crossbrowser" which means they are compatible with Internet Explorer.

With only one class - btn - you can stylize a <button>, <input type="button"> or <a>.

This :

<button class="btn"></button>

Gives that:

enter image description here

You also can customize your button quickly with an optional class :

btn-primary, btn-info, btn-success, btn-warning, btn-danger and btn-inverse.

This classes transform your button like that :

enter image description here

Then you can choose a size with the classes btn-large, btn-small and btn-mini.

Finally, you can add an icon (the list is here) in your button.

This:

<button class="btn btn-success">
    <i class="icon-shopping-cart icon-white"></i>
    <span>Checkout</span>
</button>

Gives that:

enter image description here

Have fun with your new buttons. :)

于 2012-07-26T14:44:31.983 に答える
2

CSSの境界線の半径を使用します。「CSSボタンジェネレーター」などをグーグルで検索し、CSSを正しく取得するために試してみることができるボタン生成ツールをいくつでも見つけることをお勧めします。要素のheight=widthを確認してから、それに応じてコーナー半径を調整する必要があります。

于 2012-07-26T14:25:28.913 に答える
1

このスタイルを使用します。

input[type='submit'] {
    width:100px;
    height:100px;
    border-radius:50px;
}​
于 2012-07-26T14:27:26.897 に答える
0

CSSでborder-radiusを使用できますが、IEではサポートされません。

遊んでください:-

border-radius: 10px 10px 10px 10px
于 2012-07-26T14:26:47.427 に答える
0

Jquery UIを使用することをお勧めします(独自のテーマを作成できます) http://jqueryui.com/themeroller/

また

CSS3 http://webdesignerwall.com/tutorials/css3-gradient-buttons

CSS3はIEでは機能しません。

于 2012-07-26T14:28:08.333 に答える