လုပ်နည်း - ပုံပေါ်တွင်ခလုတ်
CSS ဖြင့် ပုံတစ်ခုသို့ ခလုတ်တစ်ခုထည့်နည်းကို လေ့လာပါ။
ပုံပေါ်ခလုတ်
ပုံပေါ်တွင် ခလုတ်ထည့်နည်း
အဆင့် 1) HTML ကိုထည့်ပါ
ဥပမာ
<div class="container">
<img src="img_snow.jpg" alt="Snow">
<button class="btn">Button</button>
</div>
အဆင့် 2) CSS ကိုထည့်ပါ
ဥပမာ
/* Container needed to position the button. Adjust the width as needed */
.container {
position: relative;
width:
50%;
}
/* Make the
image responsive */
.container img {
width: 100%;
height: auto;
}
/* Style the button and place it in the middle of
the container/image */
.container .btn {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
background-color: #555;
color: white;
font-size: 16px;
padding: 12px 24px;
border: none;
cursor: pointer;
border-radius: 5px;
}
.container .btn:hover {
background-color: black;
}