align images

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pradeepjain
    Contributor
    • Jul 2007
    • 563

    align images

    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
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    what about:
    [CODE=css].yourimageclass {
    display: block;
    padding: 0;
    margin: 0;
    }[/CODE]

    Comment

    • pradeepjain
      Contributor
      • Jul 2007
      • 563

      #3
      Originally posted by Dormilich
      what about:
      [CODE=css].yourimageclass {
      display: block;
      padding: 0;
      margin: 0;
      }[/CODE]
      hey its taking a small gap between each picture wht to do.....

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        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

        Comment

        • pradeepjain
          Contributor
          • Jul 2007
          • 563

          #5
          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

          Comment

          • David Laakso
            Recognized Expert Contributor
            • Aug 2008
            • 397

            #6
            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.

            Comment

            • Dormilich
              Recognized Expert Expert
              • Aug 2008
              • 8694

              #7
              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

              Comment

              • pradeepjain
                Contributor
                • Jul 2007
                • 563

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



                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

                Comment

                • Dormilich
                  Recognized Expert Expert
                  • Aug 2008
                  • 8694

                  #9
                  Re: align images

                  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.

                  Comment

                  Working...