2
Hello, I’m having trouble fixing the search bar in the center of the navbar, since every change in css doesn’t change anything.
HTML:
<html>
<head>
<!-- Bootstrap CSS-->
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet">
<!-- Main CSS -->
<link href="src/css/style.css" rel="stylesheet" media="all">
</head>
<body>
<!-- Start Navigation bar -->
<nav class="navbar navbar-expand-md navbar-light bg-faded">
<div class="collapse navbar-collapse">
<form class="form-inline mr-auto">
<input class="form-control" type="search" placeholder="Search">
</form>
</div>
</nav>
<!-- End Navigation bar -->
</body>
</html>
CSS:
.navbar {
background-color: #3f3f3f;
}
#search .form-control {
width: 200px;
text-align: center;
}
Thank you for your patience.
Having to make your search bar responsive? This might help: https://www.w3schools.com/howto/howto_css_searchbar.asp
– Wanderson Rodrigo
@Wandersonrodrigo Hi, I’m actually trying to fix the search bar in the center of the navbar, since currently it is in the left corner, sorry if I wasn’t clear on the question.
– Nithogg
Hello @Nithogg, all right? Have you tried assigning class="Fixed-top"in your navbar? I believe you can solve your problem.
– Getulio Rafael Ferreira
These examples here can help:link
– Getulio Rafael Ferreira
With help from many here I noticed several errors in the code, I will review everything. Thank you!
– Nithogg