How do I make html td elements fit the resizing window?
**THIS IS MY HTML**
<div class="table">
<table>
<tr>
<td><a href="otherpage.html">Home</a></td>
<td><a href="otherpage.html">About us</a></td>
<td><a href="otherpage.html">Testimonials</a></td>
<td><a href="otherpage.html">Contact us</a></td>
<tr>
</table>
</div>
THIS IS MY CSS
html,body{
margin:0;
height:100%;
background: linear-gradient(red,pink);
}
.table{
background-color:black;
margin:0;
}
td,a{
padding:25px;
margin:80px;
}
When the window is smaller, some of the text in the td goes to the next line. How to do it? This is normal:
+3
source to share
3 answers
html,body{ margin:0; height:100%; background: linear-gradient(red,pink); } .table{ background-color:black; margin:0; } td,a{ padding:20px; }
<div class="table">
<table>
<tr>
<td><a href="otherpage.html">Home</a></td>
<td><a href="otherpage.html">About us</a></td>
<td><a href="otherpage.html">Testimonials</a></td>
<td><a href="otherpage.html">Contact us</a></td>
<tr>
</table>
</div>
0
source to share