WordPress.org

Ready to get started?Download WordPress

Forums

How to align image in sidebar (14 posts)

  1. Doti07
    Member
    Posted 7 years ago #

    Hello,
    As you can see on my blog, the image on the sidebar (map of new zealand) is too much on the right. I am trying to have it centered or aligned on the left, so it looks nice. I have tried the following code which does not work :

    <div style="text-align:left"><img src="http://www.lautreatelier.fr/campingcarblog/wp-content/uploads/2007/07/itineraire_petit.jpg" alt="notre itinéraire" /></div>

    Would appreciate any kind of help on this. Thanks !

  2. Root
    Member
    Posted 7 years ago #

    You are going to find life a lot easier if you ditch inline styling and put everything in your separate CSS file.

  3. Doti07
    Member
    Posted 7 years ago #

    well I am not a pro and I put this code in a text widget. Do you know how to fix the problem ? Thanks.

  4. jeffholdaway
    Member
    Posted 7 years ago #

    have you tried <center> </center> or <left> </left>

    I understand your fear of css... I am not wanting to learn html any farther than the usual stuff from 1996, lol, unless i need to .. and css files seem like it would take more than a few seconds to learn. (unlike most inline stuff)

    If the above doesn't work then it is likely a style for the sidebar that overrides any formating tags you place. In that case look through the CSS and change any "Right" to "Left" see what moves and change it back. Often there are //comments that will help you guess the right align:

  5. Doti07
    Member
    Posted 7 years ago #

    nothing moves...
    I do know a bit of css and I have spent hours and hours trying to figure out how it works. But I find so much more convenient to have a text widget to use. I assumed it was the purpose of such widget. You must be right, there ought to be something in the css, I'm going there and will come back if I can't find the solution.

    Thanks

  6. Doti07
    Member
    Posted 7 years ago #

    OK, I can't find what's wrong in the css, this image just won't move, please help anyone, I'm lost !

  7. Root
    Member
    Posted 7 years ago #

    I am sure a lot of folks would like to help but there is no way to put this tactfully. The mark up is a mess. Nested tables in lists and all sorts. It is never going to work. I haven't used a table since the end of the last century.

  8. Doti07
    Member
    Posted 7 years ago #

    Please do not hesitate to tell me what's wrong, I won't take it personnally ! I have used a theme (mandigo) and made some little modifications in the css so I don't know what is a mess. Plus my english is not fluent so what are nested tables ? What is the mark up ?

  9. Root
    Member
    Posted 7 years ago #

    The mark up is the xhtml. It was obviously bad in the theme you used.
    Tables of any sort are unnecessary. I do not say you shouldn't use them but a lot of folk here hate fiddling with them. So it is difficult to pin down your image error. And not many people are going to be enthusiastic about fixing it.

  10. Doti07
    Member
    Posted 7 years ago #

    thanks.

  11. Doti07
    Member
    Posted 7 years ago #

    I understand your point. The theme however is pretty cool and I like its options and organisation in my admin, very easy to use and convenient with many various options. Too bad the mark up is bad.
    So if anyone wants to try helping anyway, I would be more than grateful.

  12. Doti07
    Member
    Posted 7 years ago #

    Someone on the French forum found the solution so I added in my css the following :

    .textwidget { margin-left: -20px; margin-top: 5px}

    And it works great. Thanks for the help.

  13. rrhobbs
    Member
    Posted 6 years ago #

    but can it be controlled on a text widget - by - text widget basis?

    i.e. I want an image in one text widget to align (in my case) in the center, but dont want the text (or images) in the other widgets to move from the right where they seem t0 align by default.

    Text in the (text)widget(s) seem to align pretty easily, but this image I am trying to align is being pretty stubborn.

    FYI theme being used in plaintxtblog but this seems inability to align an image in a text widget seems pretty common in just about all the themes I have tried.

    thx for any help.
    RH

  14. rightweb2
    Member
    Posted 6 years ago #

    Make a separate class for the images you want to align differently and assign the class to the image in your html tag.

    I haven't tried it on an image in a text widget specifically, but I have used css classes to insert text boxes within posts and pages with success.

    Take a look at http://christchurchconroe.org/

    Both the "Latest Sermon Illustration" and "Daily Scripture" have classes applied to the contents of the boxes you see which define the box. Shoulw work with images too if you assign them clases.

Topic Closed

This topic has been closed to new replies.

About this Topic