Different html tag but same id
css, html
Solution
No. `ID`'s are unique and should only be used once per document. - source You can do it, but it will not be valid.
But you can have the same `class`-name as many times that you want.
.articleOptions {
// code
}
..or if you want the `div` and `ul` to act differently:
div.articleOptions {
// code
}
ul.articleOptions {
// code
}
You can validate your code here W3 Validator
Problem
Can I have two tags like a div and an ul with same id ? Sample html code : ``` <div id="articleOptions"> <ul id="articleOptions"> <li>Share</li> <li>View</li> <li>Read Later</li> </ul> </div> ``` Whould this be a valid html code ?