Skip to content

Instantly share code, notes, and snippets.

@ryu1
Last active May 13, 2022 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryu1/3fcc17fc5b06ba56ffadc12a245975f5 to your computer and use it in GitHub Desktop.
Save ryu1/3fcc17fc5b06ba56ffadc12a245975f5 to your computer and use it in GitHub Desktop.

HTML-TIPS


上下中央揃え

<style type="text/css">
html, body {
	height: 100%;
}

body {
	margin: 0;
	padding: 0;
}

.wrapper {
	height: 100%;
	position: relative;
}

.main {
	position: absolute;
	top: 0px;
	bottom: 0px;
	width: 100%;
}

.content {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	-webkit- transform: translateY(-50%);
	cellpadding: 0;
	cellspacing: 0;
	width: 100%;
}
</style>

</head>
<body>
  <div class="wrapper">
    <div class="main">
      <table class="content" align="center">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment