Support » Themes and Templates » How to center an image in an "image box" on my homepage

  • Hello everyone,

    I’ve been trying to google and play around with how I could center an image uploaded into an “image box” on my homepage so that the image displays centered on my page.

    Right now the image is shifted to one side more than the other and off center.

    I’m sure it is possible and simple to do.

    Any help would be greatly appreciated.


Viewing 12 replies - 1 through 12 (of 12 total)
  • You should always try to include a link to your page to make it easier for us to offer suggestions.

    Did you try setting the left and right margins to auto?

    Awesome, thanks so much Bruin, I added the following code to my style.css:

    div.imgboxes_style1 {
    display: block;
    text-align: center;
    margin-left: auto;
    margin-right: auto; }

    and it worked.

    P.S: Also, sorry about not posting a link to my website, it is actually not up yet (private)

    I also have another question (not sure if i should make a new post):

    I’m trying to add a small javascript code to my homepage:

    “<div id=”coindesk-widget”></div>
    <script type=”text/javascript” src=”//”></script>”

    but everytime I add it and reload my homepage, it just goes into an endless “loading” stage loop permenantly until I remove the javascript code. Sometimes it will work the first time, but never again if i reload the page.

    I asked the creator and he said javascript doesn’t play will with wordpress? There must be a work around though!

    **If you need to see my webpage I can give you a dummy username and pw.

    Thanks again!

    Did you try adding http: to the beginning of the src attribute?

    <script type="text/javascript" src="">

    Nope, I didn’t try that but I tried it just now with the same results.

    I’m using a kallyas template if that is any help.

    I copied your script code to a page on a sandbox site of mine, and it seems to work OK, so I don’t think it’s a WordPress issue.

    How are you adding the script to your page, using the Text editor? You’re not including the quote marks around the whole thing, are you?

    You can also try adding the code to a text widget in a sidebar, since the size of the graphic appears to be small enough to fit.

    I am adding the script using the text editor (not visual) and i’m not including the quotation marks around the script. I also tried inserting it into an “image box” and a “text box” and a “text widget”. I also tried using a plugin called HTML Javascript adder widget.

    All have the same frozen load screen 🙁 This is frustrating for something so simple!

    Some other things to try:

    1. Try adding adding the script to a page other than your home page to see if it works.
    2. Try switching to a default theme, like TwentyThirteen, and see if works. I changed my sandbox theme to TwentyThirteen and it still works.
    3. Try copying the javascript file to your own site, then change the src attribute to point to the new location.

    Hello again! Sorry for the delayed response I got caught up with midterms, etc.

    Here are the results from trying the 3 things you suggested:

    1. I added the script to different pages with the same results as the homepage
    2. I changed theme to twenty thirteen and it works flawlessly
    3. Not sure how to do this one at the moment, but i’ll get back to you when I figure it out and try

    Its weird that when I refresh the page it will randomly load correctly but most of the time it will not load the page. Sometimes it will load my page but it will look faded and I cant click anything.


    I think I randomly fixed it with your suggestions! It came to me that since it worked in another fresh theme, maybe there was some option I needed to edit under the “kallyas theme” options. I randomly decided to turn off “use page preloader” and now it works every time!

    Thanks so much Bruin. If you have a bitcoin wallet (i.e a bitcoin address) I can send you a tip (it won’t be much- because I don’t have much, but it could be my token of appreciation!)

    Glad you were able to work it out. I don’t have a wallet, yet; a friend offered to set one up for me, but I haven’t taken him up on it, yet. Once your site is up & running, and if it’s publicly visible, post a link, I’d be interested in seeing it.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘How to center an image in an "image box" on my homepage’ is closed to new replies.