0

I'm adding HTML Tag Attributes to a section in a Gantry 5 layout, using the section's settings. But any special characters are rendered as Unicode Hex Character Codes in the resultant HTML. So adding the tag

data-0

to the section

g-mainbottom1

with the attribute

background-position: 50% 100px

results in this div:

<section id="g-mainbottom1" data-0="background-position&#x3A;&#x20;50&#x25;&#x20;100px&#x3B;">

rather than the desired

<section id="g-mainbottom1" data-0="background-position: 50% 100px;">

Assuming there's nothing I can do to prevent the conversion behaviour, is there anything I can do with the actual text to prevenmt these characters from being converted Unicode Hex equivalents?

  • 1
    That is actually the same thing. I don't know why the system sees fit to escape some characters, but the result is the same. – Mr Lister Nov 22 '18 at 19:10
  • You may be surprised to learn that the "A..Z" and the other text in your HTML is *also* Unicode. – Jongware Nov 25 '18 at 11:01

1 Answers1

0

I think you forgot to use <meta charset="UTF-8"> in the <head> tag

<head>
    <meta charset="UTF-8">
    <meta name="description" content="Free Web tutorials">
    <meta name="keywords" content="HTML,CSS,XML,JavaScript">
    <meta name="author" content="John Doe">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>

Metadata is data (information) about data.

The tag provides metadata about the HTML document. Metadata will not be displayed on the page, but will be machine parsable.

Meta elements are typically used to specify page description, keywords, author of the document, last modified, and other metadata.

The metadata can be used by browsers (how to display content or reload page), search engines (keywords), or other web services.

HTML5 introduced a method to let web designers take control over the viewport (the user's visible area of a web page), through the tag (See "Setting The Viewport" example below).

reference https://www.w3schools.com/tags/tag_meta.asp

Poode
  • 1,692
  • 1
  • 15
  • 20
  • `` is indeed in the ``. However, the fact that browsers seems to intepret this OK for some reason, and the scripts relying on these attributes appear to work fine. So it's not an issue for me any more. Still slightly puzzled as to why it's rendering this way, but it works, whatever! – small-media-large Nov 26 '18 at 10:43