1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

CSS to fill background of a transparent png button - IE and Firefox Compatability

Discussion in 'CSS' started by forumposters, Oct 29, 2007.

  1. #1
    How would you code the CSS so that this button will show up with a blue background color using CSS and look good in both Firefox and Internet Explorer?

    [img=http://img517.imageshack.us/img517/4042/viewcartcheckoutbuttonkj2.png]

    Here's what works in Firefox:

    CSS
    div.transparentCartCheckoutButton img {
    	margin-left:-2px;
    	margin-top:-2px;
    	margin-bottom:-8px;
    }
    a img{
    	filter:alpha(opacity=100);
    	opacity:1;
    	-moz-opacity:1;
    	/*border-color: #393837;
    	border-width: thin;*/
    }
    div.transparentCartCheckoutButton {
    	width:181px;
    }
    
    Code (markup):
    HTML
    
    <div class="transparentCartCheckoutButton c">
       <a href="/ceilingtile_shoppingcart2.cfm" ><img src="/images/viewcart_checkoutbutton.png" ></a>
    </div>
    
    Code (markup):
    This looks great in Firefox, but this does not look right in Internet Explorer. The colored background extends wider and higher than the transparent image.
     
    forumposters, Oct 29, 2007 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #2
    I'd color the image... and if I cared about color matching, I'd use a .gif instead of a .png

    You're throwing code at a problem that should take five seconds to fix in a image editor.
     
    deathshadow, Oct 29, 2007 IP