Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    Regular Coder
    Join Date
    Apr 2003
    Location
    Seoul, Korea
    Posts
    329
    Thanks
    0
    Thanked 0 Times in 0 Posts

    adjusting the size of a background image

    Code:
    <table cellpadding="0" cellspacing="0" border="0">
    	<tr>	
    		<td width="100" height="100" background="test.gif"></td>	
    	</tr>
    </table>
    I have the above code.

    The size of the test.gif can be 120*150, 140*110 or others.
    I like to make the test.gif to be shown as 100*100 regardless of its original size.

    The following code can adjust image size.

    <img src="test.gif" width="100" height="100">

    But I like to adjust it as a background image.

    Thank you very much
    Get my greedy up

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    I'm pretty sure that you can't adjust the size of a background image.

  • #3
    Senior Coder
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    2,469
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't think you can adjust the size of a background image. It only goes by your original size.
    // Art is what you can get away with. <-- Andy Warhol
    ...:.:::: bradyjfrey.com : htmldog : ::::.:...

  • #4
    Senior Coder
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    1,963
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You'll have to wait for CSS3 before you can do that.... See you in 10 years when there's some decent browser support

    I take no responsibility for the above nonsense.


    Left Justified

  • #5
    Registered User
    Join Date
    Apr 2004
    Location
    Oregon
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah you are stuck editing the size through a image editor of some kind

  • #6
    Regular Coder
    Join Date
    Jan 2003
    Posts
    400
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ive asked this question b4. Its annoying. Just resize your image to 5000 x 5000 (or somewhat close) in an image editor. And then set it as your bg. It will resize to fit your browser size perfect

  • #7
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by l3vi
    Ive asked this question b4. Its annoying. Just resize your image to 5000 x 5000 (or somewhat close) in an image editor. And then set it as your bg. It will resize to fit your browser size perfect
    But you'll have to wait hours for the 25 megapixels to download!
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

  • #8
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    Well this may not be correct for all types of browser but:

    If your are building your site to take account of resolution settings of 1024 x768 and 800 x 600 (possibly 640x480) they are sized in a proportion of 4:3 eg 400px X 300px like a normel UK television.

    so you could make an image in your image editor thats a bit smaller than 800x600 (I've misplaced the actual dimensions - which are variable anyway due to the different configurations ppl use at the top) and, cut and paste it to a larger plain image that would overfill your browser window. This would give you your background in its correct proportion and with a border around it so that it doesn't repeat within the window.

    Then for those at 1024 x 768, your image would be the same and the background too, but the border would appear bigger and the image should still be centered if your use the existing css2.

    Alternatively, you might find a Javascript that enables you to have two images and the browser determined which one is produced depending on the settings of the individual user. (might take a cookie - dunno about them yet).

    Bazz
    Last edited by bazz; 04-15-2004 at 01:41 PM.
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #9
    Regular Coder
    Join Date
    Apr 2003
    Location
    Seoul, Korea
    Posts
    329
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <td style="background: url(test.gif); height: 100px; width: 100px;"></td>
    The above code will show the test.gif as a background image.

    Although the size of the original image is 300*300, the above code make it
    100*100.

    But it has one problem, i.e. it shows only one third of the image.

    For example,
    if it is the image of my face, it shows only my right hairs and forehead.
    it doesn't show my nose, lips and chin.

    I like to show my whole face including left hairs, left forehead, eyes, nose, lips, and chin as a background image with adjusting the size into 100*100 from the original size 300*300.


    Is there no way to do this?
    I am still hunger for finding this.

    Thanks in Advance
    Get my greedy up

  • #10
    Senior Coder
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    2,469
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I believe all you did was clip the image -- and again, all you can do is:
    1. Edit it in an image editor for the appropriate size or
    2. Use javascript to load a specific background depending on size or
    3. use CSS3 which has minimal support
    // Art is what you can get away with. <-- Andy Warhol
    ...:.:::: bradyjfrey.com : htmldog : ::::.:...

  • #11
    Regular Coder
    Join Date
    Apr 2003
    Location
    Seoul, Korea
    Posts
    329
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for your answering, bradyj

    Quote Originally Posted by bradyj
    I believe all you did was clip the image -- and again, all you can do is:
    I don't understand what "clip" means in your sentence.
    Would you please rephrase the sentence?

    Quote Originally Posted by bradyj
    1. Edit it in an image editor for the appropriate size or
    The image will not be made by me.
    The image will posted by users.

    Users will post various size images.
    I like to fix it 100*100 regardless of the orignal size of the every image.
    This means I can't edit the every image whenever it posted.


    Quote Originally Posted by bradyj
    2. Use javascript to load a specific background depending on size or
    Do you mean I should post this in javascript forum?

    Quote Originally Posted by bradyj
    3. use CSS3 which has minimal support
    What is the CSS3?

    Thanks in Advance
    Get my greedy up

  • #12
    Senior Coder
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    2,469
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Clip -- kind of a print graphics term (different than the css version of clip, but same idea http://www.w3schools.com/css/pr_pos_clip.asp) Meaning, the whole graphic is loaded fully, but some of it is "clipped" or cut off.
    That could be useful for you.

    I'm sorry, I didn't catch that other users were loading it until now -- maybe this could be accomplished with a server-side script then, since users are loading it. Maybe someone knows of some PHP that can help?

    ...and the javascript statement was that you can have custom size images load on a browser size basis. I was still thinking you only needed one image with multiple sizes, that's out.

    CSS3 = The WWW guys come out with updates to all the codes every few years - right now most of us are using Cascading Style Sheets 2 and 2.1 -- but there is a version Cascading Style Sheets 3 (CSS3) that's in the works. This upgrade will allow you to do what you're talking about -- have a fixed size for the background images in your webpage regardless of the actual file size. However, this is not supported by current browsers (well, some) and not recommended. You'd have to wait a while for this one.
    // Art is what you can get away with. <-- Andy Warhol
    ...:.:::: bradyjfrey.com : htmldog : ::::.:...

  • #13
    Regular Coder
    Join Date
    Apr 2003
    Location
    Seoul, Korea
    Posts
    329
    Thanks
    0
    Thanked 0 Times in 0 Posts
    They are all useful informations for me. Thanks.

    I have one more question.
    This is just from curiousity.

    Quote Originally Posted by Andy Warhol
    Art is what you can get away with.
    It seems something but I don't understand it fully.
    Would you rephrase it a little more easy if you don't mind?(I am not a native speaker of English)
    Get my greedy up

  • #14
    Senior Coder
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    2,469
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is off topic, but I think it's useful design information, and has helped me in my design work, If there is a problem with answering this question, I apologize, but I thought it would be good for others to listen in, if they are interested in learning more about art and design (especially andy warhol who's pop art inspires much print... and a lot of web too):

    <offtopic>
    Andy Warhol used to joke that America was all about the consumer -- that we were machines living in a country built on rolling everything off the factory as fast as you can. Since we are a close-minded culture, some things are too extreme until a few more generations, and then they are no longer too extreme, and something else takes it's place. So the term 'Art is what you can get away with' -- is really saying that Art at this current moment in the American culture are thoughts, designs, and ideas that break the rules of what we think are comfortable thoughts, designs, and ideas.

    An example:
    If I were to take a photograph of the war in Iraq that showed a lot of violence (bodies, blood, warfare) -- would you think it was artistic or would you think it was gruesome trash? Depending on what the picture looks like, it just might be unique enough to be called art to you -- but if it was not, you may not think it's art. It depends on 'what I can get away with', like a child trying to pull as many pranks he can before his parents catch him.

    Mark Kostabi (http://www.markkostabi.com/) believes in this statement -- he used to paint and design his own work... but in the late 80's, decided to pay students to paint his ideas and he just signs it... in the 90's, he decided to pay people to think up his paintings AND paint them. This is a long debate we can hold in another forum - but the idea is that he's walking a thin line of what old ideas about art he can break, and to some, he's doing it. He's creating art.
    </offtopic>
    // Art is what you can get away with. <-- Andy Warhol
    ...:.:::: bradyjfrey.com : htmldog : ::::.:...

  • #15
    Regular Coder
    Join Date
    Apr 2003
    Location
    Seoul, Korea
    Posts
    329
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I was just asking what is the literal meaning of the sentence.

    But you talked long story.

    Although I don't get the literal meaning of the sentence clealy yet,
    I could follow your sentence. And I feel art.

    It doesn't matter whether I understand the literal meaning of the sentence but It does actually matter what I felt by your paragraph because Art is what I feel, not what I understand .

    I feel Andy meant something not accustomed with although I didn't have any clue who was Andy until today morning.

    For example,

    If I were to take a photograph of the war in Iraq that showed a lot of violence i.e. western photographers, American women soildier( I don't remember her name) captured or killed by the, so called, terrorists,
    I would produce the tons of propogander trash like things the CNN produces everyday.
    On the contrary,
    If I might take picture of the terrors which are making in the name of anti-terror war everyday to powerless and hopeless people who are not cared by any photographers, that would be what I can get away with...
    Get my greedy up


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •