実現したいこと
- 隣 td タグ内でもリンクが反応する
- 隣 td タグ内での Hover でリンク文字色が変わる (白になる)
発生している問題
1. 左 td 内ではリンクが反応しない 2. 左 td 内での Hover ではリンク文字色が変わらない
該当のソースコード
html
1 <div id="button"> 2 <table> 3 <tr> 4 <td valign="top" width="50%" class="box"> 5 <table border="0" width="100%"> 6 <tr> 7 <td class="sLabel" width="20px"></td> 8 <td class="sBody" width=""><a href="#">リンク</a></td> 9 </tr> 10 </table> 11 </td> 12 </tr> 13 </table> 14 </div>
css
1 #button { background:#eeeded; } 2 #button .box { background:#fff; font-size:16px; width:100%; height:70px; line-height:70px; } 3 #button .box a { display:block; } 4 #button .box a:hover { background:#cc141c; color:#fff; } 5 #button .box:hover { background:#cc141c; color:#fff; } 6 #button div { display:inline-block; width:0%; min-width:420px; }
試したこと
リンクのブロック指定。
display:block;
補足情報(FW/ツールのバージョンなど)
SharePoint Online Web パーツ内のタグ構造を使用しているため、
id や class が指定されていない場合はタグ構造から指定する必要があります。
こちらの html ソースはその一部になります。
css 単独では対応できない場合、javaScript で html タグを例えば以下のように書き換えれば、
html
1 <div id="button"> 2 <table> 3 <tr> 4 <td valign="top" width="50%" class="box"> 5 <table border="0" width="100%"> 6 <tr> 7 <td class="sLabel" width="" ></td> 8 <td class="sBody" width="" style="margin-left:20px;"><a href="#">リンク</a></td> 9 </tr> 10 </table> 11 </td> 12 </tr> 13 </table> 14 </div>
左に空白を残しながら、全域にリンクが動作するようになるのでしょうか?
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/05/23 11:53 編集