Solved

Bootstrap css to change alignment without using padding

Posted on 2016-11-25
3
71 Views
Last Modified: 2016-11-26
    <div id="custom-bootstrap-menu" class="navbar navbar-default " role="navigation">
    <div class="container">
        <div class="navbar-header"><a class="navbar-brand" href="#">
     
        <img src="logo-small.png" ></a>
  
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-menubuilder"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
            </button>
        </div>
        <div class="collapse navbar-collapse navbar-menubuilder">
            <ul class="nav navbar-nav navbar-right">

      <div class= "text">
      <input type="text" name="username" id="username" class= "input" placeholder="Username" value="" required>
      <input type="password" name="password" class= "input" id="password" placeholder="Password" required>
<button type="button" class="btn btn-primary">Sign-in</button>
     </div>
    <div class="col-md-11 text-right button password">
    <a href="forgot.php">Forgot your Password? </a>
    </div>
   
            </ul>
        </div>
    </div>
</div>

Open in new window


My username and password, are all the way to the top of the page, how can I center them and make forgot password be under password?
My css:
#custom-bootstrap-menu.navbar-default .navbar-brand
{
    color: rgb(255, 255, 255);
    text-transform: uppercase;
    font-family: 'Times New Roman' , Times, serif;
    font-size: x-large;
    font-weight: bold;
	padding-bottom: 65px;
}
#custom-bootstrap-menu.navbar-default {
    font-size: 14px;  
    border-width: 1px;
    border-radius: 0px;
    background: #333;
	background: rgba(51, 51, 51, 0.1);
	border: 0;
	-o-transition: all .3s; -moz-transition: all .3s; -webkit-transition: all .3s; -ms-transition: all .3s; transition: all .3s;
	
}
#custom-bootstrap-menu.navbar-default .navbar-nav > li > a
{
    background-color: rgba(248, 248, 248, 0);
    color: #FFFFFF;
	padding-top: 30px;
}
#custom-bootstrap-menu.navbar-default .navbar-nav > li > a:hover, #custom-bootstrap-menu.navbar-default .navbar-nav > li > a:focus
{
    color: rgb(153, 255, 204);
    background-color: rgba(248, 248, 248, 0);
}
#custom-bootstrap-menu.navbar-default .navbar-nav>.active>a,
#custom-bootstrap-menu.navbar-default .navbar-nav>.active>a:hover,
#custom-bootstrap-menu.navbar-default .navbar-nav>.active>a:focus {
    color: rgba(85, 85, 85, 1);
    background-color: rgba(231, 231, 231, 1);
}
#custom-bootstrap-menu.navbar-default .navbar-toggle {
    border-color: #ddd;
}
#custom-bootstrap-menu.navbar-default .navbar-toggle:hover,
#custom-bootstrap-menu.navbar-default .navbar-toggle:focus {
    background-color: #ddd;
}
#custom-bootstrap-menu.navbar-default .navbar-toggle .icon-bar {
    background-color: #888;
}
#custom-bootstrap-menu.navbar-default .navbar-toggle:hover .icon-bar,
#custom-bootstrap-menu.navbar-default .navbar-toggle:focus .icon-bar {
    background-color: #888;
}

Open in new window

0
Comment
Question by:Jasmine Ikhreishi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Author Comment

by:Jasmine Ikhreishi
ID: 41901659
I did this jfiddle
https://jsfiddle.net/jasmine825/ezs9ncyc/

there is an image on the right, I want there to be padding instead it being stuck to the top
0
 
LVL 1

Author Comment

by:Jasmine Ikhreishi
ID: 41901661
But with using vertical aligiment?
0
 
LVL 57

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 41902541
Some notes
1. Your fiddle does not include Bootstrap so the bootstrap styles are not in effect
2. Your code is contained inside <ul> tags but with no <li> - so it is invalid
3. Your Forgot password is inside a col-md-11 - why not col-md12
4. You need to put your col- classes inside a row class container to get rid of the margin's the former create.

Something like this (assumes you included your Bootstrap CSS)
<div id="custom-bootstrap-menu" class="navbar navbar-default " role="navigation">
  <div class="container">
    <div class="navbar-header"><a class="navbar-brand" href="#">
      <img src="logo-small.png" ></a>
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-menubuilder"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button>
    </div>
    <div class="collapse navbar-collapse navbar-menubuilder">
      <ul class="nav navbar-nav navbar-right">
        <li>
          <div class= "text">
            <input type="text" name="username" id="username" class= "input" placeholder="Username" value="" required>
            <input type="password" name="password" class= "input" id="password" placeholder="Password" required>
            <button type="button" class="btn btn-primary">Sign-in</button>
          </div>
          <div class="row">
            <div class="col-md-12 text-right button password">
              <a href="forgot.php">Forgot your Password? </a>
            </div>
          </div>
        </li>
      </ul>
    </div>
  </div>
</div>

Open in new window

Sample here
0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question