কিভাবে তৈরি করা: সার্চ বার

প্রতিক্রিয়ামূলক নেভিগেশন মেনুতে সার্চ বক্স যোগ করতে কিভাবে শিখুন

সার্চ বার

স্বয়ং প্রয়োগ করুন

সার্চ বার তৈরি করুন

প্রথম পদক্ষেপ - এইচটিএমএল যোগ করুন

<div class="topnav">
  <a class="active" href="#home">Home</a>
  <a href="#about">About</a>
  <a href="#contact">Contact</a>
  <input type="text" placeholder="Search..">
</div>

Second step - Add CSS:

/* Add a black background color to the top navigation bar */
.topnav {
  overflow: hidden;
  background-color: #e9e9e9;
}
/* Set the style of the links in the navigation bar */
.topnav a {
  float: left;
  display: block;
  color: black;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
}
/* Change the color of the link when hovering */
.topnav a:hover {
  background-color: #ddd;
  color: black;
}
/* Set the style of the 'active' element to highlight the current page */
.topnav a.active {
  background-color: #2196F3;
  color: white;
}
/* Set the style of the search box in the navigation bar */
.topnav input[type=text] {
  float: right;
  padding: 6px;
  border: none;
  margin-top: 8px;
  margin-right: 16px;
  font-size: 17px;
}
/* When screen width is less than 600px, stack links and search box vertically instead of horizontally */
@media screen and (max-width: 600px) {
  .topnav a, .topnav input[type=text] {
    float: none;
    display: block;
    text-align: left;
    width: 100%;
    margin: 0;
    padding: 14px;
  }
  .topnav input[type=text] {
    border: 1px solid #ccc;
  }
}

স্বয়ং প্রয়োগ করুন

সমর্থিত সবার এক্সাম্প্ল

Home About

স্বয়ং প্রয়োগ করুন

সমর্থিত ট্যাব এক্সাম্প্ল

স্বয়ং প্রয়োগ করুন

相关页面

教程:如何创建响应式顶部导航

教程:CSS 导航栏