• Resolved m-dawg

    (@m-dawg)


    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. https://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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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…

    Thread Starter m-dawg

    (@m-dawg)

    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.

    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.

    Thread Starter m-dawg

    (@m-dawg)

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

    Thread Starter m-dawg

    (@m-dawg)

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Centring elements’ is closed to new replies.