bootstrap

Bootstrapを使ったホームページのテンプレート

個人的によく使うフォーマットなので、ほぼ自分のためですが、残しておこうと思います。

目次 - Contents

完成形

ソースコード

<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	<meta name="robots" content="nofollow" />
	<title>タイトル</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
		integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
	<link rel="stylesheet" href="../../css/gitlab.css"
	<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
		integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous">
	</script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
		integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous">
	</script>
	<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
		integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous">
	</script>
	<link rel="shortcut icon" type="image/x-icon" href="xxxxxxxxxxxxxxxxxxxxxxxxx">
</head>

<body>

	<nav class="navbar navbar-expand-lg navbar-dark" style="background-color:rgb(204,229,255);">
		<a class="navbar-brand" href="" style="color:rgb(0, 64, 133);">サービス名</a>
		
		<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText"
			aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
			<span class="navbar-toggler-icon"></span>
		</button>
		<div class="collapse navbar-collapse" id="navbarText">
			<ul class="navbar-nav mr-auto">
				<li class="nav-item">
					<a class="nav-link" href="" style="color:rgb(0, 64, 133);">ナビゲーション</a>
				</li>
			</ul>
		</div>
	</nav>
	<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
	<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/js/bootstrap.min.js" integrity="sha384-o+RDsa0aLu++PJvFqy8fFScvbHFLtbvScb8AjopnFD+iEQ7wo/CG0xlczd+2O/em" crossorigin="anonymous"></script>	


	<div class="container mt-5">
		<div class="row justify-content-md-center">
			<div class="col-sm-12">
				<div class="card">
					<div class="card-header">
						xxxxxxxxxxxxxxxxxxxxxxxxx
					</div>
					<div class="card-body">
						<form action="" method="post">
							<div class="form-group">
								<label>xxxxxxxxxxxxxxxxxxxxxxxxx</label>
								<input type="text" class="form-control" name=""  value="" placeholder="" required>
							</div>
							<div align="center">
								<button type="submit" class="btn btn-success">xxxxxxxxxxxxxxxxxxxxxxxxx</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	
<style>
	/* Sticky footer styles
	-------------------------------------------------- */
	html {
	  position: relative;
	  min-height: 100%;
	}
	body {
	  /* Margin bottom by footer height */
	  margin-bottom: 60px;
	}
	.footer {
	  position: absolute;
	  bottom: 0;
	  width: 100%;
	  /* Set the fixed height of the footer here */
	  height: 60px;
	  background-color: #f5f5f5;
	}
	 
	 
	/* Custom page CSS
	-------------------------------------------------- */
	/* Not required for template or sticky footer method. */
	 
	.container_ft {
	  width: auto;
	  max-width: 680px;
	  padding: 0 15px;
	}
	.container_ft .text-muted {
	  margin: 20px 0;
	}
</style>

<footer class="footer">
	<div class="container_ft">
		<p class="text-muted" align="center">Copyright 2020 xxxxxxxxxxxxxxxxxxxxxxxxx</p>
	</div>
</footer>

</body>

</html>