How to Center Instagram Embed with CSS Flexbox
- Categories:
- css
Based on MDN documentation, using center tag to centering element no longer recommended. This tag has been deprecated in HTML 4.
Centering item with <div align="center">
is also not recommended. Based on MDN documentation, the align attribute is obsolete.
So, if you want to center Instagram embed please avoid using center
tag or <div align="center">
, use CSS flexbox instead.
CSS to Center Element
.ig-container {
display: flex;
justify-content: center;
}
HTML
<div class="ig-container">
<!-- You Instagram Embed goes here -->
</div>
Demo
Before centering Instagram Embed
After centering Instagram Embed
Recent Posts
AWS Secrets Manager
Explanation about AWS Secrets Manager with example code.
Envelope Encryption
Envelope encryption is the practice of encrypting plaintext data with a data key, and then encrypting the data key under another key.
Tutorial - "su username vs su - username" - A Security Perspective
The main difference between `su username` and `su - username` lies in the environment variables that are loaded when switching to the specified user.
Subdomain Hijacking
My dormant subdomain was recently hijacked, redirecting it to a online gamble registration page.
C# DbContext ServiceLifeTime
my note about C Sharp ServiceLifeTime