- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Role of margin property with value inherit using CSS
The margin property with value inherit is used to inherit an element from the parent element. You can try to run the following code to implement margin: inherit;
Example
<!DOCTYPE html> <html> <head> <style> div { border: 2px solid blue; margin-left: 50px; } p.ex1 { margin-left: inherit; } </style> </head> <body> <p>Inheriting left margin from the parent element</p> <div> <p class = "ex1">This is demo text with inherited left margin.</p> </div> </body> </html>
Output
- Related Articles
- Role of margin property with value auto using CSS
- Usage of margin property with CSS
- Usage of margin-top property with CSS
- Usage of margin-bottom property with CSS
- Usage of margin-right property with CSS
- Role of CSS justify-content property center value
- Role of CSS flex-wrap property wrap value
- Role of CSS flex-direction property column value
- Role of CSS flex-direction property row value
- Animate CSS margin property
- Center alignment using the margin property in CSS
- Role of CSS justify-content property space-between value
- Role of CSS flex-direction property row-reverse value
- Role of CSS flex-wrap property wrap-reverse value
- Role of CSS flex-wrap property no-wrap value

Advertisements