Resizing Images In Css

free web hosting
Open Discussion > CONTRIBUTE > The Internet > Website Discussion

Resizing Images In Css

paulmason411
Hey Guys,

What I am trying to do is get the background image to have an automatic height. So if there is only 1 line of text the image will shrink to say 3px and if there is 100 lines the image will stretch to 300px.

I can get the picture to resize in html with tables as you can see at:
http://www.locborg.de/newfru/images/frames/frames.html

I had a go at the CSS:

CODE

div.module {
  width: 180px;
  height: auto;
  font-size: 10px;
  font-weight: normal;
  background: url(http://www.locborg.de/newfru/images/frames/sides.gif) no-repeat;
  margin-bottom: 2px;

}

div.module div {
  background: url(http://www.locborg.de/newfru/images/frames/bottom.gif) bottom left no-repeat;
}

div.module div div {
  background: url(http://www.locborg.de/newfru/images/framestop.gif) top left no-repeat;
  padding: 5px 5px 5px 7px;
}


Its a menu box that needs to change size depending on what is in the menu. So therefore it needs to be dynamic. I can't go through and manually specify each pixel.

Any help would be great. Cheers smile.gif

 

 

 


Reply

Saint_Michael
you want to do something like this

CODE

<table border="1" width="200">
  <tbody><tr>
    <td><img src="frames_files/top.gif" alt="dfgfd" height="18" width="174"></td>
  </tr>
  <tr>
    <td style="width: 180px; height: 210; background: url('frames_files/sides.gif') repeat-y; padding-left:9px;">
    12345678901234567890<br>
    12345678901234567890<br>
    12345678901234567890<br>
    12345678901234567890<br>
    12345678901234567890<br>
        12345678901234567890<br>
    12345678901234567890<br>
    12345678901234567890<br>
    12345678901234567890<br>
    12345678901234567890<br>
    12345678901234567890<br> <!--will repeat the background from this point forward-->

    </td>
  </tr>
  <tr>
    <td><img src="frames_files/bottom.gif" alt="gfhg" height="20" width="178"></td>
  </tr>
</tbody></table>


with the y-axis set on repeat each new line after the original background will repeat it like so with the example I have in here.

You can div this as will doing it the same way thus the table look will disappear.

 

 

 


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Similar Topics

Keywords : resizing images css

  1. Images For Website - (0)
  2. Www.crystalxp.net - Really good site about images and avatars (4)
    Must see www.crystalxp.net/ , its a really full site about ''images'', it have: -
    tux avatars - brico packs (changes your windows skin) - images - icons - tutorials about photoshop -
    wallpapers - a lot more! Give a look plxx! for me!! and tell me what you
    think! /biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />
    /tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" />
    /biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> /tongue.g...
  3. Deviant Art Or Photobucket? - where do you show off yoru images? (6)
    So where do you upload images online for sharing or for just storing?...



Looking for Resizing, Images, In, Css

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for Resizing, Images, In, Css

*MORE FROM TRAP17.COM*
advertisement



Resizing Images In Css



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE