Introduction to Viewport Units

Поделиться
HTML-код
  • Опубликовано: 26 мар 2018
  • How can you use new CSS units - viewport units - to size content that changes in response to the viewport size? Jen introduces you to how vw, vh, vmin, vmax can be used in creative ways.
    Demos:
    • labs.jensimmons.com/2017/01-01...
    • labs.jensimmons.com/2016/examp...
  • НаукаНаука

Комментарии • 71

  • @hoppeldesign4886
    @hoppeldesign4886 6 лет назад +101

    I watched this video at 6am yesterday and my head exploded. I just spent the afternoon re-writing a significant amount of code for a project coming due, using Viewport Units to control various CSS Grid elements on a landing page. I got rid of all of the media queries I was using. So much cleaner and smarter. And best of all? It works WAY better across every viewport. I just broke singing "A Whole New World". I sang both parts.

  • @klikmaker
    @klikmaker 6 лет назад +6

    I've been waiting for the other shoe to drop, in the sense that I've been waiting for Jen Simmons to put out a video where I don't learn something, even about things that I think I understand. It hasn't happened yet, and I'm beginning to think this is a one-shoe operation. (I never know...in case I'm being too obtuse, that's a compliment.)

  • @skylinecanvas
    @skylinecanvas 6 лет назад +5

    Great video, always learn new tips from you Jen. Thank you.

  • @drewaugust
    @drewaugust 6 лет назад

    The explanation is amazing. Not only on the unit, but the history and spec about the unit. I am watching every video. Subscribed!

  • @silentblackhole
    @silentblackhole 5 лет назад +1

    Loved your thoughts at the end of this video on the history of the edges, esp the bottom edge. On point.

  • @lorenzojavier-av
    @lorenzojavier-av 2 месяца назад

    I am beginning to use CSS. This video was helpful. I will probably be watching all your other videos for a while. Thank you for sharing your knowledge so succinctly.

  • @akramsaouri
    @akramsaouri 6 лет назад +8

    Loving the show, keep it up.

  • @lamaruga4577
    @lamaruga4577 6 лет назад

    All the videos are always great, thank you for triggering our curiosity

  • @zaboogoosfraba6699
    @zaboogoosfraba6699 6 лет назад +1

    I was hoping you hadn't forgot your fan club . Thank you for this video!

  • @ozzyfromspace
    @ozzyfromspace 4 года назад

    This woman is a CSS goddess lol! Fantastic video, so informative 😃. This wasn't a specific tutorial. It was a glimpse of THE BIG PICTURE and she nailed it!

  • @evilofbanality
    @evilofbanality 6 лет назад +4

    This show is always so thoughtful and interesting. Thank you so much for it.

  • @poneis88
    @poneis88 5 лет назад +2

    I would like to thank Jen for another excellent video. I am creating my first landing page and I am determined to add responsive features from day one, though I waas struggling to grasp all the concepts necessary to make this happen.

  • @stevenseah9168
    @stevenseah9168 6 лет назад

    amazing. been watching this non stop.
    Pls do more and more. TQ!

  • @vladyn
    @vladyn 6 лет назад

    A very useful overview - thank you!

  • @gjb7966
    @gjb7966 4 года назад

    Thank you, Jen! Love your videos!

  • @philipelizaga3813
    @philipelizaga3813 Год назад

    thank you ma'am, your message is straight and clear and it helps me a lot

  • @user-ot1dk4fd8i
    @user-ot1dk4fd8i 6 лет назад +1

    You're just amazing! Great videos and great explanation. Keep up with good videos!

  • @TechtecnoArgentina
    @TechtecnoArgentina 5 лет назад

    Hello, I'm Elias Nielsen, your tutorials are very helpful.

  • @AlvomaniaDK
    @AlvomaniaDK 3 года назад

    This is incredibly sweet tutorial, thanks indeed

  • @edwassermann8368
    @edwassermann8368 Год назад

    Love the possibilities this opens up.

  • @michongoma7598
    @michongoma7598 6 лет назад

    Very educative! please continue . . .

  • @adrianqx
    @adrianqx Год назад

    Thank you , thank you, thank you this made so much sense !

  • @yakine13
    @yakine13 6 лет назад

    Such quality with such a nice voice...

  • @aritrapaul5145
    @aritrapaul5145 2 года назад

    I hope you are well ma'am ....discovered your channel just last week, watched all of them and learnt a lot...
    Will wait for some new tutorials :)

  • @vincentreynaud7
    @vincentreynaud7 5 лет назад +2

    Thank you for this useful video! I was also hoping that you would address the issue of using vh on mobile (navigation bars showing and hiding disrupt elements using vh). Maybe in a next video?

  • @naruto5437
    @naruto5437 4 года назад

    best channel on css

  • @usamasaad9334
    @usamasaad9334 Месяц назад

    Your way of talk is so beautiful

  • @0verkilla
    @0verkilla 4 года назад +1

    I love to use
    height: calc(100vh - whatever)
    great explanation as always!

  • @thiagovilla970
    @thiagovilla970 6 лет назад

    Thank you for helping us build a better web

  • @dr__ey
    @dr__ey Год назад

    thanks so much for this explanation !! :]

  • @AbhishekKumar-mq1tt
    @AbhishekKumar-mq1tt 6 лет назад +2

    Thank u for this awesome video

  • @nick8292
    @nick8292 6 лет назад +1

    Thank you, very useful.

  • @sigmaviscount6631
    @sigmaviscount6631 Год назад +1

    I read your book Jen. You are such a goddess on this. ❤❤❤

  • @jayandrews2358
    @jayandrews2358 6 лет назад

    Great Stuff, thanks so much!

  • @TrueMiiRiiCo
    @TrueMiiRiiCo 4 года назад +2

    i used JS before to find out the width and the height of a page, save them in variables, recalculate them if the browser gets resized and set the new height and width to the header... viewport units make everything so much more easier ^^

  • @ruffneck718
    @ruffneck718 6 лет назад +1

    Thank you for sharing.

  • @remymartins6778
    @remymartins6778 6 лет назад

    Thanks. Kept to minimum and no detail left behind.

  • @topreyalite
    @topreyalite 9 месяцев назад

    Very good explanation

  • @fdc_8507
    @fdc_8507 6 лет назад

    Thanks jen
    I'm big fan for you

  • @danielsokil9529
    @danielsokil9529 6 лет назад

    Can't wait to see advanced animation techniques.

  • @santiagomedinafiguera7280
    @santiagomedinafiguera7280 4 года назад

    You're great I miss you.

  • @josephbillingsley2561
    @josephbillingsley2561 6 лет назад +2

    Great video. Any tips on what to do on mobile browsers where the toolbar disappears on scrolling, causing the viewport height to change? It would be nice to use CSS for this but it ends up causing the whole page to shift unpleasantly as you scroll through it

    • @gentlemanfinn86
      @gentlemanfinn86 6 лет назад +1

      Joseph Billingsley see this. Although not a pleasant answer. stackoverflow.com/questions/37112218/css3-100vh-not-constant-in-mobile-browser

  • @Tiger__Man
    @Tiger__Man 3 месяца назад

    I changed my whole code i had a bad thoughts about vh and vw . I was changing the font size each break with media queries. now I guess I don't need to. thanks to you

  • @alikhalil2863
    @alikhalil2863 5 лет назад

    thank you a lot

  • @gromett
    @gromett 4 года назад

    Thank you :)

  • @akanmuoluwaseyi5187
    @akanmuoluwaseyi5187 2 месяца назад

    This is so amazing...
    thank you madam, Jesus bless you real.

  • @geralddarkobekoe
    @geralddarkobekoe 5 лет назад

    That was helpful

  • @curiousme7796
    @curiousme7796 4 года назад

    hello there, great tip i am sure as i am not a web designer but trying to use divi themes to create one now, can we use viewport values in wordpress sites, would it be possible to see some visual examples how and where to feed these values, though it maybe is too much to ask but it will definitely help a great deal as i am breaking my head as hoe to set big images for all devices :)

  • @jasper2virtual
    @jasper2virtual 5 лет назад

    I have a page, the content will be scaled up or down depends on screen width, by transform:scale . Can it re-coded by vh vw?

  • @Shacharzadik
    @Shacharzadik 6 лет назад +1

    ?Great video! What's the difference between using 100vh against using percentage-based sizing - 100%

    • @survivelikehoneybadger
      @survivelikehoneybadger 6 лет назад

      Shachar Zadik I think it's the height - if you set the height to 100% - it will fill all your page, but viewport takes up the size of the viewport. I think the width makes no difference if it's percents or these unita

    • @survivelikehoneybadger
      @survivelikehoneybadger 6 лет назад

      ruclips.net/video/0DbKJnxxAAc/видео.html here it's also good explained

    • @PaulSebastianM
      @PaulSebastianM 5 лет назад

      Well, first off I think, % relate to the parent container if I'm not mistaken, while v* units always relate to the viewport size, ie. browser, screen, etc.

  • @joseflores-cx5ld
    @joseflores-cx5ld 4 года назад

    muy buen contenido sobre todo header { display: flex; height: 100vh;}

  • @dddsde3039
    @dddsde3039 2 года назад

    how did you do it can you share with me , thank you

  • @KhanKhan-ym4mo
    @KhanKhan-ym4mo 2 года назад

    vw includes scroll bar width, shouldn't we prefer % instead?

  • @EvgenichTalagaev
    @EvgenichTalagaev 2 года назад

    Спасибо, практически ничего не понял, но было интересно.

  • @normanvasquez5968
    @normanvasquez5968 5 лет назад

    What about in mobile devices, I want divs to have the size of the whole viewport, but is not working. Worst of all, the problem is different for each browser.

  • @Sdirimohamedsalah
    @Sdirimohamedsalah 3 года назад

    port mean real screen size? (physical size) ?

  •  5 лет назад +2

    I dislike viewport units because they effectively turn off zooming in browser. As someone who uses page zoom a lot on desktop (I am quite myopic), it bothers me a lot when I see a page poorly designed with viewport units. I've decided not to use them, but if you do, I suggest caution.

  • @shivamathiya8384
    @shivamathiya8384 6 лет назад

    Which one is better viewport units or fr units in grid

    • @LayoutLand
      @LayoutLand  6 лет назад

      It depends on what kind of result you want, what kind of content you have. Did you see the video on FR units? I recommend watching that next if you haven't. There's actually a 3-part series on the different kinds of units you can use.

  • @abhay2192
    @abhay2192 2 года назад +1

    👍😁

  • @Clawzoftime
    @Clawzoftime 5 лет назад

    I am the silent fan

  • @eggy794
    @eggy794 6 лет назад +2

    Viewport units are not reliable on mobile devices, which means we can't use them in real life apps and websites.

    • @gentlemanfinn86
      @gentlemanfinn86 6 лет назад

      Marcin Cichocki Interesting. I had to look it up and found this stackoverflow which has a ton of information on the subject.
      stackoverflow.com/questions/37112218/css3-100vh-not-constant-in-mobile-browser

    • @kjellruben
      @kjellruben 5 лет назад

      You can easily change from VH or VW to px going to pads and phones. But I see your point. :)