I am looking to practice html css using my browser and notepad
Why use notepadd++? When there is Sublime Text and Atom?? Its so much better in my Opinion.
Best of all why not just use the actual codecademy editor?
You can create a file and save it as
index.html, then put your HTML in it and double click it to open in a browser, and you’ll be able to see the result And for CSS, you just save a file as
style.css and link it up the way you were shown it the HTML & CSS Course, and put your CSS in it!
Please feel free to ask any follow up questions you may have
- There is no “best” way
- Being completely dependent on Codecademy for practicing programming stuff isn’t a great thing IMO.
Hello zystvan this is kind of along the same lines. Quick answer how do I embed Js into an html document, like we are able to do with .css. My goal is for a simple video game which can be found on W3C.
script.js file in the same directory as your HTML file, and add this to just before
</body> in your HTML file:
Not best method
Thank you thought that I could embed it like .css. Any chance it might not work in Mozilla? Thank you.
Both of those methods work in all major graphics-based browsers (Firefox, Opera, Vivaldi, Chrome, etc.).
Should I post a new discussion topic. It is refusing to work. Also it is different from the code in Html game making that codecademy has, I thought that may be the issue.
Can you post a screen shot if you can? ALT+PRINTSCREEN makes it only the thing your working on.
Solved it via W3Cs environment. I did a line by line comparison of the code and my JS has an unnecessary curly brace on line six thank you zystvan and amanuel2 for your interest in my predicament.
@mrjlopez True, that extra closing curly brace (
} was part of the problem, but you need to remove
<script> tags, as a general rule, go in the
<head> or just before
</body>, and there’s no need for that empty
<script> from line 16 to 19. You should also work on your indentation, it’s pretty bad (a.k.a., nonexistent).
Sorry to go through your code & point out all of the problems in it like that, but I don’t see how that code is working the way it is right now
Thanks for the Advice everyone. Now I got another question how do I get an Image in the center of the page on html ?
@codemaster27831 This should help you: https://css-tricks.com/centering-css-complete-guide
The code works fine, once I figure out my latest issue I will post it. but as I stated the Tutorial at W3C schools is where I got it from, little snippets here and there. I highly recommend you take a look. It takes codecademies stellar game how to, to the next level. As for my indentation I take advantage of the fact that html and css (for the most part) are not whitespace sensitive unlike python. However I do comment my code. No one responded after my posting of the code so I proceeded to google tirelessly, and came up with what was posted as nothing that was suggested worked. Also believe it or not the way I have my code helps me to keep track of where I am in the code. It makes sense, it shows me what is enclosed and what is not. I thought it over zystvan I should not say nothing your suggestion to create a seperate file for my JS was spot on but you will note that again as a personal preference I kept my css inline I believe is the term, this also helps me keep track of what is going on in my code.
Not a big fan of W3Schools (W3C & W3Schools aren’t related, BTW), they’ve gotten better but I still don’t really like them much. If you’re interested, I do like the Mozilla Developer Network a lot, it’s really good
If those are your coding styles, may you never have to work on a large project
(no offense meant of course, it’s just that your preferred code styles are generally recognized as a bad practice)