Solved

Adding PNG IMage to Twitter Bootstrap header

Posted on 2014-03-26
2
4,555 Views
Last Modified: 2014-03-26
I've recently used Twitter Boostrap has a base for my design for my web application.  Unfortunately, as with any framework including CSS, it comes with a learning curve.  I have been tasked with adding a background image to the bootstrap header but unfortunately, it does not stretch enough to cover the header.  So for the nav header section, if I were to add the following code:

.navbar.navbar-inverse.navbar-fixed-top{
    background-color:black;
    position:static;
    height:100px;
    

}

Open in new window

the header appears fine.  But if I were to add the following code:

.navbar.navbar-inverse.navbar-fixed-top{
    background-image:
    position:static;
    height:100px;   
}

Open in new window


it doesn't look good.  The png image doesn't stretch to be the full height of the header.  How do I fix this?  Thanks!
0
Comment
Question by:VBBRett
2 Comments
 
LVL 8

Accepted Solution

by:
soupBoy earned 500 total points
ID: 39956548
I don't know if this would work as I haven't toyed with Bootstrap much, but have you tried adding 'background-size: cover;'?

Example:
.navbar.navbar-inverse.navbar-fixed-top{
    background-image: yourPnghere.png
    background-size: cover;
    position:static;
    height:100px;  
}

If you could provide a link of the broken version (with png file not stretched) it would be helpful to debug...

- Chris
0
 

Author Comment

by:VBBRett
ID: 39956571
WHOA!  That worked, awesome!  500 points for you!
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

809 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