background in div is not resizing in bootstrap - html

When adding a background to a div and resizing the screen the background image stays where it is and does not respond to resizing in the new smaller screen
<section id="contact">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 style="color: #adaaad">contact</h2>
<br>
</div>
</div>
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<!-- To configure the contact form email address, go to mail/contact_me.php and update the email address in the PHP file on line 19. -->
<!-- The form should work on most web servers, but if the form is not working you may need to configure your web server differently. -->
<form name="sentMessage" id="contactForm" novalidate>
<div class="row control-group">
<div class="form-group col-xs-12 floating-label-form-group controls">
<label class="aligntextright">name</label>
<input type="text" class="form-control" placeholder="name" id="name" required data-validation-required-message="name">
<p class="help-block text-danger"></p>
</div>
</div>
<div class="row control-group">
<div class="form-group col-xs-12 floating-label-form-group controls">
<label class="aligntextright">email</label>
<input type="email" class="form-control" placeholder="email" id="email" required data-validation-required-message="input email">
<p class="help-block text-danger"></p>
</div>
</div>
<div class="row control-group">
<div class="form-group col-xs-12 floating-label-form-group controls">
<label class="aligntextright">number</label>
<input type="tel" class="form-control" placeholder="number" id="phone" required data-validation-required-message=" input number">
<p class="help-block text-danger"></p>
</div>
</div>
<div class="row control-group">
<div class="form-group col-xs-12 floating-label-form-group controls">
<label class="aligntextright">message</label>
<textarea rows="5" class="form-control" placeholder="message" id="message" required data-validation-required-message="enter message"></textarea>
<p class="help-block text-danger"></p>
</div>
</div>
<br>
<div id="success"></div>
<div class="row">
<div class="form-group col-xs-12">
<button type="submit" class="btn btn-success btn-lg">send</button>
</div>
</div>
</form>
</div>
</div>
</div>
</section>
#contact{
background: url("img/style.png") no-repeat right 0;
}

This Css works fine
background-size: 100% auto;

Related

Slowly Rendered Html page

I am trying to make a Sign-UP form in html and CSS with notepad++ but whenever I try to run it on chrome, it loads very slowly. Is it a configuration error or something? What am I doing wrong? Is there a plugin needed? This is my entire code:
<body>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">Register</div>
<div class="card-body">
<div class="form-group row">
<label for="full_name" class="col-md-4 ">Full Name</label>
<div class="col-md-6">
<input type="text" class="form-control" name="full-name">
</div>
</div>
<div class="form-group row">
<label for="email_address" class="col-md-4 ">E-Mail Address</label>
<div class="col-md-6">
<input type="text" class="form-control" name="email-address">
</div>
</div>
<div class="form-group row">
<label for="user_name" class="col-md-4 ">User Name</label>
<div class="col-md-6">
<input type="text" class="form-control" name="username">
</div>
</div>
<div class="form-group row">
<label for="password" class="col-md-4 ">Password</label>
<div class="col-md-6">
<input type="password" class="form-control">
</div>
</div>
<div class="col-md-6 stylish" offset-md-4>
<button type="submit" class="btn btn-primary"">
Register
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
Add the bootstrap and jQuery plugins.
In HTML page link the external files properly.
In head section add the external links.
Maintain the folder structure neat so that linking extrnal files is easy.
If everything is correct go to this link to set up Chrome: https://www.webnots.com/fix-slow-page-loading-issue-in-google-chrome/
<!DOCTYPE html>
<html>
<body>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">Register</div>
<div class="card-body">
<div class="form-group row">
<label for="full_name" class="col-md-4 ">Full Name</label>
<div class="col-md-6">
<input type="text" class="form-control" name="full-name">
</div>
</div>
<div class="form-group row">
<label for="email_address" class="col-md-4 ">E-Mail Address</label>
<div class="col-md-6">
<input type="text" class="form-control" name="email-address">
</div>
</div>
<div class="form-group row">
<label for="user_name" class="col-md-4 ">User Name</label>
<div class="col-md-6">
<input type="text" class="form-control" name="username">
</div>
</div>
<div class="form-group row">
<label for="password" class="col-md-4 ">Password</label>
<div class="col-md-6">
<input type="password" class="form-control">
</div>
</div>
<div class="col-md-6 stylish" offset-md-4>
<button type="submit" class="btn btn-primary"">
Register
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

How to make input with exact column width in bootstrap

why my email input not occupying full width in bootstrap column
I am using bootstrap and opening this html page with visual studio project's default base layout
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-8 col-md-6 col-sm-offset-2 col-md-offset-3">
<form role="form">
<hr>
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="form-group">
<input type="text" name="UserFirstName" id="UserFirstName" class="form-control input-lg" placeholder="First Name" tabindex="1" required autocomplete="on">
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="form-group">
<input type="text" name="UserLastName" id="UserLastName" class="form-control input-lg" placeholder="Last Name" tabindex="2" required autocomplete="on">
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="form-group">
<input type="text" name="MobileNumber" id="MobileNumber" class="form-control input-lg " placeholder="Mobile # (92)321-2255434" tabindex="3" required autocomplete="on" data-mask="(99)-999-9999999">
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="form-group">
<input type="text" name="BusinessName" id="BusinessName" class="form-control input-lg" placeholder="Business Name" tabindex="4" required autocomplete="on">
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<div class="form-group ">
<input type="email" name="Email" id="Email" class="form-control input-lg" placeholder="Valid Email Address (For Varification)" tabindex="5" required autocomplete="on">
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="form-group">
<input type="password" name="password" id="Password" class="form-control input-lg" placeholder="Password" tabindex="6" required autocomplete="off">
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="form-group">
<input type="password" name="ConfirmPassword" id="ConfirmPassword" class="form-control input-lg" placeholder="Confirm Password" tabindex="7" required autocomplete="off">
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-xs-12 col-md-6">
<input type="submit" value="Register" class="btn btn-primary btn-block btn-lg" tabindex="7">
</div>
<div class="col-xs-12 col-md-6">Sign In</div>
</div>
<div class="row">
#Html.ValidationSummary("", new { #class = "text-danger" })
</div>
</form>
</div>
</div>
</div>
for your convenience I am attaching image file also, so kindly if some one can help me out

Input Fields aren't aligning in form-inline or form-horizontal

I really need some help here. I've been messing with this form all day and I can't get these boxes to show where I need them to. I'll include a picture below of how I want it to look. I've been trying different things with form-inline and form-horizontal but it's just not working.
Any help would be appreciated.
Here's some of what I've been trying:
<form class="form-horizontal">
<div class="col-md-6">
<h4>Shipping Address</h4>
<hr>
</div>
<div class="col-md-6">
<h4>Contact Info</h4>
<hr>
</div>
<div class="col-md-12">
<div class="form-group row">
<label for="inputKey" class="col-md-2 control-label">First Name</label>
<div class="col-md-4">
<input type="text" class="form-control" id="inputKey" placeholder="First Name">
</div>
<label for="inputValue" class="col-md-3 control-label">Email Address</label>
<div class="col-md-4">
<input type="text" class="form-control" id="inputValue" placeholder="Email Address">
</div>
</div>
</div>
</form>
You just need to make sure you're using the correct rows/cols, and don't use form-horizonal along with the grid columns.
<form class="row">
<div class="col-md-6">
<h4>Shipping Address</h4>
<hr>
</div>
<div class="col-md-6">
<h4>Contact Info</h4>
<hr>
</div>
<div class="col-md-12">
<div class="form-group row">
<label for="inputKey" class="col-md-2 control-label">Key</label>
<div class="col-md-4">
<input type="text" class="form-control" id="inputKey" placeholder="Key">
</div>
<label for="inputValue" class="col-md-2 control-label">Other</label>
<div class="col-md-4">
<input type="text" class="form-control" id="inputValue" placeholder="Value">
</div>
</div>
<div class="form-group row">
<label for="inputKey" class="col-md-2 control-label">State</label>
<div class="col-md-2">
<input type="text" class="form-control" id="inputSt" placeholder="ST">
</div>
<div class="col-md-2">
<input type="text" class="form-control" id="inputZip" placeholder="Zip">
</div>
<label for="inputValue" class="col-md-2 control-label">Other</label>
<div class="col-md-4">
<input type="text" class="form-control" id="inputValue" placeholder="Value">
</div>
</div>
</div>
</form>
http://www.codeply.com/go/e92EivkCaq

Two of my pages have a small gap under the footer

All of my other pages do not have this gap, I am using Bootstrap but am a beginner. What do you think it could be? Is the whole page coded wrong because the contact form works fine, just when I am on a mobile device I can see a very thin white line under the footer.
<div class="section-md">
<div class="container container-normal">
<div class="row">
<div class="col-md-6 col-sm-6 col-md-offset-3 col-sm-offset-3">
<div class="panel panel-default">
<div class="panel-body">
<?php if (isset($_SESSION[ 'contact_success'])): ?>
<h2>Message Sent</h2>
<div class="alert alert-success">
Your information has been received. We will contact you within 1 business day.
</div>
Back to Homepage
<?php unset($_SESSION[ 'contact_success']) ?>
<?php else: ?>
<h1>Contact Us</h1>
<p class="text-muted">This is our contact page...</p>
<hr>
<div class="error-msg alert alert-danger cnt-error">
<p>Please fill in all required fields.</p>
</div>
<form id="contact_form" action="<?= site_url() ?>contact/save" method="post">
<div class="form-group">
<label for="name" class="form-label">Your Name*</label>
<input id="cnt_name" type="text" class="form-control" name="name" placeholder="Your Name">
</div>
<div class="form-group">
<label for="email" class="form-label">Your Email*</label>
<input id="cnt_email" type="text" class="form-control" name="email" placeholder="user#example.com">
</div>
<div class="form-group">
<label for="subject" class="form-label">Subject*</label>
<input id="cnt_subject" type="text" class="form-control" name="subject" placeholder="This website rocks">
</div>
<div class="form-group">
<label for="message" class="form-label">Comments*</label>
<textarea id="cnt_message" class="form-control" name="message" rows="10" placeholder="Enter a few questions in here..."></textarea>
</div>
<div class="form-group">
<button class="btn btn-primary">Submit</button>
Cancel
</div>
<!-- /.form-group -->
</form>
<?php endif ?>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /.section-md -->
I think you had margin in your
Let's try this code
body{
margin: 0;
}

Center content in Bootstrap Col

I am trying to center a form in the center of the page, but everytime I center the col, the contents get pushed to the left side of that col. I want the form to be the full width of the col-md-6 and that col centered in the middle of the page.
<div class="col-md-6 col-md-offset-3">
<div class="row">
<div class="col-md-2">Your Name:</div>
<div class="col-md-4">
<input type="text" name="uname" class="form-control" required="" placeholder="Your Name">
</div>
</div>
<div class="row">
<div class="col-md-2">Your Email:</div>
<div class="col-md-4">
<input type="email" name="email" class="form-control" required="" placeholder="Email Address">
</div>
</div>
<div class="row">
<div class="col-md-2">Your Company:</div>
<div class="col-md-4">
<input type="text" name="company" class="form-control" required="" placeholder="Company Name">
</div>
</div>
<div class="row">
<div class="col-md-2">Your Contact:</div>
<div class="col-md-4">
<input type="email" name="contactemail" class="form-control" required="" placeholder="Email Address">
</div>
</div>
<div class="row">
<div class="col-md-2">Choose file(s):</div>
<div class="col-md-4">
<input name="files" type="file" id="files" multiple="multiple" class="form-control" required="">
</div>
</div>
<div class="row">
<div class="col-md-2">
<h5></h5>
</div>
<div class="col-md-4">
<input id="sbmtBtn" type="submit" name="submit" value="Upload" class="btn btn-primary btn-lg btn-block">
</div>
</div>
http://www.bootply.com/OiRABZIff0
Add col-md-offset-3 before col-md-2.
Have a look at the bootply here
Also not that col should be defined within rows and rows should be encapsulated within container, so I modified the html structure a bit as well.
Change your
<div class="col-md-6 col-md-offset-3">
to
<div class="col-md-7 col-md-offset-4">
I have edited. check out this help you.
http://www.bootply.com/QnYcyyIh2V