How can i preview my html and ccs? | Codecademy (2024)

Skip to ContentMini Arrow Down Icon

This forum is now read-only. Please use our new forums! Go to forums

points

How can i preview my html and ccs? | Codecademy (1)

Submitted by

Mike

almost 12 years

I understand the concept of saving a text file as html but how can i view my html rendered with the css?What do i save the ccs file as? How do i link that to my html? and How do i view both in a browser?

Answer 4faf9415d66f8f000300a908

votes

Permalink

In your html write: <link rel="stylesheet" href="style.css" /> and keep the style.css and the html file in the same folder.

Just open the html file with any browser (double-click). Some text-editors also allow the option of running the code in a browser.

And to save a file as a css file you save it with the extension .css .

Answer 4faff0c4e34b3000030113e4

votes

Permalink

Hi, thanks for the help but i have now tried this and it still doesn’t work. I dont get any ccs, my images are not shown and its full of dashes ///.I even tried including (type=”text/css”) as they used in the lesson.I think the problem is as i open the html file in a browser, the ccs is just left behind in the folder. Im not even sure anything looks for it! It seems a odd system to get one file type to run with completely different file type!I know the code is good because its all copied from my final lesson. Any other ideas?

Mike

points

How can i preview my html and ccs? | Codecademy (3)

Submitted by

Mike

almost 12 years

Answer 4faffc7d9665500003012b76

votes

Permalink

Show me your relevant html code and some code from your .css file (are you sure it’s named something.css and the computer recognizes it as a “cascading style sheet document”?).

And it’s not “ccs”, it’s “css” which stands for cascading style sheets.

This process I described works for me, and it is very logical it should for you. I’m partly guessing here but: When you link to style.css you are telling the browser reading the html to look in the folder the html is stored, in contrast you could link to perhaps another folder (but I’m not sure the browser can read other folders than subfolders, e.g.

<link rel="stylesheet" href="public\site2\styleForSite2.css" />

). This example would tell the browser to look for the css file styleForSite2.css in the folder site2 (which is a subfolder of the folder public).

Another thing I could suggest is try linking to a stylesheet online to try to isolate the problem better (it was done in some exercise, don’t remember which).

points

How can i preview my html and ccs? | Codecademy (4)

Submitted by

Matti

almost 12 years

Answer 4fb014aacbb69c00030027cd

I will admit at first i mistakenly typed .ccs but soon realised my mistake and saw the file change into a .css. Thanks for the tips, I will keep trying.

points

How can i preview my html and ccs? | Codecademy (5)

Submitted by

Mike

almost 12 years

Answer 4fb01f1172d6850003015ea1

votes

Permalink

Your welcome, and good luck!

points

How can i preview my html and ccs? | Codecademy (6)

Submitted by

Matti

almost 12 years

Answer 4fb021f96154580003015ce5

votes

Permalink

Update: I just downloaded tumult hyperedit and tested my code in there and it all looks fine!So the problem must be where it comes to the browser interpreting my code! Maybe its because im using safari and it needs a different link code?I’ll try internet explorer tomorrow.

points

How can i preview my html and ccs? | Codecademy (7)

Submitted by

Mike

almost 12 years

Answer 4fba609e511af30003027b92

votes

Permalink

@mikedeuk Try out www.tinkerbin.com. It’s a site which lets you play with HTML, CSS, and even Javascript all in the same window, and it auto-updates to render your changes in real-time. It’s really easy to use and very convenient when the Codecademy windows are buggy.

points

How can i preview my html and ccs? | Codecademy (8)

Submitted by

Zach Coleman

almost 12 years

How can i preview my html and ccs? | Codecademy (2024)
Top Articles
Latest Posts
Article information

Author: Carlyn Walter

Last Updated:

Views: 6121

Rating: 5 / 5 (50 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Carlyn Walter

Birthday: 1996-01-03

Address: Suite 452 40815 Denyse Extensions, Sengermouth, OR 42374

Phone: +8501809515404

Job: Manufacturing Technician

Hobby: Table tennis, Archery, Vacation, Metal detecting, Yo-yoing, Crocheting, Creative writing

Introduction: My name is Carlyn Walter, I am a lively, glamorous, healthy, clean, powerful, calm, combative person who loves writing and wants to share my knowledge and understanding with you.