• OK I saw similar posts around these forums but seem to workfor my theme. Whenever I aligh the picture for a post, it looks great in “visual” but then when I actually post it, the picture takes the role of “none” I have manually changed the code in the HTML view from <img class =”alignright…. to <img align=”right” this has worked but needs to be manually done for each post. Is there code I can add to my .CSS file that will change this will all posts?

    Also I would like code to indent each paragraph and double space after each paragraph to make the posts easier on the eyes. Any input is greatly appreciated. I have gotten lots of help from other contributors on this forum and want to thank all of them as well for doing your good deed!

    the link to my site is thepushforward.com – if you need anything else to see what I have going on let me know.

Viewing 15 replies - 1 through 15 (of 18 total)
  • I’m not sure about indenting paragraphs, but the double space before and after can be accomplished by adding something like margin-top:20px to the style

    .post p

    As for your image lignment issues – to get this to work, you at least need to add these classes to your css:

    .alignleft{
    float:left;
    }
    .alignright{
    float:right;
    }

    Good luck!

    CSS has text-indent for indentation….

    EXAMPLE.

    .someclass {
    text-indent:10px;
    }

    Without seeing your website and/or knowing your theme it’s hard to say what needs adjusting…

    Thread Starter jmf421

    (@jmf421)

    Should I send you the .CSS, would that help? I dont even see a section labeled:

    .post p

    I just need to know where I should be adding the text and I am sorry if I am not much help with little experience using .CSS

    I dont want to push it but adding “padding or spacing around my images so the text isnt sitting right against it would be a huge help too.

    The following is what is still in question for my Style.CSS:

    Spacing around all images
    Double space after paragraphs
    Indent each paragraph

    Thanks so much in advance!

    A link to your site would be better…

    Indent we can do, spacing paragraphs we can do, spacing around images we can do…

    It involves padding, margins and text-indent via CSS….

    I say because if you read back your last post it’s a little confusing…

    jmf, there may not be a section labeled .post p, you may have to create it (or you may not, it depends on your theme)

    t31os is right – we’ll be able to best help you if you can post a link to your site.

    Thread Starter jmf421

    (@jmf421)

    There was a link up in the original post – thepushforward.com that will bring you to the main page and all of those posts were manually edited. Thanks again guys

    jmf, to add the spacing after paragraphs, change this:

    p { margin:0; }

    to this:

    p { margin-bottom:2em; }

    To add padding around your images, I’d add this style:

    .post img{
    	padding: 10px;
    }

    Thread Starter jmf421

    (@jmf421)

    I have added both of those codes and then did a test post. Still wont do it. Should this change all existing posts or only new posts from here on out? Could there be a code in place that is taking precedence over these codes I am adding?

    Since you’re changing the css, it will change all posts across your entire site.

    I’ve tested out some solutions, and this should work fine – but I can’t see that the changes have been implemented in your stylesheet. These need to go in style.css.

    After looking around your stylesheet a little more, I’m going to change my advice – instead of changing the p style, add this style:

    .post p{
    	margin-bottom: 2em;
    }

    You can add both styles right at the bottom of the stylesheet.

    Thread Starter jmf421

    (@jmf421)

    OK it looks like it worked – Added the padding around my image in my posts and gave the double spacing after each paragraph. In my “about” page there is a picture that has the text right up against it, cause I add a similar code for my other pages?

    I looked at the about page, and it looks like it got the padding – is that not what you wanted?

    Thread Starter jmf421

    (@jmf421)

    Yes I just got that to work after the post – This looks great, thank you a ton! Now is there a way to add the indent for way paragraph or should I do this manually in the HTML?

    I cannot say it enough, thank you for the time you spent on this Peterebutler and t31os!

    No problem jmf –

    As for text indenting, I didnt even know this existed, but t31os pointed it out up above – its the text-indent rule.

    It looks like to implement this, you should overwrite the .post p I had you create with this:

    .post .entry p{
    	text-indent:20px;
    	margin-bottom: 2em;
    }

    Again, you should overwrite the whole .post p that you created before with that piece. The reason it needs to be .post .entry p is because the metadata above the post (date, author, etc) was getting indented as well with just .post p, and you dont want that.

    Thread Starter jmf421

    (@jmf421)

    OK – everything is working except the pictures being aligned. I will go into the medi library while creating a new post and select “align right” and it always goes to the left and wont wrap the text around the picture. It is taking a very similar position to “none”. I have to go in am manually edit the code to get it to take any position at all. Can anyone figure this one out?

    You’re going to need to add .alignright and .alignleft classes to your css. Something like this:

    .alignright{
    float:right;
    }
    .alignleft{
    float:left;
    }

    Those really should have been in your theme in the first place, but a number of theme designers forget them. Because of the previous img class we made, the padding ought to be maintained.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Picture Align issue in CSS’ is closed to new replies.