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

HTML

Media queries in HTML

You can use media queries in HTML, same as CSS right?

The twitter widget code is doing my head in.

What I want to do is below a certain height, only show two tweets, above a certain height, three tweets.

You can't do anything with the twitter code via CSS aside from your container and what twitter lets you do.

I thought I'd be clever and have two segments of code. One set to three tweets and one set to two then hide the one I didn't want using css. That broke the widget though. So a no go.

Anyone got any ideas?

If I can use media queries I HTML, then I reckon just putting the two sections of code in queries will work because only one will be loading, not duplicates. I hope anyway.

2 Answers

What about using the media=(max-height:830px) in the tag like I would a class? That work?

No I don't think so, check out dochub.io, maybe go old school and use an iframe and a media query. If that doesn't work, create a codepen so we can get a better idea of what you are working with.

Cool site.

I'm going to go a different route and make the container that the twitter feed in, a fixed height. That'll solve all the problems.