02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous VideoNext Video

Designing by aspect ratio

When we think about web design we normally think in pixels or even in percentages but if we really want to take advantage of users screens we need to know there aspect ratio of their screens. Is the users screen a widescreen or a traditional one? What type of design considerations can we take with this information in hand. In this lecture, we will learn about designing for aspect ratios %u2013 this becomes really important in video projects.

Keynotes:

  • Why should we care about the aspect ratio of the users screen?
  • Finding out the devices aspect ration
  • TV rules (scan).

Properties:

adoptive design, aspect-ratio, device-aspect-ratio, tv scan, progressive, interlace

Video Transcript

00:00We are nearing the end of this section and you really know most of what you basically know almost everything. There's only two
00:07Lectures left to really talk about things that you should be aware of and we're gonna start off in this lecture talking about designing by aspect
00:14Ratio, we've met the aspect ratio before but we're gonna intertwine that and connect it to the developing for televisions
00:22So that's when you should care. It's really mainly when TV or video projects in general where
00:28in many ways o two if you really want to create a design that looks great and you see that you're
00:34You have a really a big gap in your users if it's on the desktop or any other platform where there's the differences in the resolutions
00:42You really want to take advantage of that
00:43So we're gonna talk about that and we're gonna talk about those ratio media queries and how to work with them
00:49And finally last but not least will also introduce the scan
00:53Which is a TV rule that enables you to create rules for specific scenarios on your TV if you're building for TV
01:00And obviously this is gonna be fast-paced. There's not a lot of things that we need to cover
01:05So let's jump right into it and I really want to start by going directly into
01:10Into our CSS and in our CSS what I want to do
01:14Is I want to create another media query rule and in this media query rule?
01:18I'm gonna set here a media
01:19I'm send it to only and screen again
01:22And let me just break the lines here a bit so we could see it more easily
01:25And I'm gonna set it to end and in this time around I'm gonna say I want an aspect
01:31Ratio of one divided by one which basically means one now in in other words
01:37I'm looking for an aspect ratio of a perfect square in the case of a perfect square square
01:42What do I want to do? I want to set my opacity
01:46Let me do my body
01:49Opacity
01:50to be zero
01:51Literally making everything invisible
01:54If I go ahead and I click on refresh on my project and I just go ahead here click on refresh
01:58Go to that current resolution that I'm in and try to match up that 642 with a 642
02:05Let me just find it right here
02:07800 700
02:09640 and
02:11At some point we're gonna get rid of everything up. There we go
02:15Boom, we just got rid of all of our body
02:17So really this is the not a real scenario that you would actually use it
02:21But that is the basics of media query rules and I'm gonna leave that there just for you
02:25So you could play around with it, but I'm gonna go ahead and continue because really in a real world scenario
02:31You might have media query rules that reflect TV's
02:35definitions and in a TV definition you might have a TV definition of maybe a wide screen TV and if you have a
02:42Widescreen TV, then you're gonna do a specific scenario and you're not gonna design it for a 42 inch or whatever TV
02:49You're gonna design it based on ratios and that sort of aspect ratios become really really critical and I would set here a device
02:59Aspect ratio and the device aspect ratio in this case, which is only a screen
03:04Maybe screen is not appropriate at this stage because really if we go back and you'll find in your source files here again in your references
03:10You'll see that in our measurement types. One of the measurement types is a TV
03:15Contrary to screen. You might go ahead and say hey, let me just set this to be TV
03:19I personally would recommend just avoiding using TV in general because it is
03:25It does not reflect what it does really besides a TV as a type of a screen as well
03:30So you might just drop that whole thing out to get all together because in the future version of CSS
03:35It will probably not be supported that is my prediction because the CSS rules media
03:41Chord rules are going more and more towards features focusing on features and less
03:46focus on specific
03:48Elements and with that said so what can you do here instead of TV? You might say well
03:52There's two different types of TVs. You have TVs that have a progressive
03:57view which basically means it's frame by frame and there's different frames or interlaced where the the
04:02There's an overlap of frames. So you literally could go ahead and say okay. So instead of that I'm gonna go instead of setting a TV
04:09I'll set here a scan and
04:11I'm gonna go ahead and say hey only if the TV is a scan and that scan equals
04:17progressive
04:18Then only a progressive scanning TV that has a device aspect ratio
04:23Then I'm gonna set that opacity again, or maybe I'll do something else. I'll do here something that I did not define
04:29All right
04:29so that really the covers the basics of how do you work with the TV and again make sure that you go into the
04:35References that we have in the article because you'll build it
04:37You don't have to memorize these stuff
04:38But just being aware of it if in a few months or a few years you need to develop for a television here you go
04:44You have their basic rules how to work with creating for television now as well
04:48And this wraps up this topic because I've said everything I have to say about it
04:52But before I say goodbye
04:53I want to talk about one thing that we did not mention what happens if you want to have a TV ratio of 16 by 9 or
05:0110 by 20 16 by 10 maybe those two ratios work perfectly aligned together
05:07There is no or currently in CSS 3 there is no or in our media queries
05:12So for us to do an or if you haven't guessed it yet
05:15It's literally just to create another rule by setting up a comma and then just putting all the rule
05:21Basically putting all the rule all over again starting from that only area so I could just copy that only there and just add that
05:28Other rule here and have a secondary rule that would be applied afterwards using a comma and that covers
05:36Everything really we had to talk about because I am done with this lecture. So what are we doing in the next lecture?
05:42Well in the next lecture we're wrapping things up
05:45We're gonna talk a little bit of color and grids, which is really the two remaining topics that we didn't cover
05:50It's gonna be a more theoretical item and with it. We're gonna complete this section

Ready to Level Up Your Skills?

Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!

Enroll Now for Free!