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


#1

Hi
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.

eg.

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


Replace this line with your code.


#2

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


#3

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.


#4

even with speech marks (quotation marks) it should work


#5

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.


#6

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


#7

HTML File

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

Resulting script on webpage

Go to ”Powerquip.co.uk” today


#8

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.


#9

Hi,

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:


#10

that is good to know :slight_smile:


#11

Thanks. That is exactly what I needed to know.


#12

Thanks for your help


#13