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 10 of 10
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Posts
    436
    Thanks
    1
    Thanked 0 Times in 0 Posts

    CSS 4 Image: hspace,vspace,align

    I searched for an answer at Google and at the w3schools.com and found nothing about it.
    I want to know what CSS properties replaces the hspace, vspace and the align methods for the IMG tag.
    I tried: style="vertical-align:left"
    but it didn't work.
    Someone can help me with that?
    Thanks...

  • #2
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    how about relative positioning?

  • #3
    Regular Coder
    Join Date
    Oct 2002
    Posts
    380
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The left/right alignment can be set with the text-align property on an inline element: style="text-align: left;" This will cause the text to wrap around the element. It can take values of left, right or none (none is the default). The vertical align determines where the image appear relative to the line of text it's embedded within: style="vertical-align: middle". It can take values of top, middle bottom (and a few others). hspace can be acheive by setting the left and right margins on the element.

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    NL
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Margin. Margin-top, margin-right, margin-bottom, margin-left.
    <img style="margin: 10px;" (all margins 10px)
    <img style="margin: 10px 5px;" (top and bottom 10px, left and right 5px)
    <img style="margin: 10px 5px 8px 4px;" (top, right, bottom, left)

  • #5
    Regular Coder
    Join Date
    Jul 2002
    Posts
    436
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I tried margin and padding and now I tried text-align too, but it doesn't seem to work.
    Look at:
    http://hek.co.il/shmulik/gbd/index.asp
    The lower picture is what I have with HTML properties (hspace,vspace,align) and the higher one is styled with CSS.
    Look at the source and try to find out what is wrong.
    Thanks for your help.

  • #6
    Regular Coder
    Join Date
    Oct 2002
    Posts
    380
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You need to tell the element to float:
    style="float: right; margin: 3px;"

  • #7
    Regular Coder
    Join Date
    Jul 2002
    Posts
    436
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Originally posted by Kiwi
    You need to tell the element to float:
    style="float: right; margin: 3px;"
    Great! Thanks.
    Can you refer me to a place I can read about float?

  • #8
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Moderator: General web building

    Get out from under them, resist and multiply.
    Get out from under precipice and see the sky.

  • #9
    Regular Coder
    Join Date
    Oct 2002
    Posts
    380
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #10
    Regular Coder
    Join Date
    Jul 2002
    Posts
    436
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks to you all!


  •  

    Posting Permissions

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