使用CSS选择id =“ tutorials”的元素
要选择id=”tutorials”的所有元素,可以尝试运行以下代码。
使用#idCSS选择器可实现此目的,
示例
<!DOCTYPE html> <html> <head> <style> #tutorials { border: 3px solid red; } </style> </head> <body> <h1>Nhooo</h1> <h2>Learning</h2> <p id = "tutorials">Tutorials on web dev, programming, database, networking, etc.</p> <p>Every tutorials has lessons with illustrations and figures.</p> </body> </html>