I am creating a webpage and want to embed a GitHub Gist in the webpage. I want to align it in the center. I am using flex. But even though everthing else in the page is aligning itself the GitHub Gist object is not aligning itself.
Minimum Reproducible Code:
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta content="width=device-width, initial-scale=1" name="viewport">
<title>Sample</title>
<link href="css/StyleSheet2.css" rel="stylesheet" />
</head>
<body class="Top-Head">
<h1 class="Topper">This line gets centered</h1>
<script src="https://gist.github.com/anirbansaha96/6a515384c62191b367b4489ea538481e.js"></script></body>
</html>
And the CSS file:
body {
margin: 0;
}
.Top-Head {
display: flex;
flex-direction: column;
justify-content: center;
align-items: baseline;
}
.end-github-gist {
align-self: center;
}
.Topper {
align-self:center;
}
Sample:
Expected Output: Every Item being center aligned, mainly the GitHub Gist being center aligned.