PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, November 18, 2022

[FIXED] How can I vertically align this navigation bar?

 November 18, 2022     css, html, navbar, vertical-alignment     No comments   

Issue

I have a navigation bar, but i don't know how to vertically align some classes. I use bootstrap. The navigation bar is fixed position. The navbar is divided into 3 row. The search row is OK, but I can't vertically align the another rows.

Here is the HTML:

                <div class="col-sm-10" >
                    <p>Reményik Tudástár</p>
                </div>
            </div>
        </div>
    </div>

        <div class="col-sm-4 navbar-search vertical-align">
            <div class="container-fluid">
                <div class="row vertical-align">
                    <div class="col-sm-1"></div>
                        <div class="col-sm-9" style="padding: 0;">
                            <input type="text" name="search" class="navbar-search-input" placeholder="Keresés">
                        </div>

                        <div class="col-sm-1" style="">
                            <button class="navbar-search-button"><i class="fa fa-search"></i></button>
                        </div>
                    <div class="col-sm-1"></div>
                </div>
            </div>
        </div>

    <div class="col-sm-4 navbar-login" style="">
        <div class="container-fluid">
            <div class="row">
                <div class="col-sm-10">
                    <p style="float: right;">Bejelentkezés</p>
                </div>

                <div class="col-sm-2">
                    <span class="fa fa-sign-in fa-2x"></span>
                </div>
            </div>
        </div>
    </div>
</div>

and here is the CSS:

.navigation-bar {
    background-image: url("../img/nav_background.png");
    padding: 15px;
    box-shadow: 0px 2px 5px #999999;
}

.navbar-search-input {
    width: 100%;
    border: 0;
    border-radius: 3px 0 0 3px;
    height: 35px;
    padding: 10px;
}

.navbar-search-button {
    background-color: #203138;
    color: #fff;
    margin-right: 100%;
    border: 0;
    border-radius: 0 3px 3px 0;
    height: 35px;
    padding-left: 12px;
    padding-right: 12px;
}

So, how can I vertically align the logo and the cim class?


Solution

Try this:-

display: inline-block;
    *display: inline;
    vertical-align: middle;


Answered By - Razia sultana
Answer Checked By - Mildred Charles (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing