I have tried different CSS properties to make the form scrollable but none is working.
<!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"> #CDN added here <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.slim.min.js"></script> #CDN added here <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"></script> #CDN added here <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script> #CDN added here </head> <body> <div data-spy="scroll" class="container"> #Added here <h2>Form</h2> <form class="form-inline" action="/action_page.php"> <label for="email">Email:</label> <input type="email" class="form-control" id="email" placeholder="Enter email" name="email"> <label for="pwd">Password:</label> <input type="password" class="form-control" id="pwd" placeholder="Enter password" name="pswd"> <div class="form-check"> <label class="form-check-label"> <input class="form-check-input" type="checkbox" name="remember"> Remember me </label> </div> <br /> <button type="submit" class="btn btn-primary">Submit</button> <br /> <label for="email">Email:</label><br /><br /> <input type="email" class="form-control" id="email" placeholder="Enter email" name="email"><br /><br /> <label for="pwd">Password:</label><br /><br /> <input type="password" class="form-control" id="pwd" placeholder="Enter password" name="pswd"><br /><br /> <div class="form-check"> <label class="form-check-label"> <input class="form-check-input" type="checkbox" name="remember"> Remember me </label> </div><br /><br /> <button type="submit" class="btn btn-primary">Submit</button> </form> </div> </body> </html>
Just add like below tag:
#Updated here
<div data-spy="scroll" data-target=".nav"> #.nav is classname from navbar <form> #Add here your form </form> </div>
The form must be inside div tag and now form is scrollable.
And now your problem is solved.
Happy coding!
Copyright © 2021 Jogjafile Inc.
Just add like below tag:
#Updated here
The form must be inside div tag and now form is scrollable.
And now your problem is solved.
Happy coding!