[CSS Selector] E#idName
Using #id-name, you can apply styles to the element with the specified id.
Sample Code
#hoge { color: red;} /* Applies to the element with id 'hoge'. */
p#hoge1 { color: blue;} /* Applies to the p element with id 'hoge1'. */
Browser Display Result
#hoge { color: red;} /* Applies to the element with id 'hoge'. */
p#hoge1 { color: blue;} /* Applies to the p element with id 'hoge1'. */
<div id="hoge">This is a div element with id 'hoge'.</div> <div>This is a div element.</div> <p id="hoge1">This is a p element with id 'hoge1'.</p> <p>This is a p element.</p>
Browser Compatibility
Desktop
Supported in all versions
8 ○
7 ○
6 ○
2 and earlier ×Mobile
Android Browser
4.4+ ○
3 and earlier ×Same support as desktop
Same support as desktop
※ Version data is based on MDN.
If you find any errors or copyright issues, please contact us.