|
Posted by Els on 09/19/06 13:39
Wombatwal wrote:
> I am experimenting with placing images on a page using float and setting the
> image size.
> I am using an external style sheet. Below is my code in the external style
> sheet, and below that is my code in the html page.
> I have used different numbers for width and height plus px but the images
> are huge, but the right ones, float to the left and right.
> What am I doing wrong, I have scanned the internet with no help. As you can
> see I am struggling with CSS.
>
> external css sheet
> #photo1 {width: 2; height: 2; float: left; }
> #photo2 {width: 2; height: 2; float: right;}
2 what? hobnobs? ;-)
I'm just guessing these aren't really 2 pixel images, so I've invented
a width and height of 100px:
#photo1{width:100px;height:100px;float:left;}
#photo2{width:100px;height:100px;float:right;}
> <div id="photo1"><img src="Twins.jpg"></div>
>
> <div id="photo2"><img src="stuart2.jpg"></div>
That gives the width and height to the divs, not the images.
<img id="photo1" src="Twins.jpg" alt="twins">
<img id="photo2" src="stuart2.jpg" alt="Stuart">
Also: you are saying the images are huge. Even after managing width
and height through CSS, this means the original size is downloaded to
the visitor's browser. Means the page will load slower than needed,
and also the image won't look very good. Resize the images to the size
you want in the page, and you're eliminating both problems.
HTH
--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Now playing: Dave Edmunds - I Knew The Bride (when She Used To Rock
And Roll)
Navigation:
[Reply to this message]
|