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 7 of 7
  1. #1
    Regular Coder
    Join Date
    Jul 2007
    Location
    England
    Posts
    132
    Thanks
    24
    Thanked 0 Times in 0 Posts

    How Do I Place Two Images Next To Each Other?

    Here I have two images :

    h**p://soccer-europe.com/newindex.html

    I want them displayed next to each other. How do I do it?

    Here's the relevant HTML :

    Code:
    <div id="image1">
    <img src="Graphics/Photos/flickr/2_April_2007_Milan_by_superleague_formula_thebeautifulrace.jpg" width="500" height="334">
    <img src="Graphics/Photos/flickr/5_July_2007_Carlos_Tevez_by_dentough.jpg" width="300" height="410">
    <div id="cap">© 2007 Superleague Formula</div>
    </div>
    and the relevant css :

    Code:
    #image1 {
    float: left;
    padding-right: 10px;
    }
    
    #image2 {
    float: right;
    padding-left: 10px;
    }

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Code:
    #image1 img {
    float:left;
    }
    #cap {
    clear:both;
    }
    Though your current code may prevent the images from going next to each other. I say this because your code is highly invalid. See your coding errors here. The server to the url I just posted may be down at the moment. When its back up it will show you your coding errors.
    Last edited by _Aerospace_Eng_; 08-01-2007 at 02:26 AM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder
    Join Date
    Jul 2007
    Location
    England
    Posts
    132
    Thanks
    24
    Thanked 0 Times in 0 Posts
    I'm playing around with a template from another website that's why the code is a bit of a mess.

  • #4
    Regular Coder
    Join Date
    Jul 2007
    Location
    England
    Posts
    132
    Thanks
    24
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    Code:
    #image1 img {
    float:left;
    }
    #cap {
    clear:both;
    }
    Though your current code may prevent the images from going next to each other. I say this because your code is highly invalid. See your coding errors here. The server to the url I just posted may be down at the moment. When its back up it will show you your coding errors.
    I've tidied up most of the code but the css you listed didn't work.

  • #5
    Regular Coder Jutlander's Avatar
    Join Date
    Jun 2007
    Location
    In my own sick little world :P
    Posts
    425
    Thanks
    1
    Thanked 12 Times in 12 Posts
    The code Aero provided works fine when I test it? You didn't use the #image2 did you, because it isn't needed, as the code above suggests.
    .
    .

  • #6
    Regular Coder
    Join Date
    Jul 2007
    Location
    England
    Posts
    132
    Thanks
    24
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Jutlander View Post
    The code Aero provided works fine when I test it? You didn't use the #image2 did you, because it isn't needed, as the code above suggests.
    Yes I did, fixed now but the problem is :

    http://soccer-europe.com/newindex.html

    I want to add text under each image and add a margin to space out the images. I added a 2px margin in the css but it returned the second image to the next line.

  • #7
    Regular Coder
    Join Date
    Jul 2007
    Location
    England
    Posts
    132
    Thanks
    24
    Thanked 0 Times in 0 Posts
    Resolved.


  •  

    Posting Permissions

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