TRENDING TOPICS

×

Can a Div have an ID and a class?

By: Aisho Ahmad | 18 June 2019

T

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:

.Demo

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

Using an ID:

#Demo_ID

{top-margin:40px;}

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>

</div>

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 "advertise@gdatamart.com"

© 2021 GDATAMART.COM (All Rights Reserved)