Welcome to the Treehouse Community
Looking to learn something new?
Switch back to the browser?
This is just a very easy thing that I seem to have missed. Kind of like when you have been talking to someone at a party all night, but you never got their name? Too late to ask!!
When creating code in a text editor such as Sublime 2 (what I am using) how do I do what Nick so often says "Switch back to the browser" How do I preview my code in the browser?
Erik McClintock45,783 Points
To view the code you've been building in-browser, you simply need to open the index.html file in your browser of choice!
You can either:
a) right-click on your index.html file (or whichever file you want to view) and choose to 'Open With...' and then choose a browser
b) from an already opened browser, do Ctrl+O (or Cmd+O on a Mac, I'd expect) to bring up the Open File explorer window, and then navigate to and select the file that you want your browser to open
Then, of course, as you make changes to your files' code and save the changes, you'll want to refresh your browser (Ctrl+F5 to refresh it entirely) to view the changes.
Hope this helps!
Hi Laura, to preview your code in the browser (using Chrome), you can
View Page Source, or with Chrome DevTools by
Cmd + Shift + C (Mac), or
Ctrl + Shift + C (Windows).
If you're asking how to preview the rendered HTML document, simply drag
index.html into a browser tab.
Toggling Between Applications for Faster Workflow
You simply need to open your .html file with your web browser, Chrome, Firefox, Safari, as you want :)
Matt West14,545 Points
Find where you saved the
index.html file on your computer and then double click the file to open it up in your web browser.
Whenever Nick says to switch back to the browser, just make sure you refresh the page in your browser to get the latest changes.
Hope this helps :)
Thank you everyone! Just realized I saved the file as a ".doc" and that was why it wouldn't open in the browser. Doh! I'm in the process of creating my very first ever website from scratch, since my Microsoft FrontPage class! I remember when Office 2000 felt very futuristic. :))
Thank you for the detailed answers.
Hello again! Since you guys were so helpful, maybe you can answer this one too? My images aren't appearing. Just get the blue question marks. I have been over my code and compared it to Nick's. Saved the images as JPEGs in the same directory as the index file, but they aren't appearing. I have alternate text in the markup and that doesn't appear either - just the blue question marks so I know I am doing something wrong.
Hi Dustin, I can't remember my dropbox password. Can I email it to you? Its literally three small files.