Introduction to HTML: What is the difference between <cite> in <a> and <a> in <cite>?

On “Advanced text formatting”, there is a cite element in an a element, while on MDN cite page, there is an a element in a cite element. Is there any difference between them?

1 Like

Hello @user-p

same as you can use a element inside p element you can do the same with cite and a

and notice that cite can be element and also be attribute

cite as element

<p>According to the <a href="/en-US/docs/Web/HTML/Element/blockquote">
<cite>MDN blockquote page</cite></a>:
</p>

and as atterbuite

<blockquote cite="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote">

not sure if that answer your question or not and have a nice day :slight_smile:

2 Likes

Hi @justsomeone, I appreciate your help.

I try to paraphrase this question.

For example, the examples below work clearly differently(I just changed <cite> to <p>). I understand this differenece.

<a href="/en-US/docs/Web/HTML/Element/blockquote"><p>MDN blockquote page</cp></a> 
<p><a href="/en-US/docs/Web/HTML/Element/blockquote">MDN blockquote page</a></p>

However, I don’t understand difference between the examples below .

<a href="/en-US/docs/Web/HTML/Element/blockquote"><cite>MDN blockquote page</cite></a>
<cite><a href="/en-US/docs/Web/HTML/Element/blockquote">MDN blockquote page</a></cite>

That’s all of this question.

The pages I’ve already showed has this difference. I just want to know whether there is some reason or not.

you welcome @user-p

i do not think there difference except that in the logic

so for me if i want cite element and i want to make it has refrence link to it i would use

which more logical on this use case

by the way i am just learner same as you so i could be wrong

2 Likes