Two images side by side

Solved
Profile blocked -  
 Profile blocked -
Hello,
I would like to place two images side by side, but separated. You will understand by looking at my site: http://vistlip.free.fr
Actually, in the left frame, I would like the two images that are one below the other to be at an angle.

Thank you.

--
.: itsuki power shunyuu ! :.
Configuration: Windows Vista Firefox 3.5.5

22 answers

  • 1
  • 2
  1. alex59fr Posted messages 978 Status Member 89
     
    Hello,

    I see this: <link rel="stylesheet" HREF="css.css" TYPE="text/css"> in the middle of the site? It should only be placed between <head> and </head>

    To align your images side by side, you need to add in CSS the property

     display:inline 


    And float:right for the right image & float:left for the left image ...
    --
    Mental manipulation and personality destruction, thirst for money and numbing of society, TV is, quite simply, a cult.
    Configuration: Ubuntu 9.10 in DualBoot with Windows
    0
  2. Atropa Posted messages 2051 Status Member 274
     
    Good evening,
    I quickly modified it with Firebug, is this the result you want?

    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr"> <head> </head> <body> <div id="entete"> </div> <img onmouseover="this.src = 'hover-accueil.jpg';" alt="accueil " src="hover-accueil.jpg" title="accueil"/> <img onmouseout="this.src = 'boutton-contact.jpg';" onmouseover="this.src = 'hover-contact.jpg';" alt="contacte" src="boutton-contact.jpg" title="me contacter"/> <img onmouseout="this.src = 'boutton-image.jpg';" onmouseover="this.src = 'hover-image.jpg';" alt="image" src="boutton-image.jpg" title="images"/> <img onmouseout="this.src = 'boutton-video.jpg';" onmouseover="this.src = 'hover-video.jpg';" alt="video" src="boutton-video.jpg" title="images"/> <img onmouseout="this.src = 'boutton-tuteur.jpg';" onmouseover="this.src = 'hover-tuteur.jpg';" alt="tuteur" src="boutton-tuteur.jpg" title="tuteurs"/> <br/> <br/> <br/> <link type="text/css" href="css.css" rel="stylesheet"> </link> <div id="menu"> <div class="element_menu"> <div id="menu" style="float: left; width: 40px; height: 40px;"> </div> <div id="menu" style="float: right; width: 40px; height: 40px;"> </div> <h3 style="margin: 0pt; padding: 0pt;"> </h3> <img style="width: 100%; height: 5px;" src="s%C3%A9parateur.gif"/> <ul> </ul> </div> </div> <br/> <div align="center"> </div> <div align="center"> </div> </body> </html>


    By the way, there are 21 HTML errors in your code

    http://validator.w3.org/
    http://jigsaw.w3.org/css-validator/
    0
    1. alex59fr Posted messages 978 Status Member 89
       
      You might want to consider removing this line

       <link type="text/css" href="css.css" rel="stylesheet"> </link> 

      --
      Mental manipulation and destruction of personality, thirst for money and dumbing down of society, television is nothing more than a cult.
      Configuration: Ubuntu 9.10 in DualBoot with Windows
      0
  3. Profile blocked
     
    alex59fr,
    could you elaborate on your answer please (the first one)
    --
    .: itsuki power shunyuu ! :.
    0
  4. alex59fr Posted messages 978 Status Member 89
     
    You have your two images, I don't know how you make them appear, but not with an img src, so you have to use a class in CSS, I don't know which one, it's up to you to decide which class to use.

    For the class on the right, you need to add: display:inline; float:right; for the one on the left you need to add display:inline; float:left;

    Is it a bit clearer?

    --
    Mental manipulation and destruction of personality, thirst for money and dumbing down of society, television is nothing less than a cult.
    Configuration: Ubuntu 9.10 in DualBoot with Windows
    0
  5. Profile blocked
     
    I made a div,
    XHTML:
    <div id="menu2"> </div><div id="menu3"> </div>


    and the CSS:
    #menu2 { width: 500px; height: 80px; background-image: url("menu.gif"); background-repeat: no-repeat; background-position: left; } #menu3 { width: 500px; height: 80px; background-image: url("menu.gif"); background-repeat: no-repeat; 

    --
    .: itsuki power shunyuu ! :.
    0
  6. alex59fr Posted messages 978 Status Member 89
     


     #menu2 { width: 500px; height: 80px; background-image: url("menu.gif"); background-repeat: no-repeat; background-position: left; float:left; display:inline; } #menu3 { width: 500px; height: 80px; background-image: url("menu.gif"); background-repeat: no-repeat; float:right;display:inline; } 


    --
    Mental manipulation and destruction of personality, thirst for money and dumbing down of society, television is nothing more than a cult.
    Configuration: Ubuntu 9.10 in DualBoot with Windows
    0
  7. Profile blocked
     
    It's not working, the image doesn't even display...
    It only shows if I set it to width:140px, because (css):
    #menu /* The menu */ { float: left; /* The menu will float to the left */ }

    --
    .: itsuki power shunyuu ! :.
    0
  8. alex59fr Posted messages 978 Status Member 89
     
    140 px? Above I see 500px ...
    --
    Mental manipulation and destruction of personality, thirst for money and dumbing down of society, television is nothing more than a cult.
    Configuration: Ubuntu 9.10 in DualBoot with Windows
    0
  9. Profile blocked
     
    I just changed...
    Go see, I managed to place it to the right of the frame, but not next to the other image above...
    --
    .: itsuki power shunyuu ! :.
    0
  10. alex59fr Posted messages 978 Status Member 89
     
    You need to add the display:inline property to your two elements as mentioned twice above
    --
    Mental manipulation and destruction of personality, thirst for money and numbing of society, television is nothing more than a cult.
    Configuration: Ubuntu 9.10 in DualBoot with Windows
    0
  11. alex59fr Posted messages 978 Status Member 89
     
    For your divs, use a CLASS attribute instead of an ID, so instead of putting in the CSS #menu2, put .menu2

    Then make a div that surrounds the other two divs with the property:

    display: block;
    width: the width;
    height: height;

    EDIT: Immediately remove: width: 500px; !!!
    --
    Mental manipulation and personality destruction, thirst for money and dumbing down of society, television is nothing more than a cult.
    Configuration: Ubuntu 9.10 in DualBoot with Windows
    0
  12. Atropa Posted messages 2051 Status Member 274
     
    Did you try to modify this:

    <div id="menu2" style="margin: 0; padding: 0; float: left; width: 40px; height: 40px;"> </div><div id="menu3" style="margin:0;padding:0;width:40px;height:40px; float:right;">

    like I did in my first post...

    or you can directly replace menu2 and menu3 with this in your CSS:

    #menu2 { width: 40px; height: 40px; background-image: url("menu.gif"); float:left; } #menu3 { width: 40px; height: 40px; background-image: url("menu.gif"); float:right; }
    0
  13. Profile blocked
     
    Thank you very much Atropa!! It works with the first method, thanks of course to you too alex59fr!

    I put this:
    <div id="menu2" style="margin: 0; padding: 0; float: left; width: 40px; height: 40px;"> </div><div id="menu3" style="margin:0;padding:0;width:40px;height:40px; float:right;"> </div> <br />


    Go see the box on the left: http://vistlip.free.fr
    --
    .: itsuki power shunyuu ! :.
    0
  14. alex59fr Posted messages 978 Status Member 89
     
    You're welcome, see you next time :)
    --
    Mental manipulation and destruction of personality, thirst for money and numbing of society, TV is nothing more than a cult.
    Configuration: Ubuntu 9.10 in Dual Boot with Windows
    0
  15. Profile blocked
     
    I have a problem, I succeeded with the two images at the top, but I can't do the same for those at the bottom!

    XHTML:

    <div id='menu'> <div class="element_menu"> <div id="menu2" style="margin: 0; padding: 0; float: left; width: 40px; height: 40px;"> </div><div id="menu3" style="margin:0;padding:0;width:40px;height:40px; float:right;"> </div><br /><br /><div id="menu4" align="center"> </div> <ul > <li>image</li> <li>video</li> <li>my tutors</li> <li>more...</li> </ul ><br /><br />  <div id="menu2" style="margin: 0; padding: 0; float: left; width: 40px; height: 40px;"> </div><div id="menu3" style="margin:0;padding:0;width:40px;height:40px; float:right;"> </div> </div> </div> <br /> 


    and the css, I took back those from the two images I put at the top:

    #menu2 { width: 500px; height: 80px; background-image: url("menu.gif"); background-repeat: no-repeat; background-position: left; } #menu3 { width: 140px; height: 80px; background-image: url("menu.gif"); background-repeat: no-repeat; background-position: right; }


    ps: what is in bold in the xhtml is the 2 images that should go at the bottom of the frame.
    go see http://vistlip.free.fr
    --
    .: itsuki power shunyuu ! :.
    0
  16. Atropa Posted messages 2051 Status Member 274
     
    Hello,

    you should remove the style attributes from the tags and replace #menu2 and #menu3 with this:

    #menu2 { width: 40px; height: 40px; background-image: url("menu.gif"); float:left; } #menu3 { width: 40px; height: 40px; background-image: url("menu.gif"); float:right; }


    if you change your CSS like this, you won't need the style tags anymore.

    then for the divs below, you just need to add margin-top: 40px;
    0
  17. Profile blocked
     
    There is a problem when I make my div look (image) when I write <div id="menu"..> </div> the word menu turns red.
    And when I add 6: <div id="menu6"..> </div> it turns black as if it doesn't work.

    Without the "6": http://ups.imagup.com/06/1259472237.jpg
    With the "6": http://ups.imagup.com/06/1259472294.jpg

    So of course it won't work...
    --
    .: itsuki power shunyuu ! :.
    0
  18. notobe Posted messages 2222 Status Member 213
     
    [edit: bug, sorry for the noise...]
    0
  • 1
  • 2