Resizing cell background images |
Resizing cell background images |
Omar |
Mar 21 2007, 08:03 PM
Post
#1
|
Group: Members Posts: 3 Joined: 21-March 07 Member No.: 2,284 |
Hi guys, I am trying to have a cell in a table with a background image pulled from a text file. Then the actual image in the cell is a transparent GIF with either "Active", "Sold" etc on it, which creates a layer effect. My plan works so far except that I can't seem to resize the image once it is set to the background of the cell. I know it can be done because I have seen it on other pages, I just can't seem to replicate it. $imageback is the name of the image as pulled from a file in Perl. Here is what I have:
<style type="text/css"> .imgback { background-image:url($imagepath);} </style> <table width=162 border=0 cellpadding=0 cellspacing=0 bordercolor=black style="border-collapse: collapse"> <td class="imgback" style="background-image:url($imagepath);width:100px;height:75px"> <a href="$link" target="main_page"> <img src="../active.gif" width=160 height=105></a></td></tr> I know I have background-image:url twice but it's the only way it works. If I remove the class line, my page comes up as an error. I need to know how to set the background image to be 100x75. Can anyone help? Thanks! |
pandy |
Mar 21 2007, 08:12 PM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,733 Joined: 9-August 06 Member No.: 6 |
No, you can't resize it. But you can use CSS to make it not repeat and place it for example in the center of the cell. Would that do?
http://www.w3.org/TR/CSS2/colors.html#q2 |
Omar |
Mar 21 2007, 08:28 PM
Post
#3
|
Group: Members Posts: 3 Joined: 21-March 07 Member No.: 2,284 |
Well, I have seen it done on LoopNet and that effect is what I am trying to duplicate.
<td id=& quot;MyListingResultGrid_SearchResultsGridItemMyListings14432571_tdBackgroundIma ge" valign="top" class="myListingThumbnailFS" style="background-image: url(/Attachments/E/4/8/E485F73A-9D02-41B2-8C31-9CA4D1B80AC1_tn.jpg);"><a id=& quot;MyListingResultGrid_SearchResultsGridItemMyListings14432571_PropertyThumbNa ilPhotoImageLink1" title="29 LOTS IN LOST CREEK" href="/xNet/MainSite/Listing/Profile/Profile.aspx?LID=14432571&SearchID=208426517&SearchResultID=208426517&ResultCount=46&PageNumber=1&FromLocation=mylistingfs&ItemIndex=1&PageSize=20&PgCxtGuid=d00801f2-d7ee-426c-b427-0c400a81a05b&PgCxtFLKey=&PgCxtCurFLKey=MyListingsFS&PgCxtDir=Down" style="border-width:1px;border-style:solid;height:75px;width:100px;"><img title="29 LOTS IN LOST CREEK" src="http://images.loopnet.com/images/labels/incontractBlue.gif" border="0" /></a></td> This does what I need but I can't chop out the elements right. I looked at their my ListingThumbnail class and all it has is a border and position setting. The A tag is the only thing that has the height and width mentioned except for this: <STYLE TYPE="text/css"> .fontClass {FONT-SIZE: 10px; Background-color:#ffffff; width:100px;} .capfontClass { FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #ffffff;line-height: 18px; width:100px;} .bgClass { BACKGROUND-IMAGE: url(http://images.loopnet.com/images/bubble/partgrad.gif);background-repeat:repeat-x; width:100px;} </STYLE> But I can't find where bgClass is used in the actual code. Any other ideas for me? I'm trying to do this without going into Photoshop and making smaller pics by hand. My test page: http://web1.yourwebpress.com/~kentarnold/c...in/listings4.pl |
pandy |
Mar 21 2007, 11:08 PM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,733 Joined: 9-August 06 Member No.: 6 |
You may have seen resizing images, but it wasn't background images. Can you link to the page where you've seen it?
|
Omar |
Mar 21 2007, 11:15 PM
Post
#5
|
Group: Members Posts: 3 Joined: 21-March 07 Member No.: 2,284 |
http://www.loopnet.com/xNet/MainSite/Listi...p;LinkCode=1690
That may not work without a login. If you can't resize background images using style sheets, is there a program or an easy way to get thumbnails without opening 1 at a time in Photoshop? Something where you can specify a wanted size and do a whole folder at once? |
pandy |
Mar 22 2007, 03:11 AM
Post
#6
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,733 Joined: 9-August 06 Member No.: 6 |
Yeah, requires login.
Photo Shop can batch resize, it think. I assumed the pages were dynamic and that the desired size of the image couldn't be known. Was that wrong? |
Lo-Fi Version | Time is now: 28th April 2024 - 09:01 AM |