HTML page won't switch to mobile version / not responsive - html

<body>
<nav class="navbar navbar transparent">
<div class="container-fluid logo">
<div class="navbar-header">
<a class="navbar-brand" href="#">
<img src="images/Logo.png" />
</a>
</div>
<ul class="nav navbar-nav navbar-right right font-top">
<li class="Buybtn-topright">
<button type="button" class="btn-link"> Buy now</button>
</li>
</ul>
</div>
</nav>
<div class="form" >
<ul class="tab-group">
<li class="tab active">Sign Up</li>
<li class="tab">Log In</li>
</ul>
<div class="tab-content">
<div id="signup">
<h1>Sign Up for Free</h1>
<form action="signup.php" method="post">
<div class="top-row">
<div class="field-wrap">
<label>
Full Name<span class="req">*</span>
</label>
<input type="text" name="FuName" required autocomplete="off" />
</div>
<div class="field-wrap">
<label>
user name<span class="req">*</span>
</label>
<input type="text" name="username"required autocomplete="off"/>
</div>
</div>
<div class="field-wrap">
<label>
Email Address<span class="req">*</span>
</label>
<input type="email" name="email"required autocomplete="off"/>
</div>
<div class="field-wrap">
<label>
Set A Password<span class="req">*</span>
</label>
<input type="password" name="password" required autocomplete="off"/>
</div>
<div class="field-wrap">
<label>
c A Password<span class="req">*</span>
</label>
<input type="password" name="CPass" required autocomplete="off"/>
</div>
<button type="submit" class="button button-block"/>Get Started</button>
</form>
</div>
<div id="login">
<h1>Welcome Back!</h1>
<form action="signin.php" method="post" >
<div class="field-wrap">
<label>
username <span class="req">*</span>
</label>
<input name="username" id="username" required autocomplete="off"/>
</div>
<div class="field-wrap">
<label>
Password<span class="req">*</span>
</label>
<input type="password" name="password" id="password" required autocomplete="off"/>
</div>
<p class="forgot">Forgot Password?</p>
<button type="submit" name="submit" value="Login "class="button button-block"/>Login</button>
</form>
</div>
</div> </div>
<div class="row">
<nav class="navbar navbar-default footer">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar"></button>
<a class="navbar-brand" href="#">
<img src="images/Logobott.png" />
</a></div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="foot-stylee">
Apps
</li>
<li>
Gadgets
</li>
<li>
Sience
</li>
<li>
Nature
</li>
<li>
Creative
</li>
</ul>
<ul class="nav navbar-nav navbar-right nav-r">
<li>
© 2016 Great Simple
</li>
</ul>
</div>
</div>
</nav>
</div>
<!-- tab-content -->
</div>
</body>
</html>
I have the above code in html and when I look at in mobile version it looks like the desktop so it is not responsive. BUT what is making me confused is that for the FOOTER and HEADER I have the same exact code in the other pages and they are responsive? any suggestion?

Any chance you forgot to load Bootstrap CSS?

To enable responsiveness using twitter bootstrap, the <head> section of your HTML page should contain <meta name="viewport" content="width=device-width, initial-scale=1">.
As such, for a basic start up responsive twitter Bootstrap template, head over to the getting started twitter Bootstrap page.

Related

CSS - Moving items around in Navbar

See screenshots for what I am trying to achieve.
https://imgur.com/jaOmFnz
https://imgur.com/aRxile9
The menu list items (My application, Register, Login) I want to move to the far right of the screen. I have tried messing with the margins, float:right, however still cannot get this to work.
The container div spans the full width. Would I need to amend this div?
I've created a codeped to illustrate this
https://codepen.io/jquerypain121/pen/OJNaWpa
<html><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Log in - PhotoUploaderForm</title>
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-dark bg-white border-bottom box-shadow mb-3">
<div class="container">
<img src="https://lh3.googleusercontent.com/proxy/HQAE10KQ0NmS9htB5BKSoN24jWvyaizAKwhGy8hNVVsCbFUubvDdLSsYB8xWbN3JUDzDuAzw0OxKO5QZyL_XPqitq1wcSYaMVJ35_oC48c4FKZYykJUoucS-LJT1" width="200" title="title" alt="additional title">
<a class="navbar-brand" href="/">My Application</a>
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
<ul class=" moveright nav navbar-nav">
<a class="navbar-brand" href="/">My Application</a>
<li class="nav-item">
<a class="nav-link text-dark" id="register" href="/Identity/Account/Register">Register</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" id="login" href="/Identity/Account/Login">Login</a>
</li>
</ul>
<ul class="navbar-nav flex-grow-1">
</ul>
</div>
</div>
</nav>
</header>
<div class="container-fluid">
<main role="main" class="pb-3">
<h1>Log in</h1>
<div class="row">
<div class="col-md-4">
<section>
<form id="account" method="post" action="/Identity/Account/Login" novalidate="novalidate">
<hr>
<div class="text-danger validation-summary-valid" data-valmsg-summary="true"><ul><li style="display:none"></li>
</ul></div>
<div class="form-group">
<label for="Input_Email">Email</label>
<input class="form-control" type="email" data-val="true" data-val-email="The Email field is not a valid e-mail address." data-val-required="The Email field is required." id="Input_Email" name="Input.Email" value="">
<span class="text-danger field-validation-valid" data-valmsg-for="Input.Email" data-valmsg-replace="true"></span>
</div>
<div class="form-group">
<label for="Input_Password">Password</label>
<input class="form-control" type="password" data-val="true" data-val-required="The Password field is required." id="Input_Password" name="Input.Password">
<span class="text-danger field-validation-valid" data-valmsg-for="Input.Password" data-valmsg-replace="true"></span>
</div>
<div class="form-group">
<div class="checkbox">
<label for="Input_RememberMe">
<input type="checkbox" data-val="true" data-val-required="The Remember me? field is required." id="Input_RememberMe" name="Input.RememberMe" value="true">
Remember me?
</label>
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary" formaction="/Identity/Account/Login?returnUrl=%2F">Log in</button>
<input type="hidden" id="ReturnUrl" name="ReturnUrl" value="/">
</div>
<div class="form-group">
<p>
Register as a new user
</p>
</div>
<input name="__RequestVerificationToken" type="hidden" value="CfDJ8PEcG7qoomVJk-wiZaqy0p6b5tfvXZTuVH-9YakoOKQQf8mWfBn4MYD7BCb3YKL_NmEz_Ru57zD8PV8Tq_6ea5WApccwrpwYrOkBdu7Qu9Z6NMycGCHqDTI35Ci1mPMVQSqyQ47sNdvfhZhfkMSx_DQ"><input name="Input.RememberMe" type="hidden" value="false"></form>
</section>
</div>
<div class="col-md-6 col-md-offset-2">
</div>
</div>
</main>
</div>
<footer class="border-top footer text-muted">
<div class="container">
<p style="float:left;color: white;">© 2020 - Leicestershire Health Informatics Service -</p>
<a style="float:right; margin-right: 10px;" href="/Home/Privacy">Privacy</a>
<a style="float:right;margin-right: 10px;" href="/Home/Information">Info</a>
<a style="float:right;margin-right: 10px;" href="/Home/TermsAndConditions">T&C</a>
</div>
</footer>
</body></html>
Any help would be appreciated, thanks
you don't need to customize the code. Bootstrap has it's own design which you want to achieve. For your reference https://getbootstrap.com/docs/4.5/components/navbar/
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"/>
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand">
<img src="https://getbootstrap.com/docs/4.5/assets/brand/bootstrap-solid.svg" width="30" height="30" class="d-inline-block align-top">
My Application
</a>
<div class="form-inline">
<a class="nav-link text-dark" href="">My Application</a>
<a class="nav-link text-dark" id="register" href="/Identity/Account/Register">Register</a>
<a class="nav-link text-dark" id="login" href="/Identity/Account/Login">Login</a>
</div>
</nav>
Instead of writing moveright in your ul class list, write ml-auto. This should move the list to the right.
Make the width of the nav 100%
and then make the ul float: right;
Hope it will work for you

Col 6 Panels Alignment Issues

First experience with bootstrap. Want 2 panels next to each other using the col-lg-6 class. Left panel will be a link to an article while holding an image. Right will be a signup/login box.
When loading the site the 2 panel goes underneath?
<div class="row">
<div class="col-lg-6">
<h2>Lastest News</h2>
<p>Article</p>
<div class="panel panel-default">
<div class="panel-heading">Panel Header</div>
<div class="panel-body"><img class="img-responsive" src="images/warning.png"</div>
</div>
</div>
<div class="col-lg-6">
<form action="/action_page.php">
<h2>Buy, Sell and more deals!</h2>
<div class="form-group">
<label for="email">Email address:</label>
<input type="email" class="form-control" id="email">
</div>
<div class="form-group">
<label for="pwd">Password:</label>
<input type="password" class="form-control" id="pwd">
</div>
<div class="checkbox">
<label><input type="checkbox"> Remember me</label>
</div>
<ul class="nav navbar-nav navbar-center">
<li>
<button class="navbutton">
Login
</button>
</li>
<li>
<p> Not with us yet? </p>
</li>
<li>
<button class="navbutton">
Sign Up
</button>
</li>
</ul>
</form>
</div>
</div>
</div>
This is all inside a container.
Before adding img
After adding img
Please use this HTML
<div class="row">
<div class="col-lg-6">
<h2>Lastest News</h2>
<p>Article</p>
<div class="panel panel-default">
<div class="panel-heading">Panel Header</div>
<div class="panel-body">
<img class="img-responsive" src="images/warning.png"/>
</div>
</div>
</div>
<div class="col-lg-6">
<form action="/action_page.php">
<h2>Buy, Sell and more deals!</h2>
<div class="form-group">
<label for="email">Email address:</label>
<input type="email" class="form-control" id="email">
</div>
<div class="form-group">
<label for="pwd">Password:</label>
<input type="password" class="form-control" id="pwd">
</div>
<div class="checkbox">
<label><input type="checkbox"> Remember me</label>
</div>
<ul class="nav navbar-nav navbar-center">
<li>
<button class="navbutton">
Login
</button>
</li>
<li>
<p> Not with us yet? </p>
</li>
<li>
<button class="navbutton">
Sign Up
</button>
</li>
</ul>
</form>
</div>
</div>

bootstrap `input-group` fixed size

I need to make the bootstrap input-group with fixed size, here is the JS Fiddle link https://jsfiddle.net/ncxge6md/1/ , basically I need to resize the input field when page resizes.
<ul class="nav navbar-nav navbar-left">
<li
<form class="navbar-form" >
From Date:<br>
<div class="form-group">
<div class='input-group date' id='datetimepickerFrom'>
<input id = "date_idFrom" type='text' class="form-control" placeholder="From Date" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</form>
</li>
</br>
<br>
<li
<form class="navbar-form" role="search">
City:<br>
<div class="input-group">
<input autocomplete="off" id = "city_id" type="text" class="form-control" placeholder="City" name="q">
</div>
</form>
</li>
</li>
</ul>
If you are using bootstrap , you can use grids.
like col-xs-{num} col-sm-{num} col-md-{num} col-lg-{num}.(in bootstrap 3)
DEMO HERE
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.7.14/css/bootstrap-datetimepicker.min.css" rel="stylesheet"/>
<ul class="nav navbar-nav navbar-left">
<li>
<form class="navbar-form">
<div class="col-md-12">From Date:<br>
<div class="form-group">
<div class='input-group date' id='datetimepickerFrom'>
<input id = "date_idFrom" type='text' class="form-control" placeholder="From Date" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
</form>
</li></br> <br>
<li>
<form class="navbar-form" role="search">
<div class="col-md-12">City:<br>
<div class="input-group">
<input autocomplete="off" id = "city_id" type="text" class="form-control" placeholder="City" name="q">
</div>
</div>
</form>
</li>
</ul>
Try this.
This may help you.
Thanks.

My navbar dropdown is not overlaying my header even with position relative and z-index

I'm trying to make a login dropdown from my navbar overlay the header of the page. The navbar and dowdown use ui bootstrap.
I tried the following:
1. #login-dp{
min-width: 200px;
padding: 14px 14px 0;
position: relative;
z-index: 1000;
}`
I tried wraping the ul with that class and setting the wraper position to absolute (that fixed 2 other elements from going bunkers when I click the dropdown)
I tried setting the #login-dp to absolute and the wraper to relative
Most of the solutions I found only mention about the position and z-index.
Here is some code:
<ul class="nav navbar-nav navbar-right">
<li><p class="navbar-text">Already have an account?</p></li>
<li class="dropdown">
<b>Login</b> <span class="caret"></span>
<div class="wraper1">
<ul id="login-dp" class="dropdown-menu dropdown-menu-right" uib-collapse="isDropCollapsed">
<li>
<div class="row">
<div class="col-md-12">
<!--<p>Login via</p>
<div class="social-buttons">
<i class="fa fa-facebook"></i> Facebook
<i class="fa fa-twitter"></i> Twitter
</div>
<p>or</p>-->
<form class="form" role="form" method="post" action="login" accept-charset="UTF-8" id="login-nav">
<div class="form-group">
<label class="sr-only" for="exampleInputEmail2">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail2" placeholder="Email address" required>
</div>
<div class="form-group">
<label class="sr-only" for="exampleInputPassword2">Password</label>
<input type="password" class="form-control" id="exampleInputPassword2" placeholder="Password" required>
<div class="help-block text-right">Forget the password ?</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary btn-block">Sign in</button>
</div>
<div class="checkbox">
<label>
<input type="checkbox"><p>keep me logged-in</p>
</label>
</div>
</form>
</div>
<div class="bottom text-center">
<p>New here?</p> <b>Join Us</b>
</div>
</div>
</li>
</ul>
</div>
</li>
</ul>
Hope you can help

How to add a search box with icon to the navbar using materialize css?

I want to embed a simple input search box. I tried to use code like in bootstrap, but I can't make it to work. I have no clue how to do it.
I have this bootstrap code:
<div class="col-sm-3 col-md-3 pull-right">
<form class="navbar-form" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search"
name="srch-term" id="srch-term">
<div class="input-group-btn">
<button class="btn btn-default" type="submit">
<i class="glyphicon glyphicon-search"></i>
</button>
</div>
</div>
</form>
</div>
Reference: How to add a search box
I have found that : https://ampersandacademy.com/tutorials/materialize-css/navbar-with-autocomplete-search-box
You have to add a div element in the li element of your navbar ul list.
<nav class="white">
<div class="nav-wrapper">
Logo
<ul class="hide-on-med-and-down right">
<li>
<div class="center row">
<div class="col s12 " >
<div class="row" id="topbarsearch">
<div class="input-field col s6 s12 red-text">
<i class="red-text material-icons prefix">search</i>
<input type="text" placeholder="search" id="autocomplete-input" class="autocomplete red-text" >
</div>
</div>
</div>
</div>
</li>
<li>Sass</li>
<li>Components</li>
<li>JavaScript</li>
</ul>
</div>
</nav>
Or this way:
<nav class="blue">
<div class="nav-wrapper">
<i class="material-icons">cloud</i>Logon
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li>
<form>
<div class="input-field">
<input id="search" type="search" required>
<label class="label-icon" for="search"><i class="material-icons">search</i></label>
<i class="material-icons">close</i>
</div>
</form>
</li>
<li>Sass</li>
<li>Components</li>
<li>JavaScript</li>
</ul>
</div>
</nav>