I want to use the hover pseudoclass in css to increase the size of individual links in a table, however every time they are hovered over, the size increase affects the size of the rows/columns and all the other links in the table move in accordance.
Any way i can prevent this using only css and html?
To make your font size smaller or larger: On your device, open the Settings app. Search and select Font size. To change your preferred font size, move the slider left or right.
The font-size-adjust property gives you better control of the font size when the first selected font is not available. When a font is not available, the browser uses the second specified font. This could result in a big change for the font size. To prevent this, use the font-size-adjust property.
You can use CSS3 tranform to scale the links without causing re-positioning of surrounding elements, for example:
table a:hover{ -webkit-transform: scale(1.2); }
-webkit-
can be changed for other vendors (e.g., -moz-
and -ms-
), but is not available in some browsers, including IE8.
Using line-height
will not prevent horizontal movement, therefore expanding the column.
Set the initial height
to the line-height
.
td {line-height: 20px; font-size: 14px;}
td:hover {font-size: 20px;}
Force the line-height
height to be the same and change the font-size
on hover.
Example here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With