Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Creating space between text and images

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #175623
    misslloyd
    Participant

    I realize this is an amateur question, but believe it or not i’ve been trying to figure this out for hours. Sad, I know. I am trying to figure out how to add space between images. In the pictures I have only shown one image with the top of another, but I want to create space between these two. I’m guessing maybe it’s somewhere with the third picture really, but what do I know. I have included three pictures, along with the paths from cssedit hopefully showing what I may need to show. Thank you to anyone who may be able to help. Let me know if I need to post anything else.
    http://imgur.com/i1pzbjp
    http://imgur.com/EJFdTg3
    http://imgur.com/lSk32wY

    links to my css –
    http://www.cssdesk.com/WVhVY
    http://www.cssdesk.com/92a33

    #175624
    Paulie_D
    Member

    Unfortunately your links do not contain enough HTML to be useful.

    We need to see the images in place with the text.

    As long as you are using basic HTML and appropriate text tags / elements it should just be a matter of margins &/or padding.

    You should remember though that images are inline elements and so you might need to add display:block depending on what it is you are trying to do.

    #175744
    TheDutchCoder
    Participant

    Paulie_D is on the right track, images by default are used to display inline.

    What this basically means is that you can’t really change their lay-out that well.

    In order to get more control over spacing, margin, padding, dimensions, etc. A good approach is to make them behave as ‘inline-block’ element, or ‘block’ elements.

    I would recommend ‘inline-block’, as it’s a bit easier to use with text-alignment.

    Wy don’t you try the following code and then change some of the properties and see what happens:

    
    img {
      display: inline-block;
      margin: 25px 10px;
    }
    

    Now change the values for ‘margin’ and see what happens! ;-)

    #263679
    ealocksmith
    Participant

    Awesome thanks, it solved my code problem. Although you cant see it well on the Pen

    https://codepen.io/ealocksmith/pen/wPVjQV

    Sp thanks it centered it well.. Awesome forum so much learned from here!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.