0

In one of the lectures, Professor Malan explains that you can use Text Edit on a Mac to write HTML and CSS. I copied verbatim what he did with his CS50 search example and when I open the file using Chrome or Safari, it won't render correctly. I thought HTML new the tags and that it was universal. Some things I made sure of: 1) I typed it and saved it in plain text 2) I saved it as an HTML file

You can't really tell from the browser picture, but it's not centered, the button "CS50 Search" doesn't work(it's a text box only) and there seems to be weird text in front of CS50 for some reason.

I don't get what I'm doing wrong, or if I can't render an HTML file with precision if opened from a file on my computer. There is a picture of my Text Edit HTML and below that is what appears when I open it.

Thanks for any help!

enter image description here enter image description here

1

The latest version of TextEdit has "smart quotes" turned on by default. Notice your quotes in your screen print? They are "curly quotes" rather than straight quotes. As such, the browser doesn't interpret them correctly when rendering the page.

Open TextEdit > Preferences and down near the bottom, un-tick Smart Quotes (and probably Smart Dashes) as well.

You'll probably have to create a new document as existing ones keep the settings they had when they were created.

2
  • Thank you so much for the help. It is working better. The only thing that didn't show up on my new file when opened in Chrome was the Form section. It doesn't have the search box labeled CS50 Search. Any ideas? My HTML saving options is set to HTML 4.01 Strict. Not sure what that means but I remember Professor Malan said !DOCTYPE means you are using version HTML 5. Is this my problem? There isn't an option for 5.0 on my text edit. – Jzag Aug 19 '15 at 13:14
  • I think I got it. Thanks! – Jzag Aug 21 '15 at 13:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .