• Resolved kosis

    (@kosis)


    I am having the old problem with images centering in IE but not in Firefox but am unable to resolve it.
    Theme: Painter.

    Sample page:
    http//www.carolineschelling.com/index-of-letters

    I am using WP’s html editor.

    I’ve found so many different suggestions for solutions that I am quite confused now.

    My code for one of the offending images is:

    <p style="text-align:center"><img class="size-full wp-image-1033 aligncenter" src="https://www.carolineschelling.com/wp-content/uploads/2009/08/Caroline-Briefe.bmp" alt="Caroline Briefe" /></p>

    A search turned up the following explanation:

    “To centre a block you are supposed to set margin-left and margin-right to auto, but IE doesn’t honour this, so you have to use
    text-align:center to make IE happy, plus margin-left:auto;
    margin-right:auto for the standards compliant browsers.”

    I would prefer a global solution (on my theme’s CSS Style Sheet?). Is a global solution possible in the form of?:

    margin-right:auto;
    margin-left:auto;

    It seems (though I am not sure) that the Image-Media Uploader Problems sticky (at the top of this Troubleshooting rubric) might be addressing this issue:

    Additional Questions:
    Q: The gallery’s align left/center/right selection box doesn’t work!

    since the solution it offers is coding precisely the margin elements in the CSS style sheet (I’m using the Painter theme). But I’m unsure.

    I am a beginner with coding but am trying to learn.
    Thank you.

Viewing 15 replies - 1 through 15 (of 18 total)
  • Edit style.css and add:

    .entry img.aligncenter {
    margin-left:auto;
    margin-right:auto;
    }

    to the bottom of the file. The information you have been using concerning IE is out-dated.

    Thread Starter kosis

    (@kosis)

    Thank you, esmi, on both points.

    Adding that code to the bottom of style.css unfortunately did not work.

    My style.css contains the following:

    .aligncenter {
      display:block;
      margin:auto;
    }
    
    .alignleft {
      float:left;
    }
    
    .alignright {
      float:right;
    }
    
    .entry img.aligncenter {
    margin-left:auto;
    margin-right:auto;
    }

    The code you suggested is last.
    I also tried it deleting the first code about “align center” etc., but that did not work either, so I put it back in.

    Any suggestions?
    I do appreciate the help.

    I did test the suggested CSS out on your site using Firebug and it worked. Remember to press CTRL and F5 simultaneously when viewing an updated page/site. Or try emptying your browser cache. This should ensure that your web browser fetches a fresh copy of the page rather than serving up an out-dated copy from your own cache.

    Thread Starter kosis

    (@kosis)

    Thank you, esmi.

    The image still centers in IE but not if FF.

    I emptied my browser cache, deleted my history (“Everything”) in FF, also pressed CTRL and F5 simultaneously, and the image is still not centered in FF.

    Are you viewing it in FF?
    Did I enter the code in the correct place?

    This line(in style.css) is re-setting the margin on the image..

    .entry img
    {
      margin:5px;
    }

    Get rid of that css definition and the image will center appropriately.

    Thread Starter kosis

    (@kosis)

    I do not see that code in my style.css sheet.

    The only coding I see is what I posted above. Where is that coding?

    Thread Starter kosis

    (@kosis)

    Could you highlight in my style.css above exactly what it is I am supposed to delete?
    Many thanks.

    @t31os_ showed the code to delete

    it’s in the
    Entradas do Usu??rio
    section of your style.css near the bottom of the sheet

    Thread Starter kosis

    (@kosis)

    Thanks RVoodoo.

    There is no Entradas do Usu??rio at the bottom of my style.css.

    Everything that is on my style.css is posted above (except for the theme author’s copyright etc. (in /* etc.) at the top of the style.css.

    I must be missing something very obvious, but I do not have that code
    anywhere on that page. Is this a problem with my theme (Painter)?

    I’m very confused now.

    wp-content/themes/painter/css/style.css

    It most certainly is in there, look here if you must.
    https://www.carolineschelling.com/wp-content/themes/painter/css/style.css

    If you go to the bottom and scroll up a bit you’ll see it below the section.

    /**************************************************************************************************
      Entradas do Usuário
    **************************************************************************************************/

    I’m looking at your style.css right now……

    here…you can too!

    https://www.carolineschelling.com/wp-content/themes/painter/css/style.css

    (maybe you have 2 of them?) this one is in the css folder

    Thread Starter kosis

    (@kosis)

    T31os_ and RVoodoo:

    Thanks so much to both of you.

    Please excuse me, but perhaps this is part of the learning curve.
    If I may regress a moment:

    The only style-css editor I have ever used or even known about is the one accessible on my WP Edit Themes screen. I did not know this one (a notepad file?) existed.

    I thought only the one accessible through WP Edit Themes could be edited.

    I just deleted the code T31os_ posted above, then saved the changed notepad file, but when I looked at it again, the code was still there, presumably because I was saving it only to a temp location?

    How do I delete that coding (T31os_, I assume you meant the entire code, not just “5px” or something like that?) and save correctly?

    I appreciate your patience. This file is completely new to me. I think I’m almost there.

    Thread Starter kosis

    (@kosis)

    Follow up:

    Presumably I could download it via FTP, edit it, save it, then upload it back into the theme CSS folder at my host. Is that correct?

    Or is there an easier way, directly from the WP Dashboard?

    Thanks.

    Thread Starter kosis

    (@kosis)

    Sorry; double post.

    it’s not really a notepad file, its a .css file, it can be edited in notepad….or any text editor

    how did you edit that file? just by visiting that link? You are correct, that only edits the file on your computer.

    You now need to upload the file by ftp (or using a file manager if your host has one)

    delete the old style.css in the css folder, and upload the edited version you just made (make sure when uploaded its still called style.css)…. (or some hosts allow online file editing….you can just edit the css through your host if thats the case)

    EDIT–your new post is correct, FTP. Unfortunately, you cant edit the style.css in the css folder through the WP interface)

    You may also need to include your image stuff from farther up this thread into that style.css file in the css folder

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Image Centering in Firefox’ is closed to new replies.