Solved

Adding PNG IMage to Twitter Bootstrap header

Posted on 2014-03-26
2
4,653 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
[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 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

724 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