.container
.main main
.sub sub
.container {
display: flex;
justify-content: space-between;
width: 90%;
max-width: 1000px;
margin: 0 auto;
}
.sub {
background-color: gray;
width: 300px;
}
.main {
background-color: gray;
flex: 1;
margin-right: 30px;
}
]]>.container
.box child element
.container {
align-items: center;
border: 1px solid gray;
display: flex;
flex-direction: column;
justify-content: center;
gap: 1ch;
width: 70%;
height: 300px;
margin: 30px auto 0;
position: relative;
.box {
background-color: #fff;
text-align: center;
padding: 30px;
max-width: 300px;
}
}
]]>ul
li: a メニュー01
li: a
| メニュー02
br
| メニュー02
li: a メニュー03メニュー03メニュー03
ul {
display: flex;
justify-content: space-between;
width: 100%;
max-width: 600px;
margin: 0 auto;
li {
display: flex;
width: 32%;
a {
background-color: gray;
box-sizing: border-box;
color: white;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
width: 100%;
padding: 12px 30px;
}
}
}
]]>p dark text shadow
p {
color: #fff;
text-shadow:
#000 1px 1px 1px, #000 -1px 1px 1px,
#000 1px -1px 1px, #000 -1px -1px 1px;
}
]]>.container
.both-sides
.right
.left
body {
overflow-x: hidden;
}
.container {
max-width: 1000px;
margin: 0 auto;
> * {
background-color: gray;
height: 200px;
margin-top: 20px;
}
.both-sides {
margin: 0 calc(50% - 50vw);
width: 100vw;
}
.right {
margin: 30px calc(50% - 50vw + 8px) 0 0;
}
.left {
margin: 30px 0 0 calc(50% - 50vw + 7px);
}
}
]]>h1.both-sides 見出し(両側にライン)
h1.right-side 見出し (右側にライン)
.both-sides {
display: flex;
align-items: center;
&::before,
&::after {
content: "";
background-color: gray;
flex-grow: 1;
height: 1px;
}
&::before {
margin-right: 0.5em;
}
&::after {
margin-left: 0.5em;
}
}
.right-side {
display: flex;
align-items: center;
&::after {
content: '';
background-color: gray;
flex-grow: 1;
margin-left: 0.5em;
height: 1px;
}
}
]]>.container
.box
p.name name01
.img
div(style="height: 210px")
.button button
.box
p.name
| name02
br
| name02
.img
div(style="height: 220px")
.button button
.box
p.name
| name03
br
| name03
br
| name03
.img
div(style="height: 200px")
.button button
.container {
display: flex;
justify-content: space-between;
.box {
border: 1px solid gray;
box-sizing: border-box;
display: grid;
width: 31%;
text-align: center;
.name {
align-self: flex-start;
margin: 0;
}
.img {
align-self: center;
margin: 20px 0;
div {
background-color: gray;
width: 90%;
margin: 0 auto;
}
}
.btn {
align-self: flex-end;
}
}
}
]]>p
| 文字に
strong マーカー
| を引きます。
strong {
text-decoration: underline;
text-decoration-thickness: 0.5em;
text-decoration-color: yellow;
text-underline-offset: -0.2em;
text-decoration-skip-ink: none;
padding: 0 2px;
}
]]>.box
.box {
background-color: gray;
width: 50%;
margin: 0 auto;
height: auto;
position: relative;
&::before {
content: '';
display: block;
padding-top: 50%;
}
}
]]>table
tbody
tr
th item name
td detail
tr
th item name
td detail
tr
th item name
td detail
table {
width: 70%;
margin: 0 auto;
counter-reset: number;
tr {
counter-increment: number;
th::before {
border-radius: 50%;
box-sizing: border-box;
background-color: gray;
color: #fff;
content: counter(number,decimal);
display: inline-block;
font-size: 14px;
width: 16px;
height: 16px;
text-align: center;
margin-right: 5px;
}
}
}
]]>table
tbody
tr
th item name
td detail
tr
th item name
td detail
tr
th item name
td detail
table {
width: 70%;
margin: 0 auto;
th {
display: flex;
align-items: center;
width: 100%;
&::after {
background: radial-gradient(circle farthest-side, gray, gray 30%, transparent 30%, transparent);
background-size: 6px 6px;
content: '';
display: block;
flex-grow: 1;
height: 6px;
margin: 0 1%;
}
}
td {
width: 4em;
}
}
]]>.button
a link
.button {
a {
background-color: gray;
box-sizing: border-box;
color: #fff;
display: block;
font-size: 14px;
padding: 15px 10px;
text-align: center;
position: relative;
max-width: 150px;
&::before {
content: '';
border: solid 1px #fff;
border-width: 1px 1px 0 0;
width: 4px;
height: 4px;
transform: translate(0, -50%) rotate(45deg);
position: absolute;
top: 50%;
right: 10px;
}
}
}
]]>.dot-line
.dot-line {
&::before {
background: radial-gradient(circle farthest-side, gray, gray 30%, transparent 30%, transparent);
background-size: 10px 10px;
content: '';
display: inline-block;
height: 10px;
width: 100%;
}
}
]]>