I am trying to control font size of the text inside the 1×3 table for mobile view only. Yes, I included:
<meta name = "viewport" content = "width=device-width, initial-scale=1.0">
<table width="700" align="center">
<tr>
<td><b><a href= "ListOfGenreLists.html" style="font-size: 40pt; color: #4B0082; text-decoration: none">Genre</a></b> </td>
<td><b><a href= "ListOfMiscellaneousLists.html" style="font-size: 40pt; color: #4B0082; text-decoration: none">Miscellaneous</a></b> </td>
<td><b><a href= "ListOfYearLists.html" style="font-size: 40pt; color: #4B0082; text-decoration: none">Year</a></b> </td>
</tr>
</table>
@media screen and (max-width:767px) {
table, td {
display: block;
}
td {
position: relative;
padding-left: 0%;
font-size: 10%;
line-height: 50px;
}
}
2
Answers
Use a detection javascript?
Put the following in a file called
uadetect.js
.Then you can add it after your HTML’s
<head>
tag:You can have a custom
.css
for all cases.If you use ‘px’ instead of ‘pt’ for your font-size, the font size would be adapted automatically to the device size.