uikit / uikit-site

🌎 Website and Documentation
https://getuikit.com
365 stars 331 forks source link

Fix code sample using Viewport height #33

Closed sendz closed 7 years ago

sendz commented 7 years ago

Use this code sample will not work

<div class="uk-cover-container" uk-height-viewport>
    <img src="" alt="" uk-cover>
</div>

Instead, use this

<div class="uk-cover-container uk-height-viewport">
    <img src="" alt="" uk-cover>
</div>
floriandotpy commented 7 years ago

Hm, actually, both versions should work. If the "attribute" version is not working for you, can you please confirm that you have loaded the UIkit JavaScript? Without, it won't work.

As you can see, the test of the Cover component also uses the viewport-height attribute and it works: http://localhost/uikit/tests/cover.html

janschoenherr commented 7 years ago

The JS version has optional features:

Docs: https://getuikit.com/docs/utility#viewport-height

Tests: https://getuikit.com/assets/uikit/tests/height-viewport.html