Connecting Tech Pros Worldwide Forums | Help | Site Map

align images

pradeepjain's Avatar
Needs Regular Fix
 
Join Date: Jul 2007
Location: India
Posts: 407
#1: Sep 5 '08
I have 5 images of equal width which i have to place one below the another without any gap between them.how to do its ....what should be the css for the images or say div..i am doctype of strict ..



Thanks,
Pradeep

Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,660
#2: Sep 5 '08

re: align images


what about:
Expand|Select|Wrap|Line Numbers
  1. .yourimageclass {
  2.   display: block;
  3.   padding: 0;
  4.   margin: 0;
  5. }
pradeepjain's Avatar
Needs Regular Fix
 
Join Date: Jul 2007
Location: India
Posts: 407
#3: Sep 5 '08

re: align images


Quote:

Originally Posted by Dormilich

what about:

Expand|Select|Wrap|Line Numbers
  1. .yourimageclass {
  2.   display: block;
  3.   padding: 0;
  4.   margin: 0;
  5. }

hey its taking a small gap between each picture wht to do.....
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,660
#4: Sep 5 '08

re: align images


Quote:

Originally Posted by pradeepjain

hey its taking a small gap between each picture wht to do.....

what brower do you use? is there any possibility that some other css rule overrides this? (the code worked for me as intended (FF 3.01/Mac))

regards
pradeepjain's Avatar
Needs Regular Fix
 
Join Date: Jul 2007
Location: India
Posts: 407
#5: Sep 5 '08

re: align images


Quote:

Originally Posted by Dormilich

what brower do you use? is there any possibility that some other css rule overrides this? (the code worked for me as intended (FF 3.01/Mac))

regards

how to override all the styles
Expert
 
Join Date: Aug 2008
Posts: 397
#6: Sep 5 '08

re: align images


Quote:

Originally Posted by pradeepjain

how to override all the styles

Put the page on a pubic server and provide a clickable link to it in your post (3rd request). It is difficult enough to fix what can be seen.
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,660
#7: Sep 5 '08

re: align images


Quote:

Originally Posted by pradeepjain

how to override all the styles

first you have to get all the matching rules, though this may not be very easy (I recommend the Firebug plugin for Firefox for that, because this shows all styles an element has).

what browser do you use? (could be a bug, too)

regards
pradeepjain's Avatar
Needs Regular Fix
 
Join Date: Jul 2007
Location: India
Posts: 407
#8: Sep 6 '08

re: align images


I am giving the link to the site i am working on....

http://www.iiap.res.in/

as you can see the images on the left hand side of your screen..i want it to be in same way .i want to change it bcos there is some problem with the validation part...any way to do with the css....



thanks,
Pradeep
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,660
#9: Sep 6 '08

re: align images


Quote:

Originally Posted by pradeepjain

as you can see the images on the left hand side of your screen..i want it to be in same way .i want to change it bcos there is some problem with the validation part...any way to do with the css....

sorry, I don't understand. do you want the pictures align like those in the link? they're essentially doing the same as my css suggestion, though it is much deeper nested (for my liking, the site is nested too much anyway) and therefore the css is applying to a div rather than the img.
Reply