Pure CSS Parallax Scrolling | No JavaScript | HTML & CSS

Поделиться
HTML-код
  • Опубликовано: 16 ноя 2024

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

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

    Join discord here: discord.com/invite/8jf6bkqSGF

  • @АртурКарецкий
    @АртурКарецкий 6 лет назад +381

    html{
    height: 100%;
    overflow: hidden;
    }
    body{
    color: #fff;
    margin: 0;
    padding: 0;
    perspective: 1px;
    transform-style: preserve-3d;
    height: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
    font-family: "Luna";
    }
    header{
    box-sizing: border-box;
    min-height: 100vh;
    padding: 30vw 0 5vw;
    position: relative;
    transform-style: inherit;
    width: 100vw;
    }
    header h1 {
    margin-top: -100px;
    }
    header, header:before{
    background: 50% 50% / cover;
    }
    header::before{
    bottom: 0;
    content: "";
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    display: block;
    background-image: url(1.jpg);
    background-size: cover;
    transform-origin: center center 0;
    transform: translateZ(-1px) scale(2);
    z-index: -1;
    min-height: 100vh;
    }
    header * {
    font-weight: normal;
    letter-spacing: 0.2em;
    text-align: center;
    margin: 0;
    padding: 1em 0;
    }

    • @mikkelpedersen785
      @mikkelpedersen785 6 лет назад +27

      fucking love you

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

      Bro!!!!! 👏👏👏

    • @pritammehta7770
      @pritammehta7770 5 лет назад +33

      you can copy code from here. But please play full video twice. because chennel also need support.

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

      You are god...

    • @goal_diggers7
      @goal_diggers7 5 лет назад +32

      📝If you want to add something else after picture you will add html code in header
      _________________
      If it help you put like👍 and write a comment.
      ________________
      📝And in css code add
      __________________
      #exm {
      position: absolute;
      background: #fff;
      margin-top: 200px;
      height: 100%;
      }

  • @Somfic
    @Somfic 6 лет назад +681

    Activate your windows

  • @StarChildInABubble
    @StarChildInABubble 5 лет назад +15

    CSS3 has become so powerful and I LOVE IT!

  • @johnyonardpauly5601
    @johnyonardpauly5601 6 лет назад +14

    This is more enjoyable when you write codes while watching this video :) Brilliant tutorial for me as a junior web developer, thank you!

  •  6 лет назад

    The code is Ok. Only remenber give a blackground color to view text and format - add tags to view content hidden by picture, as example body > p {padding:20%; font-style:variant;} and of course, add content into to the page ;)

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

      me puedes ayudar porfavor? no consigo añadir texto ni nada en la parte de abajo de la pagina, que tengo q hacer?

  • @alanbarrientos5236
    @alanbarrientos5236 6 лет назад +28

    In the intro version works, in the final version only works the text, the image don't has the parallax effect.

    • @nutanpanta9238
      @nutanpanta9238 5 лет назад +7

      for that in img in the css part use background-attachment:fixed

  • @0001-exe
    @0001-exe 4 года назад +2

    OMYGOSH I'VE BEEN LOOKING FOR THIS THANK YOU!!

  • @matugan
    @matugan 4 года назад +12

    Lmao “Activate you’re windows” same as me)))

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

    El efecto del comienzo del video es más notorio que el que quedó al final, gracias saludos

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

    The transform - translateZ / scale is a neat trick - very nicely done!

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

    bhai majaa aagaya....yisme jo majja hai main sabko dena chahata hu

  • @abulfazlhaidary4625
    @abulfazlhaidary4625 5 лет назад +3

    Nice effect
    Nice background music
    Good stuf.

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

    Great tutorial and taste in music. Clozee is so sweet!!

  • @braydenparker2814
    @braydenparker2814 6 лет назад +21

    All you have to do to make thee parallax effect is in the same tag the you put the image link, also include 'background-attachment: fixed'

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

      where do i need to put it? i do not understand

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

      thanks

    • @braydenparker2814
      @braydenparker2814 6 лет назад +3

      for example:
      tag {
      background: url('img');
      background-attachment: fixed;

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

      Thanks a lot Gaming 101, you helped me so much !

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

      No problem!

  • @КостянЕрмаков-е9ю
    @КостянЕрмаков-е9ю 6 лет назад +8

    Это было круто! Спасибо, дружище!

  • @mina_ashraf
    @mina_ashraf 6 лет назад +19

    please can you make another video explaining each step and its function or effect on the html. your work is awesome but we came to learn and if we found this here we would all support you by subscribing, liking and even by sending money on patreon. thank you

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

    My very fist html css web project . I still remember how i made with lot of trail and errors

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

    If you guys want some more in depth explanation, search for 'Parallax On The Web (Part 2)' from DevTips

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

    De los mejores videos que he visto en mucho tiempo, sigue subiendo vídeos de este tipo porfavor.

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

      sabes como hacer para poner contenido en la parte de abajo? al principio del video sale texto puesto pero luego no explica como

  • @codegrid
    @codegrid  4 года назад +18

    Source Code : bit.ly/2UdEoCs

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

    awesome tutorial ,by the way, I like the background music

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

    Good tips. I dont like themes that use that, but it's neat work. I enjoy working with as much HTML as possible. Always have.

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

    Thanks dude!
    I love the entitlement displayed in the comments.
    I thank you for taking your time to share your knowledge to all of us for free. I hope YT gives you a little bit of ROI of your time.

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

    Can u please tell me how can I add sticky nav bar ( from ur sticky nav video) in this parallax effect... I tried to merge the code but the nav bar is not becoming sticky. Please help me

  • @undefined5339
    @undefined5339 6 лет назад +16

    Your level of Front End is awesome! Good Video... Like and new suscriber, waited more.

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

    I like the active windows watermark

  • @bardjus1236
    @bardjus1236 5 лет назад +5

    Hi, I'm from Russia and you helped me a lot

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

    Which editor is that? Pls lemme know and I loved this website design thanks

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

    Just simply add the css code in your body element;
    background-attachment: fixed;
    and you're done. The video was irrelevant to be from scratch.

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

      No. Try it and see what happens. Make sure you check out the output you get from this code. Pay attention and you'll see the difference.

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

      It doesn't work on iOS and most of mobiles

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

    really helpful tutorial. But can i pls know wut is the font ur using i really like it

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

    Thanks for the helpful tutorial. I have never used CSS before so will need to learn it. Until then is there a way to create parallax scrolling in CSS in Design View?

  • @the1roberge
    @the1roberge 6 лет назад +9

    How do you put text in the whitespace after the effect? I have been trying using footers but they move when scrolling...

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

    THANK YOU! first code I could actually get working on my site!

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

    I mean you could just do this:
    background-attachment: fixed;
    to the background image to get a parallax effect.

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

      Try and match the result with this.

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

      it's also not great for performance

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

    Which text editor is best suggest me ?
    ✓sublime text 3
    ✓brackets
    ✓atom
    Or any others

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

      As a small text editor I use sublime. As a full-on IDE, I use JetBrains WebStorm (or Intellij IDEA, if you want the same thing but for more than just web dev). Visual Studio Code is also highly recommended and free.

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

    Parallax has been my single fav site design flavor for years but I’m not a coder. Where do we get this CSS and is it mobile friendly?

  • @Ryz3FN
    @Ryz3FN 4 года назад +1

    I cant only remove the text, the background will also delete, i just want a black background at the bottom how to fix.

  • @绿叶-t7c
    @绿叶-t7c 4 года назад

    Thank you for instructing and sharing!

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

    I got this to work, great video thank you

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

    how did you put the color of your tag in blue? My atom is red.

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

    Got a problem, the "overflow-x: hidden;" property does hide the X-scrollbar, but it can still be scrolled using the mousewheel. anybody else with the same issue?

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

      Cause there is an empty space to the right and have no idea what generates it

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

      @@maximilianotorres1225 * { box-sizing: border-box }

  • @teamLeaderOP
    @teamLeaderOP 5 лет назад +67

    Instead of explaining the code, you just played random jungle music....

    • @igorlebich5802
      @igorlebich5802 4 года назад +7

      figure it our yourself, it's not that difficult and you will learn a thing or two about css

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

      ruclips.net/video/jp7USotAq2U/видео.html

    • @АйбарЖоламанов
      @АйбарЖоламанов 4 года назад

      It is not algos, that are needed to be explained

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

      Its very inspiring to do coding while listening to music

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

    Hi thanks for the tutorial; is there a way to change the background image using Liquid? Trying to apply this using a Jekyll layout

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

    Your css level is so good :o

  • @aldotugasumb2366
    @aldotugasumb2366 6 лет назад +16

    Thank for sharing this kind of thing,hope god blesses you .

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

    How to add paragraph lines in bottom, as you showed at 1st

  • @aditya-8136
    @aditya-8136 6 лет назад +1

    i made this perfectly, but the issue started when i wanted to put a div with isometric cards below this, in the same file. the isometric cards just get out of shape. how do i make them both work on the same page?

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

    *background-image: url('BG.jpg');*
    and
    font-weight: normal;
    is pretty pointless if you're not having a related font-weight :P

  • @Simone-ft2cg
    @Simone-ft2cg 6 лет назад +2

    Great job! Does it work in mobile version?

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

    It would be great if u explain along with >

  • @ishaanpandey
    @ishaanpandey 3 года назад +1

    Tip: You should do a nice voiceover instead of the music.

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

    hello, how can you put a hyperlink in there ? i tried combining them but doesnt work?

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

    Hi Codegrid im loving your vids!! keep it up!! but I have 1 question what you use for coding? Sublime?

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

      No, it is my favourite programme for coding : Visual Studio Code ))))

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

    What effect did you use for the video intro?

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

    Is this method compatible on mobile? I’ve been using a hack method of position:fixed inside an absolute container on my website but this seems way better.

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

    what does the header, header:before attribute-address address/ which function has the header:before (shouldn't it also be"header::before"?)?

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

    I've been having an issue where any text below the header is still drifting upwards during scrolling, so there's clearly some code-tweaking I need to work on before I continue with the website.

  • @Simone-ft2cg
    @Simone-ft2cg 5 лет назад

    Great job! What is that text editor theme?

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

    This is Beautiful! Thank you!

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

    Cool video🤩
    Can you please tell me what's your picture resolution is it 1920 X 1080

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

    bro please what font you are using in vscode ??????????/

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

    How to add some text after this effect because the text scroll with the header so i can't add other text in the bottom of the header

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

    friggin sick intro!!

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

    can you give the background image
    link ...??

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

    I put a section with a div underneath and styled it with z-index:2 . Why does it go under the image when I scroll ?

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

    I cant add the image in background-image the pictures is not appearing, im using this in React.js Can you help me pleaseeeeeeeeeeee???????

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

    for some reason it just scrolls... as it didnt work i even typed your code letter by letter but even after that it still didnt work correctly..?

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

    What editor did you use? What theme?

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

    How can you add a sticky nav to this? I have already built the complete page and want to animate it with this....

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

    Hi! Can this parallax effect be done for a video?

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

    I loved the introduction! can you teach how you did this glitch/computer/code effect?

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

    Hey really stuck on this, like is there any way to add an image after the paragraph?

  • @mukkecitizen
    @mukkecitizen 4 года назад +1

    Came for the code driven by music

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

    mate you are the best!

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

    Hi thanks for that great tutorial! Is anyone else having the problem where when they scroll a white square appears in the background image? Thanks

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

    I'm trying to make a full website out of this and I'm struggling to get the other stuff at the bottom to not match the parallax effect, I do not recommend using this tutorial to make a full website

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

      use position: absolute. this design is all about the positioning of the different elements

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

    This doesn't seem to work in Safari. Am I making a mistake or is it just not supported?

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

    anyone know how I would continue the parallax with another picture, for reference look at the end of the video where he shows what he made 5:00 in the white area I am trying to continue the scroll with another picture, and so on, any help?

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

    Does anyone have same problem as me? I get white space left of an header image. I found that perspective in css is doing that but don't know how to fix it. It shows when I scroll left/right.

  • @Luludu-my5nj
    @Luludu-my5nj 4 года назад

    What's the app you're using to code ?

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

    I really hope you reply. I can't make a fixed nav bar on top. Nothing can be fixed because of the perspective thing covering the whole body... what should I do?

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

      im having the same issue, everything i had rolls as the tittle effect

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

    How to make sliding dark main content 0:20 my it's not working

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

    Hello. Which coding editor?

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

    Hey, My page is not scrolling down with the same code. Please if someone can help that would be great.Thank you so much.

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

    Can somebody help me? The parallax works but I don't know how to insert the lorem ipsum part.

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

      Add another division after the use width:100% give it a background-color: and write all that you need in a paragraph

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

    Very handy for my parallax site. :)

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

    Do you download music from the soundcloud mobile app?

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

    not sure but when i run my page is just plain white no text

  • @thidaswinathsara6164
    @thidaswinathsara6164 6 лет назад +61

    please be kind to give the code in description.

    • @Faery69
      @Faery69 6 лет назад +67

      Lol 0 effort, immediate results?

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

      No NO beacause i need to try many... I am learning from template's codes so it's boring to see the all vodeo

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

      Yeh there is a true too but, so he can give them for $$$ to buy the code...

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

      Then learn from a book

    • @KojoGotMojo
      @KojoGotMojo 6 лет назад +7

      So put in the effort and try it... You've put in more effort displaying how lazy you are and rather than actually typing for 5mins hahaha

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

    What software do you use also can I make a similar like that use adobe brackets? Thanks

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

      Codegrid use an Atom Code Editor

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

    copied as it is but not working, anything which is not shown in the video which is required, may be skipped because it is too common but I am new to web development

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

    perspective: 1px
    and transform-style: inherit giving me warnings*. there is a solution?
    im using javabeans latest version**

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

      use vscode or atom for web development.. javabean is not for web development!!

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

    do you know how to put a fixed header/nav bar at the top of this? am struggling.
    great video though, thanks!

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

    Can you give the code on how you put the descriptions at the bottom.

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

    Its long way you only type background attachment : fixed; and it will parallax effect

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

      Try it and see closely what happens, you won't get same result as it is in the video.

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

    plz tell me what program do you use

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

    Any tips on how to add another section of content below that would scroll OVER the parallax landing page? I️’m trying to create a continuous scroll style page with parallax images separated by banners with text and video. The problem I️m having is the content flows behind the landing image. I️ thought Z-index would work but it doesn’t seem to do the trick.

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

      Z-index only works if the element is positioned, so you'll have to also add the property position: relative

  • @yah9011
    @yah9011 5 лет назад +3

    Not working in Firefox, Edge and IE

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

    what vs code theme are you using?? plss answer