PDA

View Full Version : horizontal space?


scifin
03-31-2009, 11:26 PM
Not sure if this is the right forum to ask this in but...

If I am putting a picture into a div and align the pic to the right, then set horizontal space to 20, is it possible to only add the 20px of horizontal space to the left side of the image instead of 10 on each side?

coloeagle
04-01-2009, 12:16 AM
Yup,
Depending on how you have the div/image properties set you can do it a few ways, Two of the most common;

If you want the image to have zero margin on top, right and bottom with 20px on the left you can set this in the style sheet.
.mydiv img {margin:0 0 0 20px;}or
.mydiv img {margin-left:20px;}There are other ways but without seeing your current code.............

scifin
04-01-2009, 02:52 AM
I tried it both ways but couldn't get it to work right but it is ok because I think I am just going to redo how the pics are laid out in the page; thanks for the code info.

domedia
04-01-2009, 05:01 AM
I tried it both ways but couldn't get it to work right This is super simple CSS, you did something wrong :)