Adding PNG IMage to Twitter Bootstrap header

Posted on 2014-03-26
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:



Open in new window

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


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!
Question by:VBBRett

Accepted Solution

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;'?

    background-image: yourPnghere.png
    background-size: cover;

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

- Chris

Author Comment

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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
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.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

839 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