Home > Software design >  I don't know how to add these features to the site
I don't know how to add these features to the site

Time:10-28

I need to add 3 buttons to my header 1 - a search bar 2 simple button in the form of text Enter and 3 is a picture of a bag with the number 0

yes i know for a pro in html the question will sound stupid but i am newbie and i need to add this to my header in its free part,I have never made this type of button in the header and you will probably find a lot of mistakes in my code.

yes, I know what you will say "there is no one here who will not write the code for you", but I have never hidden even with the search bar, and I have also never made a login button with an icon in front of it, and I lack the experience to do it

enter image description here

my site code - html :

<!DOCTYPE html>
<html lang="en">
<head>
  <header >
  <a href="" >Fresh market</a>
  <input  type="checkbox" id="menu-btn" />
  <link rel="stylesheet" href="style.css">
  <label  for="menu-btn"><span ></span></label>
  <ul >
    <li><a href="#work">Home</a></li>
    <li><a href="#about">Shop</a></li>
    <li><a href="#careers">About</a></li>
    <li><a href="#contact">Contact</a></li>
  </ul>
</header>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Shop</title>
</head>
<body>
  
</body>
</html>

css:

body {
    margin: 0;
    font-family: Helvetica, sans-serif;
    background-color: #f4f4f4;
  }
  
  a {
    color: #000;
  }
  
  /* header */
  
  .header {
    background-color: #fff;
    box-shadow: 1px 1px 4px 0 rgba(0,0,0,.1);
    position: fixed;
    width: 100%;
    z-index: 3;
  }
  
  .header ul {
    margin: 0;
    padding: 0;
    list-style: none;
    overflow: hidden;
    background-color: #fff;
  }
  
  .header li a {
    display: block;
    padding: 20px 20px;
    border-right: 1px solid #f4f4f4;
    text-decoration: none;
  }
  
  .header li a:hover,
  .header .menu-btn:hover {
    color:green;
  }

  
  .header .logo {
    display: block;
    float: left;
    font-size: 2em;
    padding: 10px 20px;
    text-decoration: none;
    color:green;
    
  }

  .logo::before {
   
    content:url('imgonline-com-ua-Resize-HhpRdaDieHxuk8.png');
            display: inline-block;
            padding-right: 3px;
            vertical-align: middle;
          }
  
  /* menu */
  
  .header .menu {
    clear: both;
    max-height: 0;
    transition: max-height .2s ease-out;
  }
  
  /* menu icon */
  
  .header .menu-icon {
    cursor: pointer;
    display: inline-block;
    float: right;
    padding: 28px 20px;
    position: relative;
    user-select: none;
  }
  
  .header .menu-icon .navicon {
    background: #333;
    display: block;
    height: 2px;
    position: relative;
    transition: background .2s ease-out;
    width: 18px;
  }
  
  .header .menu-icon .navicon:before,
  .header .menu-icon .navicon:after {
    background: #333;
    content: '';
    display: block;
    height: 100%;
    position: absolute;
    transition: all .2s ease-out;
    width: 100%;
  }
  
  .header .menu-icon .navicon:before {
    top: 5px;
  }
  
  .header .menu-icon .navicon:after {
    top: -5px;
  }
  
  /* menu btn */
  
  .header .menu-btn {
    display: none;
  }
  
  .header .menu-btn:checked ~ .menu {
    max-height: 240px;
  }
  
  .header .menu-btn:checked ~ .menu-icon .navicon {
    background: transparent;
  }
  
  .header .menu-btn:checked ~ .menu-icon .navicon:before {
    transform: rotate(-45deg);
  }
  
  .header .menu-btn:checked ~ .menu-icon .navicon:after {
    transform: rotate(45deg);
  }
  
  .header .menu-btn:checked ~ .menu-icon:not(.steps) .navicon:before,
  .header .menu-btn:checked ~ .menu-icon:not(.steps) .navicon:after {
    top: 0;
  }
  
  /* 48em = 768px */
  
  @media (min-width: 48em) {
    .header li {
      float: left;
    }
    .header li a {
      padding: 20px 30px;
    }
    .header .menu {
      clear: none;
      float: center;
      max-height: none;
    }
    .header .menu-icon {
      display: none;
    }
  }
  
  logo:before {
      content:url(images/quotemarks.png);
  }
  
  
  

CodePudding user response:

you can use any svg icon one of the free icon services is ion icons You can insert icons like this

.icons{
width:100vw;
display:flex;
justify-content:flex-end;
align-items:center;
gap:15px;
}

ion-icon{
font-size:30px;
color:green;
}
ion-icon:last-child{
margin-right:50px;
}
input{
outline:none;
border:none;
}
input::placeholder{
font-size:16px;
}
<html>
<head>
<script type="module" src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.esm.js"></script>
<script nomodule src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.js"></script>
</head>
<body>
<div >
<input placeholder="Search.." type="text">
<ion-icon name="search-outline"></ion-icon>
<ion-icon name="person-circle-outline"></ion-icon>
<ion-icon name="bag-handle-outline"></ion-icon>
</div>
</body>
</html>

  • Related