Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
resizing pics with the window
Old 01-15-2009, 03:49 PM resizing pics with the window
Average Talker

Posts: 18
Trades: 0
good morning (or afternoon to some of you) everyone...

as i get deeper into this web page building thing... i keep running across more problems then solutions... and considering how much smarterer most of you are when it comes to this thing then me, i am here once again to ask for advice or a helpful link...

Anyways, i have few DIVs i am using (left, right, center) for some adds on the bottom of my page... and they look really cool when i view the page in full (max size) mode... however when i make it smaller (you know that Restore Down... not minimize button)... my pics don't keep their right proportion (they get too fat... as in width is smaller then needed in order to keep same proportions)

i think there must be a tag of some sort to make picture size relative to the screen (like in %) to solve this... am i right? wroght?

here is my rather.... ehh... advanced?... code in CSS file
Code:
.addcontainer {
width: 100%;
height: 100px;
}
#addleft {
float: left;
width: 33%;
}
#addcenter {
display: inline;
float: left;
width: 33%;
}
#addright {
float: right;
width: 33%;
}

#add {
float: center;
width: 90%;
}
and here is what i have in HTML portion...
Code:
<div class="addcontainer">
<div id="addleft">
    <div id="add">
<img style="width: 100%; height: 100%;"
 alt="Add 01" src="Add_01.jpg">
    </div></div>
<div id="addcenter">
    <div id="add">
<img style="width: 100%; height: 100%;"
 alt="Add 02" src="Add_02.jpg">
    </div></div>
<div id="addright">
    <div id="add">
<img style="width: 100%; height: 100%;"
 alt="Add 03" src="Add_03.jpg">
    </div></div>
</div>
now i am sure some of you might get jelause and try to still my awsome code.... if so, all i ask is for some sort of moneys ;0)

anyways... if anyone can help me out... well... that would be just great!!!
agent_KGB is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-15-2009, 03:54 PM Re: resizing pics with the window
Average Talker

Posts: 18
Trades: 0
ohhh, and one more little thing... is there a reason why i can't see any of the pictures in IE with this code?
agent_KGB is offline
Reply With Quote
View Public Profile
 
Old 01-15-2009, 04:11 PM Re: resizing pics with the window
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Quote:
i think there must be a tag of some sort to make picture size relative to the screen
Nope, there is no such tag.

Pictures, generally are static in size and cannot be resized with HTML. There are some javascript solutions, but the image quality generally suffers.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 01-15-2009, 05:29 PM Re: resizing pics with the window
Average Talker

Posts: 18
Trades: 0
then how come my pictures get smaller in width (but keep same hight) with this code?

Code:
<img style="width: 100%; height: 100%;"
and more importanly, is there a way for me to keep them at the same proportions? and if not... what would you recomend for me as a solution to this problem?
agent_KGB is offline
Reply With Quote
View Public Profile
 
Old 01-15-2009, 06:37 PM Re: resizing pics with the window
angele803's Avatar
Perfectly Imperfect

Posts: 1,774
Name: Stephanie
Location: Oklahoma
Trades: 2
If you take the style="width: 100%; height: 100%;" off of the images, they should not change size or proportions when the browser size changes.

I don't know if this is the reason your images aren't showing up in IE, but I noticed you have id="add" on more than one element. You should change those to class="add" and change your stylesheet to .add. An ID is supposed to be unique and a CLASS can apply to multiple items.
__________________

Please login or register to view this content. Registration is FREE
angele803 is offline
Reply With Quote
View Public Profile
 
Old 01-15-2009, 06:41 PM Re: resizing pics with the window
Decaf's Avatar
Ultra Talker

Posts: 489
Name: Adam
Trades: 0
Quote:
Originally Posted by agent_KGB View Post
then how come my pictures get smaller in width (but keep same hight) with this code?

Code:
<img style="width: 100%; height: 100%;"
and more importanly, is there a way for me to keep them at the same proportions? and if not... what would you recomend for me as a solution to this problem?
Because the "n%" is telling the browser to render/stretch the image for n% across the screen.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Decaf is offline
Reply With Quote
View Public Profile Visit Decaf's homepage!
 
Old 01-15-2009, 07:16 PM Re: resizing pics with the window
Average Talker

Posts: 18
Trades: 0
Quote:
Originally Posted by angele803 View Post
I noticed you have id="add" on more than one element. You should change those to class="add" and change your stylesheet to .add. An ID is supposed to be unique and a CLASS can apply to multiple items.
sweet... thanks a bunch... learning something every day
agent_KGB is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to resizing pics with the window
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.44761 seconds with 12 queries