Jump to content

How to locally test Html and CSS?

Guest
Go to solution Solved by Hazy125,

Save your file as whatever.html then open the file in your web browser. Just double click it and it'll probably open automatically 

 

After I finished my course at CodeCademy (they pissed me off afterward; telling me the one that I just did is replaced with a new one), I wondered what I should do now. I don't have a server for a website, so how do I locally test Html and CSS code. Notepad++ has a "run" function, but I can't run 2 different files. Can someone please help me?

Link to comment
Share on other sites

Link to post
Share on other sites

Save your file as whatever.html then open the file in your web browser. Just double click it and it'll probably open automatically 

 

I am good at computer

Spoiler

Motherboard: Gigabyte G1 sniper 3 | CPU: Intel 3770k @5.1Ghz | RAM: 32Gb G.Skill Ripjaws X @1600Mhz | Graphics card: EVGA 980 Ti SC | HDD: Seagate barracuda 3298534883327.74B + Samsung OEM 5400rpm drive + Seatgate barracude 2TB | PSU: Cougar CMX 1200w | CPU cooler: Custom loop

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Hazy125 said:

Save your file as whatever.html then open the file in your web browser. Just double click it and it'll probably open automatically 

 

So do I just link the CSS file to run with the .html file?

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Factory OC said:

So do I just link the CSS file to run with the .html file?

Yep. As long as the path to your css file is correct in your html, it will load your css file as well

I am good at computer

Spoiler

Motherboard: Gigabyte G1 sniper 3 | CPU: Intel 3770k @5.1Ghz | RAM: 32Gb G.Skill Ripjaws X @1600Mhz | Graphics card: EVGA 980 Ti SC | HDD: Seagate barracuda 3298534883327.74B + Samsung OEM 5400rpm drive + Seatgate barracude 2TB | PSU: Cougar CMX 1200w | CPU cooler: Custom loop

Link to comment
Share on other sites

Link to post
Share on other sites

Dont be pissed off when they replaced the assignment with an other one. Only better to make that one too.

Repeating sometimes helps to learn

Quote or mention me if not feel ignored 

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Hazy125 said:

Yep. As long as the path to your css file is correct in your html, it will load your css file as well

Thank you so much for the fast reply. Hope you enjoy your day or night further.

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Cruorzy said:

Dont be pissed off when they replaced the assignment with an other one. Only better to make that one too.

Repeating sometimes helps to learn

I have to say, the new version looks better implemented. I may take certain pieces of the course (just not <p></p>, please no <p></p>). Thanks for the motivation. 

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, Factory OC said:

So do I just link the CSS file to run with the .html file?

 

2 hours ago, Hazy125 said:

Yep. As long as the path to your css file is correct in your html, it will load your css file as well

 remember that you want relative links so if the css is in a folder called style then link to style/style.css and not c:/users/user/documents/style/style.css

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

Next step for local development would be to setup a Webserver, you do not need it for now but maybe for later when you implement some server side language for example.

 

Wamp - Is a bundle of software that is easy to setup and understand, once setup you can go to http://localhost and see your website locally served by a webserver called Apache.

Quote or mention me if not feel ignored 

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, vorticalbox said:

 

 remember that you want relative links so if the css is in a folder called style then link to style/style.css and not c:/users/user/documents/style/style.css

Are you a mind reader? I was just going to ask that question. Thank you.

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, Cruorzy said:

Next step for local development would be to setup a Webserver, you do not need it for now but maybe for later when you implement some server side language for example.

 

Wamp - Is a bundle of software that is easy to setup and understand, once setup you can go to http://localhost and see your website locally served by a webserver called Apache.

Thank you. I wanted to ask what this localhost thing on CodeCademy is. 

Link to comment
Share on other sites

Link to post
Share on other sites

27 minutes ago, Factory OC said:

Are you a mind reader? I was just going to ask that question. Thank you.

It's a problem some people have when first starting out, seemed fitting to post it just in case :P

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

50 minutes ago, Factory OC said:

Thank you. I wanted to ask what this localhost thing on CodeCademy is.

Well your webserver will run on your own pc and your pc has a Loopback address.

The IPv4 Loopback address is 127.0.0.1 and localhost is the alias to that address given in your host file as default (C:\Windows\System32\drivers\etc\hosts)

 

In simple words when you type Localhost your PC will find on the first level op DNS that localhost has an ip address of 127.0.0.1

Then does a request to your own Network card (since it is a loopback address) It is a HTTP request which is most of the time Port 80 and as default Apache runs on port 80.

 

So it forwards it to Apache, that handles the request and just send the expected data to you.

Quote or mention me if not feel ignored 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×