I need help with image padding

5 replies
  • WEB DESIGN
  • |
Hello everyone,
i am building my first website with xhtml and css and have problems with image padding. the image situatuates in the same <td> with a text that wraps itself around the image. my image is aligned on the right and text on the left. i use cascading styling sheets for formatting.
.picture1 {
padding-left:25px; (not working)
padding-top:10px;
padding-right:25px;
padding-bottom:10px;
}


for some reason, padding-left is not working. i cant insert a space between a text and an image. I know it is not easy to answer the question without seeing my website but do you have an idea why it is happening.
If have any ideas why it might be happening, please let me know.
Many thanks
#image #padding
  • Profile picture of the author nontemplates
    Got to post a website URl if you want help. Have to be able to see the site and code to know whats wrong.
    {{ DiscussionBoard.errors[1113087].message }}
  • Profile picture of the author joelmutia
    hi.hope this help try adding selector float:

    .picture1 {
    padding-left:25px; (not working)
    padding-top:10px;
    padding-right:25px;
    padding-bottom:10px;
    float: left or right;
    }
    {{ DiscussionBoard.errors[1263953].message }}
  • Profile picture of the author promo_guy
    Don't mean to be picky but you might want to simplify your css as well, such as:

    .picture1 { padding: 10px 25px 10px 25px; }

    I'd try a float like joel suggested as well but without seeing the site it is a little difficult to know for sure.
    {{ DiscussionBoard.errors[1277658].message }}
  • Profile picture of the author jasonmorgan
    .image {
    float:left;
    margin: 0px 0px 0px 0px;
    padding: 10px 10px 10px 10px;
    }
    should do it

    could always try text-align: left; which works for images but I'm not sure what your results are going to look like.
    Signature

    I'm all about that bass.

    {{ DiscussionBoard.errors[1277717].message }}
  • Profile picture of the author bridgerlandweb
    Use margin, not padding. Padding is for space between the element and its own border; margin is for space between the element and other elements.
    {{ DiscussionBoard.errors[1278881].message }}

Trending Topics