Can a Div have an ID and a class?

By: Aisho Ahmad | 18 June 2019


Tina Shivam

30 July 2019

Yes, we can use ID and Class both together in a DIV by CSS properties, for example:

Using a Class:


{padding:10px;  height: 200px; width: 400px;}

Using an ID:



Here - In this DIV to call both class and id property:

<div class="Demo" ID="Demo_ID">

    <p>Both class and id property work in this division</p>


0 votes

Your Answer

Advertise With Us

We offer sponsored posts and guest posts with do-follow links, back-links, and other advertising services, To advertise email us at ""

© 2021 GDATAMART.COM (All Rights Reserved)