Jump to content


Photo

Trouble with scaling image in CSS


  • Please log in to reply
3 replies to this topic

#1 phpjayx

phpjayx

    Advanced Member

  • Members
  • PipPipPip
  • 60 posts

Posted 14 January 2013 - 12:33 AM

I have the simple text below for my button, which in its original form is 125x125 pixels. It doesn't scale it on my page, all it does is clip the image at 50x50 pixels.... what am I doing wrong here?

.myButton1 {
background:url(/Button1.png) no-repeat;
cursor:pointer;
width: 50px;
height: 50px;
border: none;

}

---------------------------in my js file

cellHtml += ' <input class="myButton1 margin_top_20px" onclick="' + onclickType2 + '" type="button">';

#2 BagoZonde

BagoZonde

    Advanced Member

  • Members
  • PipPipPip
  • 69 posts

Posted 15 January 2013 - 04:46 AM

You can't scale backgrounds, that's it.
A=1-A ...from Basic...
$a=1-$a ...thru PHP...
LDA $01 EOR #1 ...to 6502 ASM :}

Does it mean I'm going low-level?! ;]

#3 White_Lily

White_Lily

    Advanced Member

  • Members
  • PipPipPip
  • 521 posts

Posted 25 January 2013 - 08:21 AM

Actually - you can scale backgrounds using CSS3, however most (if not all) browsers are not supporting this method.

"In order to be irreplaceable, one needs to be different from another."

CMS Development: http://cms.janedeaslart.co.uk/


#4 BagoZonde

BagoZonde

    Advanced Member

  • Members
  • PipPipPip
  • 69 posts

Posted 25 January 2013 - 08:46 AM

Check this out with background-size property:

http://www.w3schools...background-size

Status: No support for <=IE8, unfortunately lot people using oldie IE. You know your target so decide if it's worth to use it.

Opera, Safari, Firefox, Chrome in newest versions and IE9 seems to work properly.
A=1-A ...from Basic...
$a=1-$a ...thru PHP...
LDA $01 EOR #1 ...to 6502 ASM :}

Does it mean I'm going low-level?! ;]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com