WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Centring elements (6 posts)

  1. m-dawg
    Member
    Posted 2 years ago #

    Hello,

    Something very basic is driving me nuts. I can't figure out -- even with Inspector -- what it is in my CSS that's preventing anything on my development page from being in the centre. http://www.thebutterfliesareattacking.com/home-2/

    If anyone smarter than me can figure it out (it'll probably take less than a sec for you guys!) I'd be eternally grateful. Not only is the accordion not in the centre of the page, the table isn't in the centre of the accordion. Gah!

    Cheers.

  2. WPyogi
    Volunteer Moderator
    Posted 2 years ago #

    Making the "accordion" wider essentially centers it. You can add a width attribute in the css for the accordion plug in:

    .wp-accordion {
    /*	border: 1px solid #F00;*/
            width: 940px;
    	margin: 20px 0;
    
    }

    I used 940px which seems to be about right -- but you can fuss with it however you like.

    When you use plug-ins, they don't always "fit" perfectly with the theme...

  3. m-dawg
    Member
    Posted 2 years ago #

    Yes, the problem with widening is cross-browser compatibility. For some reason Firefox likes to make things wider than they are and I have no idea what anything looks like in IE (yet). I'll faff with it but what I'd rather it was "clean". Thanks though.

    Still, if there's a "clean" solution that enables me to centre it I'd rather use that. And incidentally, if anyone's using IE and would care to tell or show me what they see that would be incredibly helpful... I'm on a Mac which makes everything look better :-) And Wine is a waste of time.

  4. WPyogi
    Volunteer Moderator
    Posted 2 years ago #

    There is not a simple solution because there is a lot of complicated CSS code from multiple stylesheets and many nested elements that are involved. You'll have to be fairly good at CSS to do what you want. Generally, it is beyond the scope of these forums to provide detailed CSS help...though some of us help when and where we can.

  5. m-dawg
    Member
    Posted 2 years ago #

    Fair enough. Thanks anyway, I'm going to give widening it a crack. Might play around with margins too though it's quite hacky.

  6. m-dawg
    Member
    Posted 2 years ago #

    Weirdly, I fixed it with padding rather than margins, but that plus a little judicious resizing did the trick.

Topic Closed

This topic has been closed to new replies.

About this Topic