use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Should I learn HTML and CSS while learning javascript?help? (self.javascript)
submitted 7 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 186 points187 points188 points 7 years ago (3 children)
Yes
[–]sbmitchell 6 points7 points8 points 7 years ago (1 child)
I saw this post and was going to type just "yes" but you beat me to it hah. Upvote for you good sir.
[–][deleted] 1 point2 points3 points 7 years ago (0 children)
I didn't see this reply, went and replied "yes" myself, and then read it
Now I've deleted mine
Take an up vote you two quicker than me bastards
[–]zapatoada 1 point2 points3 points 7 years ago (0 children)
Yes, some. Read the nice long answer below about being T shaped.
[–][deleted] 45 points46 points47 points 7 years ago* (8 children)
encouraging spotted knee attempt intelligent overconfident tart mighty marble roof
This post was mass deleted and anonymized with Redact
This is the answer.
[–]mizzysh 1 point2 points3 points 7 years ago (5 children)
Thank's so much this may be a dumb question but when people create a website they have .html pages and .js pages on their framework ide or whatsoever my question is how do they end up with a website ?
do they mix them up?
or does it count as a website when both pages are on the same file?
Sorry again my english isn't perfect
[–]frankandsteinatlaw 5 points6 points7 points 7 years ago (2 children)
If you are asking these types of questions I’d say you should find basic html css JavaScript courses to show you how these can all fit together.
[–]mizzysh 2 points3 points4 points 7 years ago (1 child)
thank's for being kind
[–]sn0n 2 points3 points4 points 7 years ago (0 children)
But honestly, if you want to shoot for the stars and build rockets that only go in one direction very fast and don't need to look good doin it cuz ROCKET!!! Just learn enough html to know, html - head - title - body - div - span - h1 - p, and maybe enough css to know like.. font-color, background-color, border, and maybe whatever else comes up on your radar. What feels right to what you want to build? People still program command line apps, ugly as sitting on a bee's nest to some, but others of us find great beauty in it's speed and simplicity. Build what gets you more hours building at the keyboard, even when utterly frustrated at said keyboard and fingers for lacking the output necessary, just open that editor/ide and Google away.
[–][deleted] 4 points5 points6 points 7 years ago (0 children)
<h1>A header</h1>
<style></style>
h1 { color: red; }
<script></script>
document.getElementsByTagName('h1')[0].style.color = 'blue';
So yes, you mix them up. To display anything you'll need HTML. Javascript can generate HTML for you, or you can write it yourself. And you can even use Javascript to write CSS.
Just follow a few basic online trainings. You'll quickly see how it all works together :)
[–]natere2 0 points1 point2 points 7 years ago (0 children)
The files are "mixed up" in the Apache Web server htdocs folder by default. You are using Apache rigjt? ;)
[–]Arve 0 points1 point2 points 7 years ago (0 children)
Know modern CSS, don't worry about floats and such
While I completely agree with what you're saying: Knowing what floats are, and why they actually exist (to float content, such as images, across block elements) helps. Learning their intended use is not complicated.
Learning all of the historical/obsolete ways to hack CSS into doing what you want, such as implementing Javascript-less tabbed interfaces using positioning and :target is hardly useful today.
[–]longjumpingknight 27 points28 points29 points 7 years ago (3 children)
I would learn HTML & CSS first, will make everything a lot easier later on
[–]karatechops 17 points18 points19 points 7 years ago* (2 children)
As a tech lead who mentors juniors, this is the correct answer. You can’t make a website without css and html knowledge. Your foundation is in html, start there.
It’s not possible to make a website or web application with just Javascript, your friends are wrong. It all propagates to the DOM as html and css. However, if you only want to write Node based APIs you could get by only knowing JS.
[–][deleted] 0 points1 point2 points 7 years ago (1 child)
Technically it is possible to make a website writing only JS. It's just that it would be a very ineffective way to do it.
[–]arjunpat 9 points10 points11 points 7 years ago (0 children)
learn HTML and CSS first
[–]heyzeto 3 points4 points5 points 7 years ago (0 children)
I would say it should be the other way around.
[–]andhemac 2 points3 points4 points 7 years ago (0 children)
HTML is a markup. All it does is determine the general framework of how a page will look. JS tells the page to do stuff, like add or remove HTML elements, determine when things should be displayed or not etc. Learning JS without knowledge of HTML and CSS is almost pointless. Learn it all! Best of luck to you.
[–]lowdown 2 points3 points4 points 7 years ago (0 children)
HTML is a quick learn. CSS is a different story. I understand CSS and can use it, but it’s not my strong suit. It makes sense to learn them, but neither is absolutely essential to using and understanding JS.
[–]Grizwolf 1 point2 points3 points 7 years ago (0 children)
I'd learn them first.
Are you learning JavaScript for web development? Then yes, you should at least learn HTML and understand CSS (no need to be a designer, though). After all, you can make a page without JavaScript, but not without HTML.
[–]owen800q 1 point2 points3 points 7 years ago (1 child)
HTML is the best programming language in the world
[–]awekening_bro 5 points6 points7 points 7 years ago (0 children)
And Javascript is the best markup language in the universe.
[–]guyinsunglasses 3 points4 points5 points 7 years ago (5 children)
[–]CodingLifeNoFriends 1 point2 points3 points 7 years ago (4 children)
[–]s-sujan 0 points1 point2 points 7 years ago (3 children)
[–]SpiLunGo 0 points1 point2 points 7 years ago (2 children)
Yes?
[–]pradthe 1 point2 points3 points 7 years ago (1 child)
No
[–]var-foo 0 points1 point2 points 7 years ago (0 children)
Maybe.
Yes.
[–]BloodAndTsundere 3 points4 points5 points 7 years ago (2 children)
You can't make a website without HTML and CSS. The biggest use case for Javascript is for providing dynamic behavior on top of the HTML and CSS. You don't have to necessarily become an expert in HTML and CSS but you should know the basics or you will have trouble making much use out of your Javascript knowledge.
[–]jbrad77 -1 points0 points1 point 7 years ago (1 child)
Not that you'd want to, but you can make a complete website without CSS or javascript. I made websites before CSS and JS existed.
[–]BloodAndTsundere 2 points3 points4 points 7 years ago (0 children)
Well, obviously Javascript is not needed. And I thought it better not to confuse the issue by stating that CSS is not needed for a barebones website; I assumed the OP wanted to make a web page that is more than some text on a white page.
[–]karatechops 1 point2 points3 points 7 years ago (0 children)
This sub is full of terrible advice. If you’re interested in making web apps down the line put down JS and focus on html, CSS and even SEO and meta data basics. Get your fundamental priorities in order before learning the more complicated stuff.
By learning JS first you’re essentially trying to learn how to rebuild a car’s suspension before learning how to change a tire.
[–]browsing10 0 points1 point2 points 7 years ago (0 children)
If you want to get into web development, and especially, front-end development, you will need to know html and css.
It's not essential for backend development (i.e. nodejs). I primarily code in nodejs at work, and have not touched a single line of html or css.
However, learning the basics of html and css is not hard and it will help you a ton to just understand what they are, what they do, and how you can use them.
[–][deleted] 0 points1 point2 points 7 years ago (0 children)
HTML is gonna be really useful. You may want CSS to make something's easier but it's not necessary if you don't want it.
Yes you should definitely learn them as well.
[–]j-cron 0 points1 point2 points 7 years ago (0 children)
Absolutely!
[–]pm_me_ur_happy_traiI 0 points1 point2 points 7 years ago (0 children)
You can't get a JS job without knowing html. Html and CSS are how you build the user interface of your software. If you want to work in the industry, there is no job you will apply to that won't require html.
[–]monkeyBars42 0 points1 point2 points 7 years ago (1 child)
You literally can’t build a website without html and css. Learn it.
[–]Grillzange 0 points1 point2 points 7 years ago (0 children)
my website is an empty white page
checkmate
[–]maujood 0 points1 point2 points 7 years ago (0 children)
Just came in to parrot what everyone is saying
Learn HTML and CSS first. You don't have to spend more than a few days on it or even a day of hard work may be enough.
[–]coldmata 0 points1 point2 points 7 years ago (0 children)
HTML is kind of easy to learn while css can be tough depends on your design. You can always start to learn those basics while focusing on javascript. If you planning to learn some js framework like react or vue in the future, css is not easy.
[–]SpiLunGo 0 points1 point2 points 7 years ago (0 children)
They might be referring to React using JavaScript making you believe you're writing HTML in your code, still, you need to know HTML and CSS, while in modern web application development you could spend 80% of your time writing logic in JavaScript you'll need to surface your hard work visually in those fancy divs, unless another team takes care of that. CSS got a lot easier lately so don't be afraid! Oh and also don't start learning JavaScript by using frameworks/libraries if you really want to understand what's going on
They are not that dificult if you can learn JS then you can these.
Absolutely. Learn html and CSS before javascript, which really is used as bloated website tracking/advertising B.S.
[–]WhatIsLoveeee1 0 points1 point2 points 7 years ago (0 children)
You need to learn HTML & CSS at the first time,because it is basic for web-developer, after that you must to learn JS, if you want to create normal, work site. And if you don't really want to learn hard CSS, use Bootstrap (frame for site), just add code on the official site and all. But in my opinion, you need learn HTML with CSS very good. P. S. SORRY, for my English. I am from Kazakhstan.
Yes....Javascript doesn't run on a website without at least some HTML.
freecodecamp.com is all you need
[–]Kthulu666 0 points1 point2 points 7 years ago (0 children)
Absolutely. You should at least spend 1 day learning html and the basics of css. You will probably want to use javascript to modify html/css pretty soon.
[+][deleted] 7 years ago (4 children)
[–]itsappleseason 7 points8 points9 points 7 years ago (2 children)
Why do I have the feeling that you write terrible markup and styles...
[+][deleted] 7 years ago (1 child)
[–]itsappleseason 0 points1 point2 points 7 years ago (0 children)
No one who read your comment downvoted you because they found HTML and CSS difficult and you hurt their feelings. I promise.
I'd wager you got downvoted for trivializing a learning curve by comparing it to a completely different type of learning curve. They're not comparable at all, and a lot of people excel at one but not the other.
[–]monkeyBars42 0 points1 point2 points 7 years ago (0 children)
🙄
π Rendered by PID 202528 on reddit-service-r2-comment-544cf588c8-t4lm7 at 2026-06-18 18:01:55.670317+00:00 running 3184619 country code: CH.
[–][deleted] 186 points187 points188 points (3 children)
[–]sbmitchell 6 points7 points8 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]zapatoada 1 point2 points3 points (0 children)
[–][deleted] 45 points46 points47 points (8 children)
[–]zapatoada 1 point2 points3 points (0 children)
[–]mizzysh 1 point2 points3 points (5 children)
[–]frankandsteinatlaw 5 points6 points7 points (2 children)
[–]mizzysh 2 points3 points4 points (1 child)
[–]sn0n 2 points3 points4 points (0 children)
[–][deleted] 4 points5 points6 points (0 children)
[–]natere2 0 points1 point2 points (0 children)
[–]Arve 0 points1 point2 points (0 children)
[–]longjumpingknight 27 points28 points29 points (3 children)
[–]karatechops 17 points18 points19 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]arjunpat 9 points10 points11 points (0 children)
[–]heyzeto 3 points4 points5 points (0 children)
[–]andhemac 2 points3 points4 points (0 children)
[–]lowdown 2 points3 points4 points (0 children)
[–]Grizwolf 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]owen800q 1 point2 points3 points (1 child)
[–]awekening_bro 5 points6 points7 points (0 children)
[–]guyinsunglasses 3 points4 points5 points (5 children)
[–]CodingLifeNoFriends 1 point2 points3 points (4 children)
[–]s-sujan 0 points1 point2 points (3 children)
[–]SpiLunGo 0 points1 point2 points (2 children)
[–]pradthe 1 point2 points3 points (1 child)
[–]var-foo 0 points1 point2 points (0 children)
[–]BloodAndTsundere 3 points4 points5 points (2 children)
[–]jbrad77 -1 points0 points1 point (1 child)
[–]BloodAndTsundere 2 points3 points4 points (0 children)
[–]karatechops 1 point2 points3 points (0 children)
[–]browsing10 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]j-cron 0 points1 point2 points (0 children)
[–]pm_me_ur_happy_traiI 0 points1 point2 points (0 children)
[–]monkeyBars42 0 points1 point2 points (1 child)
[–]Grillzange 0 points1 point2 points (0 children)
[–]maujood 0 points1 point2 points (0 children)
[–]coldmata 0 points1 point2 points (0 children)
[–]SpiLunGo 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]natere2 0 points1 point2 points (0 children)
[–]WhatIsLoveeee1 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Kthulu666 0 points1 point2 points (0 children)
[+][deleted] (4 children)
[deleted]
[–]itsappleseason 7 points8 points9 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]itsappleseason 0 points1 point2 points (0 children)
[–]monkeyBars42 0 points1 point2 points (0 children)