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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post

    What to use instead of vspace?

    Hello

    Now that the vspace attribute for spaces around images no longer works, what do we need to use instead?

    For example, I have this in my <BODY> tag:

    Code:
    <img src="screw-case.jpg" vspace="25" hspace="0" width="400" height="300" alt="Open the PC case" title="Open the PC case">
    Many thanks.

    Steve

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Use margin-top and/or margin-bottom
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post
    Hello abduraooft

    Thanks for your helpful post.

    In the <HEAD> tages I have this:

    Code:
    img 
    {
    margin-top:20px;
    margin-bottom:20px;
    }
    and that works except it is applying the style, as I expected it to, to all images.

    Can I devise TWO image tags, that is, the usual 'img' tag which the margin attributes will not be applied to, and another 'img' tag where they will be applied?

    Many thanks.

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Code:
    <img class="myimage" src=.........../>
    Code:
    img.myimage{
    margin-top:20px;
    margin-bottom:20px;
    }
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    SteveH (06-17-2009)

  • #5
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post
    That's great!

    Many thanks.

    Steve


  •  

    Posting Permissions

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