0

Basically this makes a nice html title but the html validator gives me an error saying ( Element h7 not allowed as child of element div in this context. (Suppressing further errors from this subtree.) and I don't know how to make this not appear.

<div class="PPS">
      <div class="TEXT">
         <div class="SX">
            <h7>L</h7>
         </div>
         <div class="SX">
            <h7>U</h7>
         </div>
         <div class="SX">
            <h7>C</h7>
         </div>
         <div class="SX">
            <h7>A</h7>
         </div>
         <div class="SX">
            <h7>S</h7>
         </div>
         <div class="SX">
            <h7>S</h7>
         </div>
      </div>
  • 1
    `h7` doesn't exist. smallest is `h6` – sean-7777 Mar 05 '22 at 21:13
  • [this post](https://stackoverflow.com/questions/14908463/how-to-make-new-heading-tag-numbers-such-as-h7-h8-etc) may be helpful to you. – llo Mar 05 '22 at 21:17
  • 1
    You're essentially creating custom HTML elements here, and browsers/validators/etc. have no information about the semantics and content of those elements. There may be ways to define the semantics of those elements (whether or not they are headings, flow content, etc.) but it's *probably* simpler to just use existing elements and style them. Is there any particular reason why *each individual letter* here needs to be its own semantically distinct heading? Probably not. Don't get clever with HTML semantics just to add style. Keep the semantics simple and use CSS for the styling. – David Mar 05 '22 at 21:18
  • I know h7 doesn't exist, but right now it's what I need and I can't use h6 because it messes up the word formatting. I enclose a link with a photo of what I have now, which is what I want to have, but without getting the error in the HTML validator. https://i.stack.imgur.com/VNL9I.png – Seikou Bah Karagera Mar 05 '22 at 21:24
  • What "html validator"? – derpirscher Mar 05 '22 at 21:26
  • I want to define a semantic element, the h7 would contain what is attached to the images https://i.stack.imgur.com/VNL9I.png , https://i.stack.imgur.com/jNYnz.png @David – Seikou Bah Karagera Mar 05 '22 at 21:32
  • I am using this HTML Validator (https://validator.w3.org/nu/#file), I am attaching a photo of the errors that I get in the validator https://i.stack.imgur.com/RS8CD.png @derpirscher – Seikou Bah Karagera Mar 05 '22 at 21:34
  • Well the validator of the w3 consortium seemingly only supports tags that are defined in the standard ...if you want to use custom tags, you will need another validator which supports defining them – derpirscher Mar 05 '22 at 21:38
  • What validator can I use? @derpirscher – Seikou Bah Karagera Mar 05 '22 at 21:40
  • One question, because I use a custom tag does not mean that my code is wrong, right?One thing, that I use custom tag does not mean that my code is wrong, right? @derpirscher – Seikou Bah Karagera Mar 05 '22 at 21:44
  • @SeikouBahKaragera: Correct. It does not mean that your code is "wrong". It just means that your code is *custom*. Which means that its behaviors are *outside standard specifications* and can't rely on those standards. If you want to use an HTML validator, you need code that's valid within the HTML specification. – David Mar 05 '22 at 21:45
  • Now I understand. There are many parts of my code that have custom tags. I prefer to leave it as is because using normal will make my web page look very basic. Thank you all you are fantastic!! – Seikou Bah Karagera Mar 05 '22 at 21:51

0 Answers0