Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

what characters are (and are not) allowed in style names?

Contributor ,
Dec 05, 2018 Dec 05, 2018

Hi

I have a file with lots of paragraph styles and character styles. After exporting it as HTML, I got the following error message:

HTML export warning(s)

The file was exported but one or more problems were detected:

CSS name collision : 26 detected

The names of the various paragraph styles are unique, and I have not used any special characters in them. Some of the names that were detected in the warning message differ only very slightly, the only difference being a punctuation character or a space, for example:

;  a1 [that is, semicolon, space, space, a1]

;' a1 [that is, semicolon, apostrophe, space, a1]

So in order to make sure there are no conflicts, what characters should not be used in style names? What exactly are the limitations?

1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 06, 2018 Dec 06, 2018

For best results, I avoid any unique characters as well as spaces in my InDesign style names when exporting to HTML from InDesign.

Translate
Community Expert ,
Dec 05, 2018 Dec 05, 2018
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 06, 2018 Dec 06, 2018

Thanks, Uwe. I'm note sure I understand the definition found there: "only the characters [a-z0-9] and ISO 10646 characters U+00A1 and higher" – doesn't this mean that basically every character is allowed?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 05, 2018 Dec 05, 2018

There could also be a different depth to the problem with style names:

Check what InDesign does with a specific style name after export to HTML.

Maybe some conversions are done.

Regards,
Uwe

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 06, 2018 Dec 06, 2018

Correct, in the HTML version some characters in the style names have indeed been converted to a hyphen. As far as I can see this holds true for the apostrophe (U+0027) and for the space character (U+0020).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 06, 2018 Dec 06, 2018

For best results, I avoid any unique characters as well as spaces in my InDesign style names when exporting to HTML from InDesign.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 06, 2018 Dec 06, 2018

Thanks, Chad. I had not been aware that spaces can cause problems – now I'll stop using them in style names!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 06, 2018 Dec 06, 2018
LATEST

I think most browsers handle it pretty well however spaces get converted to %20 in the HTML/CSS. I just find it cleaner and more predictable when I avoid using spaces 😉

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines