• How do I center my banner ads/ images in php on my right side bar?

    For the life of me I have tried everything to no avail. The are all vearing to the right.

    I do not understand the PHP parameters so hopefully someone will know and post. You can view my website obviously by clicking on my user name to see what I am referring to.

    Thanks!

Viewing 15 replies - 1 through 15 (of 23 total)
  • Might help if we could see what’s going on…

    Usually you can just wrap them with a
    <div>yourjunkhere</div>
    tag. But a link would be most helpful.

    Thread Starter spabizgal

    (@spabizgal)

    HI everyone….

    Here is my code…

    [moderated: too much code. Use a pastebin such as https://wordpress.pastebin.ca and post a link back here instead]

    So can any one make heads or tails as to why its not centering..?

    Thanks much!

    Thread Starter spabizgal

    (@spabizgal)

    I must ad I did no paste my entire sidebar.php code above, here, only part of the way down, however the bottom half of the code is complete, I don’t have anything after it.

    You can also see what is happening here at https://www.spaparazzi.com

    Thread Starter spabizgal

    (@spabizgal)

    anybody have a suggestion?

    Your doctyle is XHTML, but you’re using the <center> tag for the table cell you’re trying to center in. That tag is deprecated in XHTML – that’s why it’s not working.

    Instead, give that cell a class to center the content:

    <td class="center">

    In your stylesheet :

    td.center {
    text-align:center;
    }

    and to top it off, this works in IE, but in other (better) browsers, you’ll also need to give the images themselves a class:

    <img class="center" src="image.jpg" />

    in the stylesheet:

    img.center {
    margin:0 auto;
    }

    Thread Starter spabizgal

    (@spabizgal)

    HI doodlebee, I sent you a message from your main blog usin the contact form.

    Thanks!

    Since this is a public forum, and some people may have issues like this, I’m going to continue responding here (so when a solution is found, someone else may be able to use it)

    Another thing you *seriously* need to look at is the fact that you have several validation errors. Some of them are major – like unclosed table tags. (That right there will cause major issues with your layout.)

    I’d get those fixed before you look into anything else.

    Thread Starter spabizgal

    (@spabizgal)

    I looked at the page you pointed me to. Well I’ll be honest…I am not very html savvy. And not quite sure what they are saying here…

    So should I take it you can’t help me? o(

    I guess my point being if I understood this myself I would not be asking. But this whole thing is really throwing me for a loop.

    Thread Starter spabizgal

    (@spabizgal)

    Can anyone help?

    Those validation errors could be what’s messing up your blog. The link that doodlebee posted shows each line number of faulty code, and gives you the line number so the error is easier to find. The part in red is what it’s saying that you need to fix. The part in red is what you need to add into the code to fix the error.

    Start with the first error listed and work your way down. Some people have found that by fixing the first one or two errors, that the rest are cleared up.

    Personally, I’m not seeing anything veering off to the right, everything appears to be aligned to the left at the moment. The footer looks messier, to me.

    Exactly what ms said – usually if you get the first few cleared up, the rest just fall into place. The link I sent you to *does* give you the line number (and even part of the line itself) so you can find where the error lies.

    And yes, actually, I am doing my best to help you out.

    To make the validation even easier: clicking on the link you will have every error line # as a link that takes you to the exact location of the error in the source code.

    Thread Starter spabizgal

    (@spabizgal)

    Ok some good news…..many of my other issues have been corrected.

    This is my latest code for my left and right side bars, both located in file sidebar.php

    https://wordpress.pastebin.ca/318187

    The problem I am having is that my affiliate banners are not centering under main copy for each side. I also have an orange header appearing under the bottom pic on the left side bar and not sure what is causing that.

    Can someone put a finger on the reason why for both issues and provide the code that would correct this? I have worked through alot of issues juat wanting to find a solution. Up front I will tell you I am not very PHP savvy at all.

    DTD XHTML 1.0 Strict is this codes classification.

    This my site now so you can reference the problem

    https://www.spaparazzi.com

    Thanks again for your help! Almost there!

    Thread Starter spabizgal

    (@spabizgal)

    Hi doodlebee an anyone else that can help!

    Well the errors on the validation page are coming down and are getting better with time. As well my site is looking much improved but here’s the thing….

    I want the urls for the affiliate links to still open in their own window but its saying target=_blank attribute should not be used. It’s works fine but is there something else I could substitute?

    I figured out some other things and the only thing left is this centering of the affiliate banners and removing that orange header field resting under the one image on the left sidebar.

    Not sure where that is coming from. Anyhow the site is getting there but I have tried various workarounds, none seem to be it.

    Also what attributes do I use to center those affiliate banners in my sidebars here in PHP, strict XHTM??

    Thanks for your help.

    AGAIN, below you will now find my most CURRENT paste bin.

    https://wordpress.pastebin.ca/318187

    My site is https://www.spaparazzi.com so you can see in more detail.

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘Images NOT centering in sidebars’ is closed to new replies.