Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Sep 2007
    Posts
    137
    Thanks
    1
    Thanked 0 Times in 0 Posts

    question about images

    i have a design which i sliced in photoshop and as per the requirement i had to slice into 5 images and each slice had a different width however the total of the 5 images is 900px and fixed height of 200px

    so each of the 5 images have a height of 200px and width with different values which add upt0 900px which is the total width of the photoshop design


    i used a center layout page with the wrapper set to 900px, when i used 5 image tags all the images were sitting next to each other except for the last 5th image which was starting in the next line however in the design all should appear next to each other, i total width of the div which holds the images is
    900px and also the total width of each images is 900px.


    so i created 5 inner divs inside a containing div and i set the width and height of the inner divs based on the width and height of each images and this worked fine


    however i tried another method of using 5 img tags inside just 1 div and in the css i mentioned
    #div img{
    float: left;
    }

    after i used this method all the images were sitting next to each other as per the design, if i remove float: left; then the last image starts in a new line


    any reason why when i was using all 5 img tags with giving float: left the last image was starting in a new line as the total width is 900px

    thanks.

  • #2
    Regular Coder
    Join Date
    Dec 2009
    Posts
    115
    Thanks
    2
    Thanked 10 Times in 10 Posts
    Even floated images will start on a new line if they run out of room in their containing element. Are you sure it wasn't maybe just 1 or 2 pixels too wide?

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,748
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    Hello sudhakararaog,
    IE6 has a number of bugs that can be invoked when using floats. Hard to say what your dealing with without seeing your test site.
    Here is a list of bugs and their fixes, maybe that will help you.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •