Login Register Appointment

Why is my margin not working in CSS?

By Admin in 12 Sep 2024 | 11:22
Admin

Admin

Staff
Faithful User
Forums Top User
Posts: 10
Member since: 19 Aug 2020

 I applied a margin to an element, but it doesn’t seem to be working. What could be wrong?

12 Sep 2024 | 11:22
0 Likes
Admin

Admin

Staff
Faithful User
Forums Top User
Posts: 10
Member since: 19 Aug 2020

This could be due to several factors:


Collapsing margins: Margins on block-level elements can collapse (combine) under certain circumstances. Try using padding instead or apply overflow: hidden to the parent container to prevent collapsing.

Incorrect display property: If the element has a display value of inline, margins won’t apply. Use display: block or display: inline-block to allow margins.

12 Sep 2024 | 11:22
0 Likes
login icon

Login to reply

Please login to reply to this topic

Report

Please describe about the report short and clearly.