简体   繁体   中英

How to make my navbar-brand responsive on low resolution?

My navbar-brand goes down when I resize my browser or either I use it on my low resolution mobile device.

Here's my jsfiddle

My NavBar Code:

<div class="navbar navbar-default" id="page">
    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="index.php"><img src="img/feueac-logo.png" style="position:absolute; width:30px; height:35px; top:7px; left:5px;" /><span style="padding-left:25px; padding-top:0px;" class="navbar-brand" >FEU - EAC  E - Project System</span></a>
    </div>
    <div class="navbar-collapse collapse navbar-responsive-collapse">
        <ul class="nav navbar-nav">
            <li class="active"><a href="index.php">Home</a></li>
            <li><a href="client.php">Client Application</a></li>
            <li><a href="about.php">About Us</a></li>
            <li><a href="contact.php">Contact Us</a></li>
            <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Login <b class="caret"></b></a>
                <ul class="dropdown-menu">
                    <li id="modal_trigger" href="#modal" class="btn_red"><a href="#">Faculty</a></li>
                    <li id="modal_trigger2" href="#modal2" class="btn_red"><a href="#">Student</a></li>
                    <li class="divider"></li>
                    <li id="modal_trigger3" href="#modal3" class="btn_red"><a href="#">Guest</a></li>
                </ul>
            </li>
        </ul>
        <form class="navbar-form navbar-left">
            <p style="padding-left:20px; padding-top:4px;">
                <input type="text" class="form-control col-lg-8" placeholder="Search" style="width:300px; height:30px;">
        </form>
    </div>
</div>

Here's some examples :

Good:

赞美

Bad:

屏幕截图不好

Worse:

屏幕截图更糟

I've had luck using FitText , a jQuery plugin that fits text to it's parent element.

From their website:

FitText makes font-sizes flexible. Use this plugin on your fluid or responsive layout to achieve scalable headlines that fill the width of a parent element.

Not exactly an "answer" (which there may be none of for this question), but a decent solution.

Good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM