+ 1

Can you use id/class inside any element?

For instance can I use it in like: <section id="first"> or <article class="main"> or <p id="last"> etc?

21st Nov 2016, 11:10 AM
Pierre Le Roux
Pierre Le Roux - avatar
3 ответов
+ 3
Yes. You can also use both in one element.
1st Dec 2016, 9:52 PM
Ismail
Ismail - avatar
+ 2
O I see now, I've tried it in my html code. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title> Register </title> <style> #title { font-size: 200%; color: red; background-color: aqua; text-align: center; } </style> </head> <body> <header id="title"> <h1> Member Registration Form: </h1> </header><br /> <form autocomplete="on" id="registerform"> <label for="user"> Username: </label> <input id="user" name="username" type="text" autofocus required /> <br /> <label for="name"> First Name: </label> <input id="name" name="firstname" type="text" required /> <br /> <label for="lastname"> Last Name: </label> <input id="lastname" name="lastname" type="text" required /> <br /> <label for="email"> Email: </label> <input id="email" name="email" type="email" placeholder="email@example.com" required /> <br /> <label for="cell"> Cellphone Number:</label> <input id="cell" name="cell" type="tel" placeholder="012 345 6789" required /> <br /> <label for="hnumber"> House Number: </label> <input id="hnumber" name="housenumber" type="number" placeholder="0 - 93" /> <br /> <label for="numberplate"> Numberplate: </label> <input id="numberplate" name="numberplate" type="text" placeholder=" ABC 123 GP/AB 12 CD GP" /> <br /> <input id="submit" name="submit" type="submit" /> </form> </body> </html> You can literally use it anywhere. Thanks SOLOLEARN!!
21st Nov 2016, 11:11 AM
Pierre Le Roux
Pierre Le Roux - avatar
0
yes
25th Nov 2016, 3:50 PM
Yaman Raj Mishra
Yaman Raj Mishra - avatar