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 8 of 8
  1. #1
    Regular Coder Andy92's Avatar
    Join Date
    Nov 2005
    Location
    Horsham, West Sussex, UK
    Posts
    363
    Thanks
    7
    Thanked 1 Time in 1 Post

    Css text padding?

    Hi there,

    I have 1 image, then i have some text below that image then i have 1 div box around them.

    But as the text is right below the image, its nearly touching the image, so is there such thing as text padding top, bottom etc. So you can apply it and it will only padd the text at the top and bottom etc ? So then my text can just have padding at the top so it won't touch the image?

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Markup

    A link to the page online, or the markup and styles posted in here--using the CODE bb tags--would help, but text--and inline content in general--does not support top and bottom padding and margins; however, if you've marked up the caption with, for instance, a p element which is a block level element, the p can be assigned vertical padding and/or margins to separate it from the image.
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #3
    Regular Coder Andy92's Avatar
    Join Date
    Nov 2005
    Location
    Horsham, West Sussex, UK
    Posts
    363
    Thanks
    7
    Thanked 1 Time in 1 Post
    Ive used the <p> tag and its much too big gap.

    I think i have found a solution by doing it another way. Ill check it out and get back to you.


  • #4
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,316
    Thanks
    29
    Thanked 279 Times in 273 Posts
    When using the paragraph tag, try setting padding and margin to zero first and then adding padding or margin values as necessary; this should override any default padding or margin values that the p tag may have been assigned by the browser.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #5
    Regular Coder Andy92's Avatar
    Join Date
    Nov 2005
    Location
    Horsham, West Sussex, UK
    Posts
    363
    Thanks
    7
    Thanked 1 Time in 1 Post
    What i might try is making a <div> tag 3px high and then insert that between the image and the text.

  • #6
    Regular Coder kewlceo's Avatar
    Join Date
    Mar 2006
    Location
    California, US
    Posts
    484
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by Allsortshop
    What i might try is making a <div> tag 3px high and then insert that between the image and the text.
    Why on earth would you do it that way?
    UBERHOST.NET
    Shared, reseller, semidedicated hosting and dedicated server plans.
    DirectAdmin • Installatron • Money-Back Guarantee • 24/7 Support
    Providing "Service Above All Else" since 2005.

  • #7
    Regular Coder Andy92's Avatar
    Join Date
    Nov 2005
    Location
    Horsham, West Sussex, UK
    Posts
    363
    Thanks
    7
    Thanked 1 Time in 1 Post
    What other way can you do it ?

  • #8
    Regular Coder kewlceo's Avatar
    Join Date
    Mar 2006
    Location
    California, US
    Posts
    484
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by Allsortshop
    What other way can you do it ?
    Using Arbitrator's suggestion, for instance.


  •  

    Posting Permissions

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