Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Flexbox Layout Building a Layout with Flexbox Creating a Two Column Layout with Flexbox

Sean Walsh
Sean Walsh
14,727 Points

Problem creating a two column layout with Flexbox using WordPress widgets

I have been struggling with this for a few hours.

I am trying to create a two column layout, putting two WP widgets in the same row, when browser window is over 900px.

@media only screen and (min-width: 900px) {
    .front-page-3,
    #text-6,
    .wpgmza_widget {
        display: flex;
        flex-direction: row;
    }
}

This seems to just distort the content, and they still appear on separate rows.

Any help would be hugely appreciated!

Thanks, Sean

1 Answer

Sean Walsh
Sean Walsh
14,727 Points

I think I have figured out where the main problem is, but I do not know how, or the best way to go about fixing it.

the .front-page-3 selector I have used above is being used for all widgets on the page, not just the two I am trying to lay out side by side. So I think it should fix the problem if could add a custom class to the two widgets I am trying to lay out, but I am not sure of the best way to do that. I found a widget that could help me, but it doesn't seem like it is a good way to do it.

I hope this all makes sense...