Align images horizontally

Discussion in 'CSS' started by timepilot, Aug 25, 2010.

  1. #1
    I don't know much about css.:eek: But I've been trying to align Google weather icons horizontally but no matter what I do they appear on page vertically.:confused: Any ideas on how to fix this problem?
     
    timepilot, Aug 25, 2010 IP
  2. radiant_luv

    radiant_luv Peon

    Messages:
    1,327
    Likes Received:
    34
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Show us the URL to look into the code. Thanks
     
    radiant_luv, Aug 26, 2010 IP
  3. pmek

    pmek Guest

    Messages:
    101
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    pmek, Aug 26, 2010 IP
  4. timepilot

    timepilot Guest

    Messages:
    108
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #4
    Code--><div id="weather"><div class="weatherIcon"><img src="http://www.google.com//ig/images/weather/partly_cloudy.gif"/><br/>Thu</div><div class="weatherIcon"><img src="http://www.google.com//ig/images/weather/sunny.gif"/><br/>Fri</div><div class="weatherIcon"><img src="http://www.google.com//ig/images/weather/sunny.gif"/><br/>Sat</div><div class="weatherIcon"><img src="http://www.google.com//ig/images/weather/sunny.gif"/><br/>Sun</div></div>

    I removed the breaks "<br/>" and the weather icons still line up vertically.
     
    timepilot, Aug 26, 2010 IP
  5. Serentripity

    Serentripity Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Set the css for "weatherIcon" to 'display:inline-block;'

    Barring any unforeseen weirdness or floats, that should fix it :)
     
    Serentripity, Aug 26, 2010 IP
  6. CSM

    CSM Active Member

    Messages:
    1,047
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    55
    #6
    I don't think so @ Serentripity

    Without CSS it's hard to fix.

    I would do it with an UL tbh.
     
    CSM, Aug 26, 2010 IP
  7. timepilot

    timepilot Guest

    Messages:
    108
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #7
    Seeing that I don't know squat about css using the code above how would I implement that?:eek:
     
    timepilot, Aug 26, 2010 IP
  8. CSM

    CSM Active Member

    Messages:
    1,047
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    55
    #8
    You have the code for that page? Post it please.
     
    CSM, Aug 26, 2010 IP
  9. pmek

    pmek Guest

    Messages:
    101
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #9
    If you want to make an inline list (which you do) you need to look at floats, and you will have to use CSS... unless you use a table - but that's bad practise. If you read my link about floats you'd have it by now, but here is another one listing a variety of different types of lists. Have a look at the horizontal list section - http://css.maxdesign.com.au/listamatic/
     
    pmek, Aug 27, 2010 IP
  10. timepilot

    timepilot Guest

    Messages:
    108
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #10
    <table>
    <table width="60%" cellpadding="0" cellspacing="0" border="1">
    <td><div class="weather">
    <div class="weather">

    <img src="http://www.google.com/ig/images/weather/sunny.gif" alt=""?>
    <div>Fri</div>
    74&deg; F
    </div>
    <div class="weather">
    <img src="http://www.google.com/ig/images/weather/sunny.gif" alt=""?>
    <div>Sat</div>
    82&deg; F
    </div>
    <div class="weather">

    <img src="http://www.google.com/ig/images/weather/sunny.gif" alt=""?>
    <div>Sun</div>
    85&deg; F
    </div>
    <div class="weather">
    <img src="http://www.google.com/ig/images/weather/partly_cloudy.gif" alt=""?>
    <div>Mon</div>
    86&deg; F
    </div>
    </td></table>

    I know, I'm using tables, and this isn't the original code I posted.:eek:
     
    timepilot, Aug 27, 2010 IP