Background Image for H2

Posted on 2006-04-29
Last Modified: 2012-06-27
I have a situation, in which I am using H2 for headers of a page.

this works:
h2 {
      font-size: 110%;
      /*background:url(/images/corner.gif) no-repeat top right;*/
      border-bottom:1px solid #0099FF;
      padding:2px 0px 2px 5px;

however, you can see the commented area is another image that makes it look like there is an angled corner.  However, I am obliviosly going about this the wrong way, because an element cannot have 2 background images.

How can I work around this?   I have tried making a div with the corner bg image, and tried wrapping the H2 in it, no dice.......
Question by:kevp75
    LVL 25

    Author Comment

    got it:

    h2 {
          font-size: 110%;
          /*background: #C6D5FD url(/images/corner.gif) no-repeat top right;*/
          border-bottom:1px solid #0099FF;
          padding:2px 0px 2px 5px;
    h2 div {
          background:url(/images/corner.gif) no-repeat top right;

    then for the H2 I do this
    <h2><div>Header Text</div></h2>

    Accepted Solution

    Closed, 125 points refunded.
    The Experts Exchange
    Community Support Moderator of all Ages

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
    When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
    In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
    In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now