Tugmalar guruhi
CSS yordamida "tugmalar guruhi"ni yaratishni o‘rganing.
Gorizontal tugmalar guruhi
Bir nechta tugmani bitta qatorda tugmalar guruhiga birlashtiring:
Tugmalar guruhi qanday yaratiladi
1-qadam) HTML qo‘shing:
Misol
<div class="btn-group">
<button>Apple</button>
<button>Samsung</button>
<button>Sony</button>
</div>
2-qadam) CSS qo‘shing:
Misol
.btn-group button {
background-color: #04AA6D; /* Green background */
border: 1px solid green; /* Green border */
color: white; /* White text */
padding: 10px 24px; /* Some padding */
cursor: pointer; /* Pointer/hand icon */
float: left; /* Float the buttons side by side */
}
.btn-group button:not(:last-child) {
border-right: none; /* Prevent double borders */
}
/* Clear floats (clearfix hack) */
.btn-group:after {
content: "";
clear: both;
display: table;
}
/* Add a background color on hover */
.btn-group button:hover {
background-color: #3e8e41;
}
O‘zingiz sinab ko‘ring »
Tekislangan / to‘liq kenglikdagi tugmalar guruhi:
Misol
<!-- Three buttons in a group -->
<div class="btn-group" style="width:100%">
<button style="width:33.3%">Apple</button>
<button style="width:33.3%">Samsung</button>
<button style="width:33.3%">Sony</button>
</div>
<!-- Four buttons in a group -->
<div class="btn-group" style="width:100%">
<button style="width:25%">Apple</button>
<button style="width:25%">Samsung</button>
<button style="width:25%">Sony</button>
<button style="width:25%">HTC</button>
</div>
O‘zingiz sinab ko‘ring »
Maslahat: Tugmalarga qanday uslub berish haqida ko‘proq bilish uchun CSS tugmalar darsligimizga o‘ting.
W3Schools Pathfinder
Yutuqlaringizni kuzating – bu bepul!
