Bootstrap 4 how can I remove the search box outside the collapse and position the search box correctly











up vote
0
down vote

favorite












I have been having issues trying to take the search box out of the navbar when it collapses and displaying the search box at the top center of the navbar. Also if i wanted to make a list using li tags that has it own row on the navbar on mobile view how can i accomplish this. here an example of what i am trying trying to achieve. You see how the search box is at the center of the navbar and how the li tags has it own row which says features,good and hotels. Do i have to change the position of the search box using absolute? Wondering what the best way of achieving this task.



here my code:



https://jsfiddle.net/mikeshasaco/05mfrb6g/5/



#custom-search-input {
margin: 0;
margin-top: 10px;
padding: 0;
}

#custom-search-input .search-query {
padding-right: 3px;
padding-right: 4px 9;
padding-left: 3px;
padding-left: 4px 9;
/* IE7-8 doesn't have border-radius, so don't indent the padding */
margin-bottom: 0;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
width: 298px;
}

#custom-search-input button {
border: 0;
background: none;
/** belows styles are working good */
padding: 2px 5px;
margin-top: 2px;
position: relative;
left: -28px;
/* IE7-8 doesn't have border-radius, so don't indent the padding */
margin-bottom: 0;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
color: #D9230F;
}

.search-query:focus+button {
z-index: 3;
}




{{-- fixed-top --}}
<nav class="navbar fixed-top navbar-expand-lg navbar-light bg-light border-bottom " id="navbarfix" >
<div class="container">

<a class="navbar-brand" href="">Exampe</a>
<button class="navbar-toggler " type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>


<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item dropdown">
<a id="navbarDropdown " class="nav-link dropdown-toggle " href="" style="color:#B35464; font-size:16px;" role="button" aria-haspopup="true" aria-expanded="false" v-pre> Dropdown <span class="caret"></span> </a>
<div class="dropdown-menu mega-menu" aria-labelledby="navbarDropdown">
<div class="container">
<ul>
<li>blog</li>
<li>help</li>
</ul>
</div>
</div>

</li>

<li class="nav-item active">
<a class="nav-link" href="" style="color: #B35464; font-size:16px;"> Help</a>
</li>


{{-- name saves the query result to the bar && id query print the result--}}



<form class="navbar-form" action="" method="GET">
<div id="custom-search-input">
<div class="input-group col-md-12">
<input type="text" name="query" id="query" value="" class="search-query form-control" placeholder="Search for ">
</div>
</div>

</form>


</ul>



<ul class="navbar-nav ml-auto">


<li><a class="nav-link" href="{{ route('login') }}">Login</a></li>
<li><a class="nav-link" href="{{ route('register') }}">Register</a></li>

</ul>

</div>
</div>
</nav>


enter image description here










share|improve this question


























    up vote
    0
    down vote

    favorite












    I have been having issues trying to take the search box out of the navbar when it collapses and displaying the search box at the top center of the navbar. Also if i wanted to make a list using li tags that has it own row on the navbar on mobile view how can i accomplish this. here an example of what i am trying trying to achieve. You see how the search box is at the center of the navbar and how the li tags has it own row which says features,good and hotels. Do i have to change the position of the search box using absolute? Wondering what the best way of achieving this task.



    here my code:



    https://jsfiddle.net/mikeshasaco/05mfrb6g/5/



    #custom-search-input {
    margin: 0;
    margin-top: 10px;
    padding: 0;
    }

    #custom-search-input .search-query {
    padding-right: 3px;
    padding-right: 4px 9;
    padding-left: 3px;
    padding-left: 4px 9;
    /* IE7-8 doesn't have border-radius, so don't indent the padding */
    margin-bottom: 0;
    -webkit-border-radius: 15px;
    -moz-border-radius: 15px;
    border-radius: 15px;
    width: 298px;
    }

    #custom-search-input button {
    border: 0;
    background: none;
    /** belows styles are working good */
    padding: 2px 5px;
    margin-top: 2px;
    position: relative;
    left: -28px;
    /* IE7-8 doesn't have border-radius, so don't indent the padding */
    margin-bottom: 0;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    color: #D9230F;
    }

    .search-query:focus+button {
    z-index: 3;
    }




    {{-- fixed-top --}}
    <nav class="navbar fixed-top navbar-expand-lg navbar-light bg-light border-bottom " id="navbarfix" >
    <div class="container">

    <a class="navbar-brand" href="">Exampe</a>
    <button class="navbar-toggler " type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
    </button>


    <div class="collapse navbar-collapse" id="navbarSupportedContent">
    <ul class="navbar-nav mr-auto">
    <li class="nav-item dropdown">
    <a id="navbarDropdown " class="nav-link dropdown-toggle " href="" style="color:#B35464; font-size:16px;" role="button" aria-haspopup="true" aria-expanded="false" v-pre> Dropdown <span class="caret"></span> </a>
    <div class="dropdown-menu mega-menu" aria-labelledby="navbarDropdown">
    <div class="container">
    <ul>
    <li>blog</li>
    <li>help</li>
    </ul>
    </div>
    </div>

    </li>

    <li class="nav-item active">
    <a class="nav-link" href="" style="color: #B35464; font-size:16px;"> Help</a>
    </li>


    {{-- name saves the query result to the bar && id query print the result--}}



    <form class="navbar-form" action="" method="GET">
    <div id="custom-search-input">
    <div class="input-group col-md-12">
    <input type="text" name="query" id="query" value="" class="search-query form-control" placeholder="Search for ">
    </div>
    </div>

    </form>


    </ul>



    <ul class="navbar-nav ml-auto">


    <li><a class="nav-link" href="{{ route('login') }}">Login</a></li>
    <li><a class="nav-link" href="{{ route('register') }}">Register</a></li>

    </ul>

    </div>
    </div>
    </nav>


    enter image description here










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have been having issues trying to take the search box out of the navbar when it collapses and displaying the search box at the top center of the navbar. Also if i wanted to make a list using li tags that has it own row on the navbar on mobile view how can i accomplish this. here an example of what i am trying trying to achieve. You see how the search box is at the center of the navbar and how the li tags has it own row which says features,good and hotels. Do i have to change the position of the search box using absolute? Wondering what the best way of achieving this task.



      here my code:



      https://jsfiddle.net/mikeshasaco/05mfrb6g/5/



      #custom-search-input {
      margin: 0;
      margin-top: 10px;
      padding: 0;
      }

      #custom-search-input .search-query {
      padding-right: 3px;
      padding-right: 4px 9;
      padding-left: 3px;
      padding-left: 4px 9;
      /* IE7-8 doesn't have border-radius, so don't indent the padding */
      margin-bottom: 0;
      -webkit-border-radius: 15px;
      -moz-border-radius: 15px;
      border-radius: 15px;
      width: 298px;
      }

      #custom-search-input button {
      border: 0;
      background: none;
      /** belows styles are working good */
      padding: 2px 5px;
      margin-top: 2px;
      position: relative;
      left: -28px;
      /* IE7-8 doesn't have border-radius, so don't indent the padding */
      margin-bottom: 0;
      -webkit-border-radius: 3px;
      -moz-border-radius: 3px;
      border-radius: 3px;
      color: #D9230F;
      }

      .search-query:focus+button {
      z-index: 3;
      }




      {{-- fixed-top --}}
      <nav class="navbar fixed-top navbar-expand-lg navbar-light bg-light border-bottom " id="navbarfix" >
      <div class="container">

      <a class="navbar-brand" href="">Exampe</a>
      <button class="navbar-toggler " type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
      </button>


      <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav mr-auto">
      <li class="nav-item dropdown">
      <a id="navbarDropdown " class="nav-link dropdown-toggle " href="" style="color:#B35464; font-size:16px;" role="button" aria-haspopup="true" aria-expanded="false" v-pre> Dropdown <span class="caret"></span> </a>
      <div class="dropdown-menu mega-menu" aria-labelledby="navbarDropdown">
      <div class="container">
      <ul>
      <li>blog</li>
      <li>help</li>
      </ul>
      </div>
      </div>

      </li>

      <li class="nav-item active">
      <a class="nav-link" href="" style="color: #B35464; font-size:16px;"> Help</a>
      </li>


      {{-- name saves the query result to the bar && id query print the result--}}



      <form class="navbar-form" action="" method="GET">
      <div id="custom-search-input">
      <div class="input-group col-md-12">
      <input type="text" name="query" id="query" value="" class="search-query form-control" placeholder="Search for ">
      </div>
      </div>

      </form>


      </ul>



      <ul class="navbar-nav ml-auto">


      <li><a class="nav-link" href="{{ route('login') }}">Login</a></li>
      <li><a class="nav-link" href="{{ route('register') }}">Register</a></li>

      </ul>

      </div>
      </div>
      </nav>


      enter image description here










      share|improve this question













      I have been having issues trying to take the search box out of the navbar when it collapses and displaying the search box at the top center of the navbar. Also if i wanted to make a list using li tags that has it own row on the navbar on mobile view how can i accomplish this. here an example of what i am trying trying to achieve. You see how the search box is at the center of the navbar and how the li tags has it own row which says features,good and hotels. Do i have to change the position of the search box using absolute? Wondering what the best way of achieving this task.



      here my code:



      https://jsfiddle.net/mikeshasaco/05mfrb6g/5/



      #custom-search-input {
      margin: 0;
      margin-top: 10px;
      padding: 0;
      }

      #custom-search-input .search-query {
      padding-right: 3px;
      padding-right: 4px 9;
      padding-left: 3px;
      padding-left: 4px 9;
      /* IE7-8 doesn't have border-radius, so don't indent the padding */
      margin-bottom: 0;
      -webkit-border-radius: 15px;
      -moz-border-radius: 15px;
      border-radius: 15px;
      width: 298px;
      }

      #custom-search-input button {
      border: 0;
      background: none;
      /** belows styles are working good */
      padding: 2px 5px;
      margin-top: 2px;
      position: relative;
      left: -28px;
      /* IE7-8 doesn't have border-radius, so don't indent the padding */
      margin-bottom: 0;
      -webkit-border-radius: 3px;
      -moz-border-radius: 3px;
      border-radius: 3px;
      color: #D9230F;
      }

      .search-query:focus+button {
      z-index: 3;
      }




      {{-- fixed-top --}}
      <nav class="navbar fixed-top navbar-expand-lg navbar-light bg-light border-bottom " id="navbarfix" >
      <div class="container">

      <a class="navbar-brand" href="">Exampe</a>
      <button class="navbar-toggler " type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
      </button>


      <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav mr-auto">
      <li class="nav-item dropdown">
      <a id="navbarDropdown " class="nav-link dropdown-toggle " href="" style="color:#B35464; font-size:16px;" role="button" aria-haspopup="true" aria-expanded="false" v-pre> Dropdown <span class="caret"></span> </a>
      <div class="dropdown-menu mega-menu" aria-labelledby="navbarDropdown">
      <div class="container">
      <ul>
      <li>blog</li>
      <li>help</li>
      </ul>
      </div>
      </div>

      </li>

      <li class="nav-item active">
      <a class="nav-link" href="" style="color: #B35464; font-size:16px;"> Help</a>
      </li>


      {{-- name saves the query result to the bar && id query print the result--}}



      <form class="navbar-form" action="" method="GET">
      <div id="custom-search-input">
      <div class="input-group col-md-12">
      <input type="text" name="query" id="query" value="" class="search-query form-control" placeholder="Search for ">
      </div>
      </div>

      </form>


      </ul>



      <ul class="navbar-nav ml-auto">


      <li><a class="nav-link" href="{{ route('login') }}">Login</a></li>
      <li><a class="nav-link" href="{{ route('register') }}">Register</a></li>

      </ul>

      </div>
      </div>
      </nav>


      enter image description here







      html css twitter-bootstrap bootstrap-4






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 11 at 15:07









      jmike

      11810




      11810





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53250047%2fbootstrap-4-how-can-i-remove-the-search-box-outside-the-collapse-and-position-th%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53250047%2fbootstrap-4-how-can-i-remove-the-search-box-outside-the-collapse-and-position-th%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Xamarin.iOS Cant Deploy on Iphone

          Glorious Revolution

          Dulmage-Mendelsohn matrix decomposition in Python