Speech marks...to use or not to use?


Im completely new to coding and at the age of 45 thought it about time I gave it a go. When following a tutorial for HTML for beginners, one of the step was about adding an image. The element contained speech marks around the file. But when I tried updating the webpage it failed to load. Similarly another step showed how to centre text and change the colour. This also contained lines with speech mark. Both elements failed to work until I removed the speech marks from the elements. Please can you explain why, and if I need to change something in my preferences.


<h1 style="text-align:centre; colour:red">Example</h1>
<img src="image_1435.jpg">

Replace this line with your code.


what are speech marks?

well this will fail:

<h1 style="text-align:centre; colour:red">Example</h1>

the web standards are in american english, so we have center and color

as for your image, that will only work if the html file and image are in the same directory


Thanks. I did get it to work in the end as I said, but by removing the "" from around the instructions. I also worked out I had to use the american english. I was just wondering why it wouldn't work with "" present.


even with speech marks (quotation marks) it should work


I've just tried putting them back in the element and it stops working. If I write them in to a hyperlink element, on my webpage I get funny symbols ( an a with a accent over it and what looks to be like a euro symbol) both sides where the quotation marks are in my element.


can you post this hyperlink on the forum? i want to see it



	<p>Go to
	<a href=http://www.powerquip.co.uk>”Powerquip.co.uk”</a>

Resulting script on webpage

Go to ”Powerquip.co.uk” today


now you have no quotation marks around the url?

the you are using are not the same as quotation marks ", look closely, they are different.

it seems the browser can't handle them.



The reason that you are having problems with your speech marks is that the text editor you are using is inserting what are commonly called, smart quotes.

These are curly/sloped quotes which look great typographically but aren't code-friendly :slight_smile:

You need to be using dumb quotes, the straight ones like this ".

Look in your text editor's preferences to switch off smart quotes :slight_smile:


that is good to know :slight_smile:


Thanks. That is exactly what I needed to know.


Thanks for your help