Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
幅70%のみでth属性にbgcolorをつけたいです。 ヘッダーは「Mega Event Offer」のようなものです。それだけに背景色を付けたいです。でも横幅は大きいです。SO も見出しを超えています.. できますか? 私はググった..しかし、役に立たない.. 何か考えはありますか?
ここで問題を完全に理解しているかどうかはわかりませんが、th 要素全体ではなく、テキストの背後にのみ背景を適用したい場合、テキストを - 要素でラップし、spanそれに背景色を適用できると思います-要素全体の代わりにth。
span
th
このようなもの:
マークアップ
.. <th> <span class="mega-event">Mega Event Offer</span> </th> ..
CSS
.mega-event { background-color: #888; }