I'm very new to coding and web development. I'm working with HTML and CSS at the moment. The trouble is, I can't see what I'm coding.
How do you load a HTML and CSS file onto a local host so that you can see what you are doing?
Really appreciate it if you could give your input. :)
-
1just open the html file using your browser.....Prashanth Benny– Prashanth Benny2016年12月22日 10:30:24 +00:00Commented Dec 22, 2016 at 10:30
-
pls provide your code watever u have done.Taniya– Taniya2016年12月22日 10:30:37 +00:00Commented Dec 22, 2016 at 10:30
-
You just need to open you html using some browserHudsonPH– HudsonPH2016年12月22日 10:30:49 +00:00Commented Dec 22, 2016 at 10:30
-
2Possible duplicate of How to open local file in browserroberrrt-s– roberrrt-s2016年12月22日 10:31:23 +00:00Commented Dec 22, 2016 at 10:31
-
Welcome to SO. Please read What topics can I ask about and How to ask a good question And the perfect question And how to create a Minimal, Complete and Verifiable example SO is not a free Coding or Code Conversion or Debugging or Tutorial or Library Finding service Here at SO we fix your attempts, we do not code things for youMingebag– Mingebag2016年12月22日 10:34:13 +00:00Commented Dec 22, 2016 at 10:34
5 Answers 5
I've had this question as well, haha. But you'll learn.
So there are two solutions here; one using a localhost and one just simply viewing the file.
I'm not sure what device you're on, but to view your file, just simply double click it as you would do to open any other file. Then you will be able to see your code and what you're programming.
The second solution is the use of a localhost; it's basically a test environment for your website to view it during development.
To set up a localhost on a Macintosh device, you simply go to the Finder and search for Terminal, later open it and write; python -m SimpleHTTPServer.
If you have a folder for your files as well (which is recommended for future reference), just use cd and type where it is. The easiest method would be placing it on the Desktop, and then write in the Terminal; cd Desktop -> cd the-folder-you-have-your-code-in and then write python -m SimpleHTTPServer.
To access this server, just type localhost in the search bar where you'd search for items on the web.
Hope this helps you, and welcome to the developing society!
For future reference, when you become a full-fledged developer, don't use Homestead/Laravel, it's a pain in the ass when you don't understand it. Use WAMP, MAMP, or XAMPP based on what device you're on.
1 Comment
Just open the html file with your browser. On Windows, in Windows Explorer right click on the file and choose open with, then choose your browser.
2 Comments
suggestions, try this , may be kind of answers that are not encouragedfile:///[complete path to your file] does the trick in Chrome, Firefox and IE, but as @Atrix said, right click + open in [your favourite browser] works too.
You might want to install a full-fledged webserver one day or another though, like Apache or nginx. You also have full stacks servers available (usually coming with a PHP interpreter and a database server), like WAMP (on Windows), or XAMPP (on Windows, Linux and MacOS)
Comments
You can do the following:
On a Window machine at the prompt type start the-HTML-file-name
Comments
Here is an efficient alternative:
Go to W3Schools Tryit Editor. Wait for the page to fully load. Then enter the following line in the browser's console and press Enter:
document.getElementById('textareawrapper').setAttribute("onkeup","submitTryit(1)")
Now start typing your code in the text area. This is far better than working with a text editor as it shows the output directly as you type.