Reputation: 28059
Ok so I am very new to CSS and HTML. Basically I have the below code:
<html>
<head>
<style type="text/css">
p
{
font-family:Calibri, Arial, Helvetica, sans-serif;
}
q
{
color:#698B22;
}
</style>
</head>
<body>
<p>
Foo Bar Foo bar.
<br /><br />
Foo <a href="http://www.stackoverflow.com/">Bar</a> Foo Bar.
<br /><br />
Foo <a href="http://www.stackoverflow.com/">Bar <q>Foo</q> Bar</a> Foo Bar.
<br /><br />
</p>
</body>
</html>
When I view this in my Browser, it looks like so:
What I want to know is, why, on the third line, is there quotes around the word Foo
inside the link (in the most recent versions of Chrome and Firefox, this is not present in IE9)? Also, how do I get shot of the quotes?
Thanks
Upvotes: 0
Views: 228
Reputation: 16177
Since <q>
Tag mean quote, some browsers will automatically add quotation marks around the content.
In this particular case, I suggest you use another tag, like: <em>
instead.
More: http://www.w3.org/wiki/HTML/Elements/q
Upvotes: 0
Reputation: 13853
Browsers have default style sheets, the one you are using probably adds them, you can override it though,
q {
quotes: none;
}
q:before, q:after {
content: "";
content: none;
}
Upvotes: 0
Reputation: 2277
The tags are telling the browser to put quotes around the word Foo
Upvotes: 1
Reputation: 1489
You have added the HTML short quote tag to your link. Remove the q part and the quotes will go away. http://www.w3schools.com/tags/tag_q.asp
If you wanted to do what you're doing in CSS:
Foo <a href="http://www.stackoverflow.com/">Bar <span class="q">Foo</span> Bar</a> Foo Bar.
and change your CSS to:
.q
{
color:#698B22;
}
Note that you can't create new HTML elements in CSS - you can override the deafult settings or create new classes or IDs.
Upvotes: 0
Reputation: 2057
works in IE9 so I would probably guess you are not declaring a doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Upvotes: 1