Link to home
Start Free TrialLog in
Avatar of kevp75
kevp75Flag for United States of America

asked on

Background Image for H2

I have a situation, in which I am using H2 for headers of a page.

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

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.......
Avatar of kevp75
kevp75
Flag of United States of America image

ASKER

got it:

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

then for the H2 I do this
<h2><div>Header Text</div></h2>
ASKER CERTIFIED SOLUTION
Avatar of GranMod
GranMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial