Тёмный

Create a Modal With HTML, CSS & JavaScript 

Traversy Media
Подписаться 2,3 млн
Просмотров 282 тыс.
50% 1

In this video we will be creating a modal from scratch using HTML, CSS and JavaScript. You see these a lot with frameworks like Bootstrap but here we will create our own custom modal.
CODE: Code for this video
codepen.io/bradtraversy/pen/z...
BECOME A PATRON: Show support & get perks!
/ traversymedia
ONE TIME DONATIONS:
www.paypal.me/traversymedia
FOLLOW TRAVERSY MEDIA:
www.traversymedia.com
/ traversymedia
/ traversymedia
/ traversymedia
COURSES & MORE INFO:
www.traversymedia.com
NEW DISCORD CHAT SERVER:
/ discord

Наука

Опубликовано:

 

3 сен 2017

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 383   
@tylerbenton8921
@tylerbenton8921 6 лет назад
I'm watching your crash course videos and I've learned more from those videos than I've learned from my paid Udemy course. I appreciate you.
@jesusgonzalez7059
@jesusgonzalez7059 4 года назад
You are truly a great teacher. You're methodical and a calm when it comes to developing; allowing us to actually learn with you. Even when things don't go the way you think, we still learn from those moments because that would be something that we may do, as well. Thank you, sir. Looking forward to more videos!
@madleed4727
@madleed4727 6 лет назад
Damn Mr. Brad! It's freaking simple! I mean it can't be simpler, but your ability to organize everything and use it correctly makes your videos the best. Thank you!
@DavisNorde
@DavisNorde 6 лет назад
This is sweet, Brad! Thank you for your time and effort creating these videos. One feature I would add to this modal - option to close it with esc key. Maybe something like this: window.addEventListener('keyup', escapeClose); function escapeClose(e) { if (e.keyCode === 27) { modal.style.display = 'none'; } }
@aichampionofficial
@aichampionofficial Год назад
Like this ... I added it to my main.js ... thanks Davis.
@VideoServicesLI
@VideoServicesLI 6 лет назад
And the hits keep coming ! WOW. Another great tutorial. Thanks Brad. Looking forward to the Javascript video.
@ButterflyCreativity
@ButterflyCreativity 6 лет назад
Thank you. This tutorial simplified the modal feature. Prior, I was under the impression that it was a complicated process but now I know it's just a bunch of divs that are being displayed, hidden and styled.
@kirstenforester9855
@kirstenforester9855 4 года назад
You're amazing! Wonderfully clear walk-through and instruction -- you've helped me make sense of a lot of these concepts. Absolutely great find. Fully appreciative!
@jason-codes3037
@jason-codes3037 2 года назад
Going to put this right here.... didn't read the other comments... BUT, I love 19:10 "WTH" response.... I never doubted you'd figured out what was the problem. Rather, that very response EVERY programer / coder has when the thing doesn't do the thing that the thing was suppose to do is priceless! Thanks Brad! Even after five years, your work is absolutely making our profession more, exponentially. Thank you!
@BryanChance
@BryanChance 2 года назад
This channel is the only source you need to learn web development. The way the material is explained and presented is very easy to follow.
@patryk4evah
@patryk4evah 6 лет назад
You are literally the best Web youtuber ever, every time you post a new video i Like it first then watch... :D, i bought your udemy courses too. Thank you very much for your content, never stop what you are doing! Greetings from Sweden
@TraversyMedia
@TraversyMedia 6 лет назад
Thank you, that means a lot :)
@patryk4evah
@patryk4evah 6 лет назад
I hope to see some wordpress courses (like build a theme from scratch) on udemy soon, would be more then glad to buy them :)!!
@siro8472
@siro8472 6 лет назад
the wordpress courses with building a theme from scratch would also be interesting to me
@kenthefley2226
@kenthefley2226 6 лет назад
Dude, what a great tutorial. Thank you so much for taking the time to put this stuff out there. This is quality content. You have a way of explaining web development that makes it easy to understand. That's very refreshing after watching some of the other poorly constructed tutorials on youtube. I built this for a site I am working on.
@thecashewtrader3328
@thecashewtrader3328 2 года назад
Yes OwO
@jakeo1209
@jakeo1209 3 года назад
You are the best, man. It's not just that you explain how to make a modal. It's the way you explain it. Thank you.
@sudeepjoshi9987
@sudeepjoshi9987 4 года назад
I have seen so many tutorials on RU-vid but Travesty is one of the best... That is because the content and style of teaching is so unique, pace of learning is also perfect and overall you make it look so simple...... Thank you so much from India
@yusuphh.kajabukama4029
@yusuphh.kajabukama4029 6 лет назад
Traversy, thank you very much for the content that you continue to share with us, I appreciate a lot and greetings from Tanzania!
@manafount2600
@manafount2600 6 лет назад
You're amazing, dude. It seems like every day there's a new (and usually very relevant) tutorial to watch. Keep it up!
@josephallen5816
@josephallen5816 6 лет назад
I've visited a lot of tutorials just to find out how to do what you just did and none of them were worthy just time wasting. Oh man!!! you're a life saver. *****Keep up the good work*****
@CliffStamp
@CliffStamp 6 лет назад
Clearly explained concept and application, excellent presentation.
@cheriecheung6980
@cheriecheung6980 5 лет назад
i like it a lot brad! it's so much cleaner than most of the no-framework modals that i saw on codepen.. :) thanks
@drivgest
@drivgest 6 лет назад
i love the way you teach the codes. its very organized making it very easy to understand the logic of your codes. keep it up. we are watching...
@princeadigwe3764
@princeadigwe3764 8 месяцев назад
6 years later and this is still very relevant and helpful... Thank you
@TinyMaths
@TinyMaths 2 года назад
Thank you; that was really useful. Just made my first card game with JavaScript and was looking for a kind of pop up box (didn't know they were called modals) to explain the particular rules of the game. Took a while to understand everything but really glad I can add this to the game now;
@aichampionofficial
@aichampionofficial Год назад
I have created a few modals in the past - in the 'dark' by copying code from W3 and other places - this is very useful because now I understand how it works. GREAT STUFF BRAD!
@greenie62
@greenie62 5 лет назад
Thank you so much for having that mistake in targeting an Id instead of Class...As someone still fairly new, there is nothing worse then when the FEW areas I feel I do understand, suddenly dont function. Always because of an error like that but, watching you mumble to yourself left this viewer quite amused/reassured. Love all the videos!
@CalBart42
@CalBart42 6 лет назад
Love your vids Brad ... Clear, precise and fun ... Cheers to you and yours
@tonymatlock88
@tonymatlock88 6 лет назад
Awesome tutorial. Great job explaining things that we might not know. Love it
@DJABranton
@DJABranton 3 года назад
Thank you! I liked the pace and I enjoyed watching you trouble shoot a couple of small items. It did seem like you coded this as you went and it is important to see how to see how to find and squash bugs. Some you tubers never show their mistakes and their videos are 100% scripted.
@petecapecod
@petecapecod 6 лет назад
Great job with the video. It helped to reinforce some styling techniques in CSS and the end result looks really professional
@idiegoceccon4526
@idiegoceccon4526 6 лет назад
Com o pouco que entendo de inglês e observando o código, achei um aprendizado incrível. Good Work man
@ambikakanakkur5902
@ambikakanakkur5902 3 года назад
My gratitude to you for all you courses on RU-vid and Udemy. Truly, it helped me a lot.
@marklogan8393
@marklogan8393 5 лет назад
Great video as usual. A good mix of HTML, CSS and JS. Nice one Brad!
@abdulaziznazarov9961
@abdulaziznazarov9961 2 года назад
Traversy media is the most channel that learning IT . I watch your lessons on you tube from Uzbekistan
@codysheridan324
@codysheridan324 6 лет назад
Wish I found this video hours ago! You made this concept so simple, thank you!
@channel111100
@channel111100 6 лет назад
Thanks, I had already created a modal, but wasn't sure how to move it as it was staying at the top of the screen. This tutorial really helped with that :)
@user-kq1vn5vi1k
@user-kq1vn5vi1k 4 месяца назад
Your tutorial was very clear and easy to understand with lots of good explanations. Thank you!
@programminggod4716
@programminggod4716 6 лет назад
Brad Traversy the real developer over there... God Bless You Sir...
@AlisherMakhmudov
@AlisherMakhmudov 6 лет назад
nice tutorial Brad, as always, thanks a lot., the only thing i would recommend is to use tag for closeBtn, instead of tag...
@RameenFallschirmjager
@RameenFallschirmjager 4 года назад
Much more elaborate than the tutorial in your Bootstrap udemy course. It's amazing that a free content is better than paid one!
@kotikobillionaire281
@kotikobillionaire281 6 лет назад
Thanks Brad. Super easy I REALLY ENJOYED IT! Thanks
@cryptaveli
@cryptaveli Год назад
Great stuff man, very informative. I was trying to create a modal that included a Fareharbor script for a ticketing system and it worked perfectly. The only thing I wish I could have done would be to have been able to use the button class as a modal itself so I didnt have to change multiple pages of code.
@sumantkanala
@sumantkanala 6 лет назад
As always a simple but useful video. That's why I support you!
@step938
@step938 5 лет назад
I'm 19 and a novice programmer. Your videos ROCK! best one out there
@vladimirsimic5160
@vladimirsimic5160 5 лет назад
Hello Brad! You are one of the best youtube teachers! Only a few people here, on youtube, have that level of proficiency like you! You have a lot of videos which I didn't watch yet, but hopefully I will! People can learn a lot from you! My suggestion is that you could put more JavaScript cardio videos! I have a question about this video here... Why did you use both hover and focus on closeBtn class? Wasn't enough to use only hover here?
@candycraft65
@candycraft65 6 лет назад
thank traversy your courses are awesome and clear its make learning so much easier thanks alot
@remixowlz
@remixowlz 6 лет назад
thank you my friend!! helped me with my project work!
@paulwisdom5383
@paulwisdom5383 6 лет назад
I recently started freeCodeCamp to get into web design and while I feel like they give you a good structure and at least give you projects to assign yourself too, people like you teach me more useful information like this that makes me go "Oh I can add that to my project!" Right now I've got to design a portfolio and I've saved a few of your videos to guide me. I think I might use this modal as a cool contact form (as the project requires that all content be accessible on one page). So I think a fixed Navbar at the top of the screen with a menu item to call a Modal with a contact form in would be a cool way to use this. Soon as I've got some spare income going I'll be supporting on Patreon :)
@demiansims728
@demiansims728 5 лет назад
Some of the clearest explanations out there.
@JochemCraen
@JochemCraen 4 года назад
first person on youtube who is really convincing me that its a deal to get those 21h courses on udemy! You helped me very hard with your crash courses!
@smirkingking9018
@smirkingking9018 6 лет назад
Thank you so much for this video, definitely gave me allot of new ideas and perspectives. :)
@mattstivender7000
@mattstivender7000 2 года назад
I know this is an old video but thank you very much. Very simple to follow and build.
@cassimmushi7795
@cassimmushi7795 6 лет назад
Every video u upload is so nice, thanks to u Brad u make me learn a lot in very easiest way
@nickbrown6754
@nickbrown6754 3 года назад
Great video, super easy to follow and understand thank you so much!!
@themarksmith
@themarksmith 6 лет назад
I wish I had the money to give you as your content is excellent - maybe if I keep watching Ill learn enough for that to change and I can hit up your patreon page! Thanks for you work man!
@wirandhikablogs
@wirandhikablogs 6 лет назад
thank you alot for your time and contribution to teach the community Brad, you are awesome! anyway, since recently you make alot vanilla javascript screencast, would you please teach css in js ?
@EZenglishlesson
@EZenglishlesson 6 лет назад
Simple & helpful. Thank you very much!
@drummerdev5522
@drummerdev5522 6 лет назад
Here's a nifty tip to go along with it, if your close button doesn't seem to be lining up with your modal-header text. In the CSS adjust the line height of the close button to match the modal-header's content height. You can find the content height by inspecting the element in chrome developer tools. This is the height minus padding, margins and borders. It Looks like line-height: 40px; did the trick. But if you have variations from the tutorial you'll have to use inspect element to match the x line-height to the modal-header content-height to compensate for any size/font changes you may have made. :D
@sel1015
@sel1015 8 месяцев назад
6 year old tutorial and still very helpful today, thank you!
@maurixcr
@maurixcr 4 года назад
Man you are awesome, thanks for teach me how to create a modal using javascript, this is a good tutorial i give "like".
@JamesQQuick
@JamesQQuick 6 лет назад
Awesome stuff!
@krishnakantsharma1800
@krishnakantsharma1800 6 лет назад
Your videos are very helpful for me to understand HTML CSS and JAVASCRIPT.. keep it up and upload more video..:)
@SogMosee
@SogMosee 6 лет назад
You are a beacon of light Brad!
@rajnishpsinha4683
@rajnishpsinha4683 Год назад
What a clear explanation. Great!
@mohamedmahmoud5503
@mohamedmahmoud5503 6 лет назад
you are a genius keep it up boss
@mual77
@mual77 6 лет назад
Excellent explanation!! Thank you very much
@abigailfolarin5876
@abigailfolarin5876 3 года назад
Really helpful content. Thank you Brad!
@ArunSuryaTejaMannam
@ArunSuryaTejaMannam 6 лет назад
how to open multiple modal boxes in same page if there are more number of buttons?
@hellnavv
@hellnavv 6 лет назад
i also need to know how to do this haha have you figured out yet?
@ArunSuryaTejaMannam
@ArunSuryaTejaMannam 6 лет назад
Maria de Campos No, not yet, i gave up
@hellnavv
@hellnavv 6 лет назад
I actually figured it out!! here's the link that helped me solve it :) (it's the third and last answer, by Denis Mysenko) stackoverflow.com/questions/40645032/creating-multiple-modals-on-a-single-page
@isakawilliam
@isakawilliam 2 года назад
simply create objects on an array, walk around that path.
@dylpckl
@dylpckl 6 лет назад
Insanely helpful, thank you.
@pierpaolowurzburger7193
@pierpaolowurzburger7193 5 лет назад
you are the best bro!!! I'm italian and your english is very fine!
@RockstahRolln
@RockstahRolln 6 лет назад
Freakin LOVED this Vid!!
@ronaldjohnson4470
@ronaldjohnson4470 6 лет назад
Another useful application. Thank you again Brad.
@germanhabreu
@germanhabreu 6 лет назад
Great vid Brad. really enjoyed it
@mikleta
@mikleta 5 лет назад
Hey Brad, thanks for all your videos, they're really helpful. I have a quick question, how do I implement this if I want to use modals in a portfolio gallery? I should get the element by class rather than id, right? because if I give the same id to all the elements it just works on the first picture of the portfolio.
@rohit87
@rohit87 6 лет назад
Awesome as always .. :) Please make a video on multiple files/images with preview upload in pure JavaScript without using 3rd party library
@AbhishekKumar-mq1tt
@AbhishekKumar-mq1tt 6 лет назад
Hi Brad ,I watch you video everyday and learn new things every day through you videos.I am beginner and fully focus on web development ,so I learn web design through you videos.Now I focus on client side programming and server side programming with database. So i request to you make project a fully functional website with client side programming ,server side programming with database.
@StevenMcGregor
@StevenMcGregor 6 лет назад
Nice one. Thanks Brad
@dadev3668
@dadev3668 6 лет назад
Used this tutorial to build a modal using tailwind css thanks !
@ryanbarrera2595
@ryanbarrera2595 6 лет назад
Excellent discussion, very nice.
@sotech7424
@sotech7424 4 года назад
Watching that kind of videos is such a big deal. Tip: when Brad makes an Error (probably intentionally) it's better to pause and try to solve it yourself before him. I think this can help you learn way more better than waiting for solution. Good luck.
@danutzz8
@danutzz8 3 года назад
As usual Awesome content! cheers!
@clarkson451
@clarkson451 6 лет назад
Nice tut Brad. im tight on cash rite now but im looking forward to the udemy courses you offer.. Thanks again bud and keep em coming.
@scottwisniewski7372
@scottwisniewski7372 6 лет назад
Brad, these videos are a life saver. I also follow your vids on Udemy...
@kostadinnedev8259
@kostadinnedev8259 Год назад
Best web develop channel in RU-vid. Greeting from edTech startup YouthInventor ;)
@mohamadaminabdolahzade1205
@mohamadaminabdolahzade1205 4 года назад
best tutorial to start creating modals
@slapmyfunkybass
@slapmyfunkybass 6 лет назад
Thanks buddy, very helpful.
@mohammedtaqi4943
@mohammedtaqi4943 2 года назад
Please make more videos of this kind... It is very helpfull :)
@surinfarmwest6645
@surinfarmwest6645 6 лет назад
Brad, love watching your videos and learning these magical tricks. It's the only thing that keeps me sane out here in very rural NE Thailand. Javascript is easier to learn the Thai/Laos/Khmer 8-) As with Denis Soll, how do you make it fade out please? Farm West
@valbersoares5305
@valbersoares5305 6 лет назад
Very good ! subscribed !
@xurify
@xurify 4 года назад
Thanks for this tutorial!
@raj-cp5nu
@raj-cp5nu 6 лет назад
people like you are the reason i never give up, best teacher ever! :)
@TraversyMedia
@TraversyMedia 6 лет назад
Awesome :)
@EduardKaresli
@EduardKaresli 6 лет назад
Very nice! Thanks a lot!
@adrianoldchannel2494
@adrianoldchannel2494 6 лет назад
Awesome. JavaScript is finally making friends with me now. Lol. Thanks Brad.
@quicksketch1617
@quicksketch1617 6 лет назад
Thank you for this tutorial, se need more vanilla JavaScript. Frameworks help, but first we have to learn JavaScript.
@SameerAbbasMughal
@SameerAbbasMughal Год назад
one of the best tutorial. You are awesome ❤❤❤
@omermindivanli2981
@omermindivanli2981 6 лет назад
We enjoyed you do not worry about it :)
@hirephpdevelopers3840
@hirephpdevelopers3840 6 лет назад
You are amazing. Thank you for the video.
@bassamazizi7505
@bassamazizi7505 5 лет назад
Thank you so much, This is a great content
@OstonCodeCypher
@OstonCodeCypher 6 лет назад
THANKS FOR THE TUTORIAL
@ob7349
@ob7349 3 года назад
:-) Thank You very much for explaining css and js in such detail. I love this feeling so much, when I understand all this!!! :-) ???? The structure of the modal window is always written at the bottom of the page before the script and ??
@joelpoudiougo7447
@joelpoudiougo7447 6 лет назад
Thanks i learned many things with you
@DreamingSheep
@DreamingSheep 5 лет назад
Very informative vids, thanks!! Question though, if you want multiple buttons opening Modals with different text in them, I assume you can just give them a different ID's but then would you also need to have multiple iterations of the CSS and JS, one for each Modal?
@ubaidfarooqui
@ubaidfarooqui 6 лет назад
Awesome ! as always
Далее
Full Screen Responsive Image Slider | No Libraries
31:55
Awesome Split Screen Slider Using CSS3 & JavaScript
33:56
Responsive HTML & CSS Side Menu From Scratch
23:57
Просмотров 396 тыс.
Create a Split Landing Page With HTML, CSS & JS
34:13
Просмотров 136 тыс.
Star Ratings With JavaScript & Font Awesome
33:59
Просмотров 104 тыс.
Drag & Drop With Vanilla JS
19:00
Просмотров 251 тыс.
Create a modal with React (Pop-up)
6:39
Просмотров 131 тыс.
Build a Popup With JavaScript
16:55
Просмотров 362 тыс.
The Importance of Specialization in Coding
7:13
Просмотров 185 тыс.
The problems with viewport units
13:23
Просмотров 354 тыс.
Самый СТРАННЫЙ смартфон!
0:57
Просмотров 34 тыс.
Самый СТРАННЫЙ смартфон!
0:57
Просмотров 34 тыс.
Телефон в воде 🤯
0:28
Просмотров 1,2 млн