レスポンシブ・イメージを使用して表を作成しましたが、ウィンドウのサイズ変更時にそこに留まるイメージに固定テキストを追加する方法がわかりません。私が来た最も近い<p class="">
を使用していたが、その後のテキストが応答しない...ここでレスポンシブ・イメージによる応答テキスト
はスクリプトです: https://jsfiddle.net/2vax05et/
基本的なレイアウト:
<div id="p-container">
<a href="#1">
<figure>
<img src="" alt="">
</figure>
</a>
[....]
</div>
CSS:
body {
width: 80%;
margin: 30px auto;
font-family: sans-serif;
}
h3 {
text-align: center;
font-size: 1.65em;
margin: 0 0 30px;
}
div {
font-size: 0;
}
a {
font-size: 16px;
overflow: hidden;
display: inline-block;
margin-bottom: 8px;
width: calc(50% - 4px);
margin-right: 8px;
}
a:nth-of-type(2n) {
margin-right: 0;
}
@media screen and (min-width: 50em) {
a {
width: calc(25% - 6px);
}
a:nth-of-type(2n) {
margin-right: 8px;
}
a:nth-of-type(4n) {
margin-right: 0;
}
}
a:hover img {
filter:brightness(80%);
}
figure {
margin: 0;
}
img {
border: none;
max-width: 100%;
height: auto;
display: block;
background: #ccc;
transition: .2s ease-in-out;
}
.p a {
display: inline;
font-size: 13px;
margin: 0;
}
.p {
text-align: center;
font-size: 13px;
padding-top: 100px;
}
あなたは固定または応答テキストをしたいですか?応答性の高いテキストは、テキストのサイズを決定するためのメディアクエリ、またはコンテナの幅を見つけるためのJavaScriptとテキストを正しいサイズにするための数学を必要とします。 – ntgCleaner
https://jsfiddle.net/rnxqo3n9/ – Banzay