WordPress.org

Ready to get started?Download WordPress

Forums

Align Center Class Won't Work (14 posts)

  1. Gemfruit
    Member
    Posted 1 year ago #

    I have this class in my .css file:

    .aligncenter,
    div.aligncenter {
       display: block;
       margin-left: auto;
       margin-right: auto;
    	}

    I apply it as follows:

    <div class="aligncenter">
    		  <?php echo do_shortcode('[mapsmarker layer="1"]'); ?>
    	  </div>

    If I manually set the align property of the div tag, the content is centered. If I use that class, it is not. Any idea why this is?

  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Pretty hard to debug CSS without seeing the live page... There might be other CSS or HTML structure reasons it's not working. Try using Firebug on the rendered page to see what's going on.

  3. Gemfruit
    Member
    Posted 1 year ago #

  4. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Which element is it? I don't see any class="aligncenter" on that page (try search on the rendered page).

  5. Gemfruit
    Member
    Posted 1 year ago #

    I was live editing just now, I just put the page back to how it was before. I was trying a class called "test-align", with ridiculous properties, to ensure that the class was even having effect. I'm not sure it is actually, as nothing changed, with some crazy high values.

  6. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Try this instead:

    .aligncenter, div.aligncenter {
        display: table;
        margin-left: auto;
        margin-right: auto;
    }
  7. Gemfruit
    Member
    Posted 1 year ago #

    No change with that.

  8. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Now I don't see that element at all. Are you clearing your browser cache?

  9. Gemfruit
    Member
    Posted 1 year ago #

    I'm going incognito, and clearing when / if needed. I've been live editing to attempt to fix this myself, with no luck. Seeing as you're responding very quickly, I'll stop editing and set it as stated above so we can work on it together.

  10. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Now that CSS seems to be gone...

  11. Gemfruit
    Member
    Posted 1 year ago #

    The current page displays the map, aligned left, despite it using the aligncenter class. I changed block to table, as you suggested, which is in the current build.

    EDIT - there was an unwanted -, I had align-center on accident, updated.

  12. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    That CSS is not visible. I also just noticed that that theme is not released under GPL licensing - so it's really not a good theme to be using at all. And we really cannot help with those themes here, sorry, I should have checked on that earlier.

    I'd really suggest you find a theme that's consistent with the values and requirements of WP.

    This maybe useful as well:

    http://www.chipbennett.net/2010/12/10/only-download-wordpress-themes-from-trusted-sources/

  13. Gemfruit
    Member
    Posted 1 year ago #

    What about this theme is against the GPL Licensing? Someone mentioned this to me once before, but gave me no information on why that was.

    I have no idea what is required for the theme to be accepted, but I'll gladly alter it to do so, if someone tells me what's wrong with the current setup >.<

  14. Andrew
    Forum Moderator
    Posted 1 year ago #

    We don't know why your theme is not released under GPL.
    If you would kindly follow the link by clicking on the text, "GPL licensing" in WPyogi's last post, that should explain what license is acceptable by WordPress.org.

    In forum posts on WordPress.org people often convey links through text, so when you see blue and underlined text that means there is a link attached to it. This is what WPyogi posted when she last talked to you about your non-GPL theme.

    It is worth reading on that Chip Bennett resource too that WPyogi posted.

Topic Closed

This topic has been closed to new replies.

About this Topic