cssにてmarginをリセットしているにも関わらずtableにmarginがかかってしまいます。
消し方を教えて頂けたらと思います。
ブラウザはchromeでPCはwindowsになります。
以下、コードになります。
html
1<table> 2 <tr> 3 <td rowspan="2"><img src="./material/logo.png" width="60"></td> 4 <td>207</td> 5 </tr> 6 <tr> 7 <td>DAYS TO GO</td> 8 </tr> 9</table>
scss
1* { 2 margin: 0; 3 padding: 0; 4} 5table { 6 border-collapse: collapse; 7 border-spacing: 0; 8} 9 10 11#page-header { 12 table { 13 display: inline-block; 14 border: 1px solid #000; 15 border-radius: 5px; 16 tr { 17 &:nth-of-type(1) 18 td { 19 text-align: center; 20 21 &:nth-of-type(1) { 22 border-right: 1px solid #000; 23 } 24 &:nth-of-type(2) { 25 font-size: 3.5rem; 26 font-weight: bold; 27 padding: 0; 28 } 29 } 30 &:nth-of-type(2) { 31 td { 32 color: #fff; 33 background-color: #000; 34 padding: 1.0rem; 35 font-weight: bold; 36 text-align: center; 37 } 38 } 39 } 40 } 41}
申し訳ありません。
以下、コンパイル後のcssのコードになります。
css
1* { 2 margin: 0; 3 padding: 0; 4} 5table { 6 border-collapse: collapse; 7 border-spacing: 0; 8} 9 10border 11 table { 12 display: inline-block; 13 border: 1px solid #000; 14 border-radius: 5px; 15} 16table tr:nth-of-type(1) 17td { 18 text-align: center; 19} 20table tr:nth-of-type(1) 21td:nth-of-type(1) { 22 border-right: 1px solid #000; 23} 24table tr:nth-of-type(1) 25td:nth-of-type(2) { 26 font-size: 3.5rem; 27 font-weight: bold; 28 padding: 0; 29} 30table tr:nth-of-type(2) td { 31 color: #fff; 32 background-color: #000; 33 padding: 1.0rem; 34 font-weight: bold; 35 text-align: center; 36}
回答1件
あなたの回答
tips
プレビュー