が、私は3つのセル|information| |two lines| |empty|
2行目|empty| |two lines| |information|
を持つテーブルがあると、私のメディアクエリーは、これら2 フローティングテーブルセルは、右の高さ
|information||two lines|
|informatino||two lines|
を変更する問題は、彼らは、すぐに私がいることをfloatとして消える二行にある削除しますdivが右.verticalLine
ここ
は問題https://jsfiddle.net/fh6unb7q/
.side {
width: 45%;
}
.verticalLine:before {
content: "";
display: block;
position: absolute;
border-left: 0.13em solid #90A4AE;
border-right: 0.13em solid #90A4AE;
height: 100%;
width: 16%;
margin-left: 42%;
box-sizing: border-box;
}
.verticalLine {
position: relative;
width: 10%;
}
.tr {
display: table-row;
}
.tc {
display: table-cell;
}
.year {
text-align: center;
color: #607D8B;
}
/* Media Queries */
@media only screen and (max-width: 768px) {
header h1 {
font-size: 3rem;
}
.tr > div.side {
display: none;
}
.tr > div.verticalLine {
float: right;
}
.tr > div.year {
float: right;
}
.tr > a {
float: left;
}
.side {
width: 90%;
}
}
<div style="display: table;">
<div class="tr">
<a class="tc side" target="_blank" href="#">
<h3>test test test test test test test test test test test test test </h3>
</a>
<div class="tc verticalLine">
</div>
<div class="tc side"></div>
</div>
<div class="tr">
<div class="tc side"></div>
<div class="tc verticalLine">
</div>
<a class="tc side" target="_blank" href="#">
<h3>test test test test test test test test test test test test test </h3>
</a>
</div>
</div>
EDIT:コードは、フレックス使用して更新からhttps://jsfiddle.net/fh6unb7q/1/ HTML:
<div style="display: flex;">
<a class="side" target="_blank" href="#">
<h3>test test test test test test test test test test test test test </h3>
</a>
<div class="verticalLine">
</div>
<div class="side"></div>
</div>
<div style="display:flex">
<div class="side"></div>
<div class="verticalLine">
</div>
<a class="side" target="_blank" href="#">
<h3>test test test test test test test test test test test test test </h3>
</a>
</div>
CSS:
.side {
width: 45%;
}
.verticalLine:before {
content: "";
display: block;
position: absolute;
border-left: 0.13em solid #90A4AE;
border-right: 0.13em solid #90A4AE;
height: 100%;
width: 16%;
margin-left: 42%;
box-sizing: border-box;
}
.verticalLine {
position: relative;
width: 10%;
}
/* Media Queries */
@media only screen and (max-width: 768px) {
div.side {
display: none;
}
div.verticalLine {
float: right;
}
a {
float: left;
}
.side {
width: 90%;
}
}
あなたはまだ見ることができ、それは||が正しく整列されていないとメディアクエリが実行された後でも引き続き表示されます。
私はそれがこのようなので
|information||two lines|
|informatino||two lines|
このレイアウトで達成しようとしていることについて少し説明できますか?あなたは他のレイアウトテクニックに慣れていますか? –
@Michael_Bはい私は他のテクニックにはオープンしていますが、これは最もシンプルなものでした。設計のために私は| text | |装飾| |空欄| |空欄| |装飾| |テキスト|解像度が小さいときは、空の部分を保持するのは意味がありません。なぜなら、空のdivに表示を設定していないので、それらを整列させたいからです。 |装飾| |テキスト| |装飾| |ではない|テキスト| |装飾| |装飾| |テキスト| – Higeath
[flexbox solution](http://stackoverflow.com/q/32551291/3597276)を検討すると、テーブルやフロートよりも多くのレイアウトオプションと柔軟性が得られます。 –