f



meta element order

The elearning package I'm working with automatically adds this:

    <meta name="viewport" content="width=1000">

to the head of the page. I cannot delete/remove it but I can add my own 
after it:

    <meta name="viewport" content="width=device-width, 
initial-scale=1.0, user-scalable=no">

As the names are the same will mine override the other?

Andrew Poulos
0
Andrew
8/2/2016 11:59:48 PM
comp.authoring.stylesheets 8158 articles. 0 followers. mdmoura (161) is leader. Post Follow

5 Replies
199 Views

Similar Articles

[PageSpeed] 16

On 03/08/2016 02:59, Andrew Poulos wrote:
> The elearning package I'm working with automatically adds this:
>
>    <meta name="viewport" content="width=1000">
>
> to the head of the page. I cannot delete/remove it but I can add my own
> after it:
>
>    <meta name="viewport" content="width=device-width, initial-scale=1.0,
> user-scalable=no">
>
> As the names are the same will mine override the other?

AFAIK, there is existing specification defining this, but a non 
normative section of CSS Device Adaptation Module Level 1 (Editor’s 
Draft, 3 August 2016) says:

"The Viewport <META> element is placed in the cascade as if it was a 
<STYLE> element, in the exact same place in the dom, that only contains 
a single @viewport rule."

https://drafts.csswg.org/css-device-adapt/#translate-meta-to-at-viewport

I guess that there is no way to avoid testing it for yourself :)

-- 
Best wishes, Osmo
0
Osmo
8/3/2016 3:04:53 AM
Andrew Poulos wrote:

> The elearning package I'm working with automatically adds this:
> 
>     <meta name="viewport" content="width=1000">
> 
> to the head of the page. I cannot delete/remove it but I can add my own
> after it:
> 
>     <meta name="viewport" content="width=device-width,
> initial-scale=1.0, user-scalable=no">
> 
> As the names are the same will mine override the other?

<http://catb.org/esr/faqs/smart-questions.html#classic>


PointedEars
-- 
When all you know is jQuery, every problem looks $(olvable).
0
Thomas
8/4/2016 4:51:37 PM
On 08/02/2016 04:59 PM, Andrew Poulos wrote:
> As the names are the same will mine override the other?
> 
  I would presume that the <meta> tag is handled the same as any other
tag: The last one in the list wins.

-- 
James Moe
jmm-list at sohnen-moe dot com
Think.
0
James
8/4/2016 8:39:58 PM
On 04/08/2016 23:39, James Moe wrote:
>   I would presume that the <meta> tag is handled the same as any other
> tag: The last one in the list wins.

If CSS declarations have the same importance, origin and specificity, 
the last one in the list wins. But markup elements are not handled that 
way. Try it with <h1> :) And, for example, in the case of <base>: the 
first one in the list wins.

-- 
Best wishes, Osmo
0
Osmo
8/5/2016 3:55:14 AM
James Moe wrote:
>   I would presume that the <meta> tag is handled the same as any other
> tag: The last one in the list wins.

The <meta> tag can be handled very
differently from other tags.

If the browser encounters, for example:
<meta http-equiv="Content-Type" content="text-html; charset=US-ASCII">

rendering the page is u=immediately
abandoned, and restarted taking account of
the (new) information about the character
encoding.

-- 
Regards,
Martin Leese
E-mail: please@see.Web.for.e-mail.INVALID
Web: http://members.tripod.com/martin_leese/
0
Martin
8/5/2016 5:00:22 AM
Reply: