Skip to content

Instantly share code, notes, and snippets.

@mladoux
Last active February 3, 2022 12:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mladoux/c0273e68d9bfab3afee19ca788004cdf to your computer and use it in GitHub Desktop.
Save mladoux/c0273e68d9bfab3afee19ca788004cdf to your computer and use it in GitHub Desktop.
Resize embedded gist code box and centers it. Adjust to taste.
/* Set width to 600px, and center box */
.gist {
margin-left: auto;
margin-right: auto;
width: 600px !important;
}
/* Limit height and width of script box, and enable scrollbars */
.gist-data {
height:250px;
overflow-y: visible;
width: 600px;
overflow-x: visible;
}
@TomEpsilon
Copy link

I have a shorter answer: Wrap the script in a div, then does all the width and height on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment