လုပ်နည်း - ပုံသေမီနူး
CSS ဖြင့် "ပုံသေ" မီနူးကို ဖန်တီးနည်းကို လေ့လာပါ။
ပုံသေထိပ်တန်းမီနူးကိုဖန်တီးနည်း
အဆင့် 1) HTML ကိုထည့်ပါ
ဥပမာ
<div class="navbar">
<a href="#home">Home</a>
<a href="#news">News</a>
<a href="#contact">Contact</a>
</div>
<div class="main">
<p>Some text some text some text some text..</p>
</div>
အဆင့် 2) CSS ကိုထည့်ပါ
ပုံသေထိပ်တန်းမီနူးတစ်ခုဖန်တီးရန်၊ နှင့် အသုံးပြု position:fixed
ပါ top:0
။ ပုံသေမီနူးသည် သင့်အခြားအကြောင်းအရာကို ထပ်လောင်းမည်ကို သတိပြုပါ။ ၎င်းကိုဖြေရှင်းရန်၊ margin-top
သင့်မီနူး၏အမြင့်ထက် ညီသော သို့မဟုတ် ပိုကြီးသော (အကြောင်းအရာသို့) ထည့်ပါ။
ဥပမာ
/* The navigation bar */
.navbar {
overflow: hidden;
background-color: #333;
position: fixed; /* Set
the navbar to fixed position */
top: 0;
/* Position the navbar at the top of the page */
width:
100%; /* Full width */
}
/* Links inside the navbar */
.navbar a {
float: left;
display:
block;
color: #f2f2f2;
text-align:
center;
padding: 14px 16px;
text-decoration: none;
}
/* Change background on mouse-over */
.navbar
a:hover {
background: #ddd;
color:
black;
}
/* Main
content */
.main {
margin-top: 30px; /* Add a top
margin to avoid content overlay */
}
Fixed Bottom Menu ဖန်တီးနည်း
ပုံသေအောက်ခြေမီနူးတစ်ခုဖန်တီးရန်၊ position:fixed
အသုံးပြုပြီး
bottom:0
-
ဥပမာ
/* The navigation bar */
.navbar {
position: fixed; /* Set the navbar to fixed position */
bottom: 0;
/* Position the navbar at the bottom of the page */
width:
100%; /* Full width */
}
/* Main
content */
.main
{
margin-bottom: 30px; /* Add a bottom margin to avoid content overlay */
}
အကြံပြုချက်- လမ်းပြဘားများအကြောင်း ပိုမိုလေ့လာရန် ကျွန်ုပ်တို့၏ CSS Navbar Tutorial သို့ သွားပါ ။