473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

CSS image shrink!

158 100+
I'm trying to "shrink" an image down to size so that my border will fit around it instead of just the top left corner. Any ideas?

Thanks in advance!
Matt
Nov 4 '08 #1
4 16533
Death Slaught
1,137 1GB
There are several ways to do this I suggest one of the following.

1) You can use an image editing software to shrink the image. I recommend GIMP .

2) Use CSS to adjust the width and height of your image.

If you are using the image as a background image you would have to use the first option. If this doesn't help or you would like an example please post the code you are currently using, and I would be glad to help.

Thanks,
{\_/}
(' . ')
(")[DEATH](")
(")(")
Nov 4 '08 #2
Jollywg
158 100+
Expand|Select|Wrap|Line Numbers
  1.             #Info1 {width: 300px;
  2.                 float: left;
  3.                 height: 12em;
  4.                 position: normal;
  5.                 font-family: arial, sans-serif; 
  6.                 color: black;
  7.                 font-size: .9em;
  8.                 padding-bottom: .5em;
  9.                 text-align: left;
  10.                 border: ridge;
  11.                 border-width: .5em;
  12.                 border-color:  rgb(255,100,0);
  13.                 background-color: transparent;
  14.                 background-image: url("CBTGroup.jpg");
  15.                 background-size: 50%;}
Here is the chunk of code that is dealing with the image. I've tried using height and width set at 50px each where the background-size is used, but didn't seem to work?

Thanks
Nov 4 '08 #3
Death Slaught
1,137 1GB
Images are inline elements and while using percentages with the background-size property, it will only work on block-level elements. For more information and examples on using the background-size property click here.

Thanks,
{\_/}
(' . ')
(")[DEATH](")
(")(")
Nov 4 '08 #4
Jollywg
158 100+
I typed in display: block; and it worked like a charm!

Thanks Death Slaught!!
Nov 6 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Michael Rozdoba | last post by:
I've tried to apply something along the lines of http://www.spartanicus.utvinternet.ie/test/caption_sized_to_image.htm to a floated span containing an image & caption, but I can't find anything...
1
by: S Shulman | last post by:
Hi all I am looking for some function that allow image changes specifically shrink an image to use from my vb program. It can either be some paint api or load the image to the program from a...
4
by: Bob Richardson | last post by:
Is it possible for an image to SHRINK (both height and width, keeping same h/w ratio) when the browser's width is reduced? It's easy to have both h & w increase, as needed, to fill up 100% of the...
2
by: cjl | last post by:
Hey all: I have a div of a known size, 672px X 672px. In it I will display images that are of unknown size. I have two simple functions that shrink and center the image: function shrink() {...
2
by: Tim T | last post by:
Hi, Could someone please point to to a tutorial / code for dynamically resizing images on upload, THEN saving to disk on the webserver. I need users to be able to upload images to my server, but...
11
by: Chris Beall | last post by:
See http://pages.prodigy.net/chris_beall/Demo/photo%20block%20experiments.html I've ended up with what seems like a rather complex structure for what I thought would be a somewhat simple...
11
by: Chamnap | last post by:
Hello, I have several images that need to be loaded dynamically based on user interaction. Each image size is about 6000x1500 pixels. I see several sites they make the image blur, blur, blur,...
1
by: bluedolphin | last post by:
I am trying to use javascript to detect the size of a image, so that I could show it in proper size. Such as I have a space which is 32 X 32, and the image size is 256 * 128, then I could shrink...
1
by: shrutikaghosh | last post by:
Hi, I want to shrink the background image to fit the size of <div>. It is somethiing like: <div style="BACKGROUND: url(./images/2008calendar.jpg) left top;"> this is my text </div> The...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.