プログラミング備忘録 foo

付箋の見出し

目的

  • リストの内容を分かりやすくする見出しを付けたいが、帯のように横一杯ではなく、端にさりげなく付けたい。

実行結果

おすすめメニュー
  • うどん
  • 蕎麦
  • スパゲッティー

解説

HTML

<div class="layout_3_3">おすすめメニュー</div>
	<div>
		<ul>
			<li>うどん</li>
			<li>蕎麦</li>
			<li>スパゲッティー</li>
		</ul>
	</div>

CSS

.layout_3_3 {
	font-size: 16px;
	font-weight: bold;
	color: #FFFFFF;
	background-color: #064458;
	display: inline-block;
	padding-top: 5px;
	padding-right: 10px;
	padding-bottom: 5px;
	padding-left: 10px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	margin-left: 30px;
	border-top-right-radius: 10px;
	border-top-left-radius: 10px;
	border-top-style: solid;
	border-top-width: 1px;
	border-top-color: #000000;
	border-right-style: solid;
	border-right-width: 1px;
	border-right-color: #000000;
	border-left-style: solid;
	border-left-width: 1px;
	border-left-color: #000000;
}

.layout_3_3 + div {
	background-image: linear-gradient(0deg, transparent calc(100% - 1px), #F8F7F7 calc(100% - 1px)),linear-gradient(90deg, transparent calc(100% - 1px), #F8F7F7 calc(100% - 1px));
	background-size: 4px 4px;
	background-repeat: repeat;
	background-position: center center;
	width: 96%;
	padding-top:  15px;
	padding-right: 0px;
	padding-bottom: 0px;
	padding-left: 0px;
	margin-top: 0px;
	margin-right: auto;
	margin-bottom: 25px;
	margin-left: auto;
	border: solid 1px #7D7D7D;
}

.layout_3_3 + div ul,.layout_3_3 + div ol {
	font-size: 16px;
	line-height: 1.7;
	padding-top: 0px;
	padding-right: 15px;
	padding-bottom: 20px;
	padding-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	margin-left: 40px;
}

.layout_3_3 + div li {
	padding-top: 0px;
	padding-right: 0px;
	padding-bottom: 0px;
	padding-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 25px;
	margin-left: 0px;
}

.layout_3_3 + div li:last-child  {
	padding-top: 0px;
	padding-right: 0px;
	padding-bottom: 0px;
	padding-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	margin-left: 0px;
}