0

I was going over this codepen and I saw this <dropdown> tag. I dont know if this is a legit tag like <div>, <span>, <section> etc..

<dropdown>
    <input type="checkbox" id="toggle1" checked>
    <label for="toggle1" class="animate">Editor <i class="fa fa-list float-right"></i></label>
    <ul class="animate">
        <li class="animate">Source <i class="fa fa-code float-right"></i></li>
        <li class="animate">Fullpage <i class="fa fa-arrows-alt float-right"></i></li>
        <li class="animate">Debug <i class="fa fa-cog float-right"></i></li>
    </ul>
</dropdown>

I think Xml allows you to have custom name for tags/ DOM elements but I don't think the author is using Xml.

I think the author made up his own element that describes the section that he is writing about. I didn't know you could do this. I also saw <time> one time being used in html. Can someone explain to me about how it's ok to make up your own tag names or show me documentation. I'm assuming this is an html thing

Hashem Qolami
  • 97,268
  • 26
  • 150
  • 164
jack blank
  • 5,073
  • 7
  • 41
  • 73
  • 2
    Related: [Why does CSS work with fake elements?](http://stackoverflow.com/questions/20353613/why-does-css-work-with-fake-elements) – Josh Crozier Mar 31 '15 at 02:16

2 Answers2

1

There is no dropdown element in HTML5 standard set.

HTML5 allows custom elements if they contain '-' in their names. So they'd better use <drop-down>...</drop-down> .

c-smile
  • 26,734
  • 7
  • 59
  • 86
0

<dropdown> is not a valid HTML tag. Not sure where you get this piece of code from, but you should avoid using custom tag. Use class selector / ID selector instead.

On the other hand, <time> is a HTML tag in HTML5 specification. Documentation is here.

Raptor
  • 53,206
  • 45
  • 230
  • 366
  • 1
    Could you elaborate more on "but you should avoid using custom tag" ? – c-smile Mar 31 '15 at 02:15
  • yes, custom tag beyond HTML5 specification will cause strange behavior in different browsers, especially for older browsers. It's always recommended that sites should be validated against [W3C Validator](http://validator.w3.org) – Raptor Mar 31 '15 at 02:17