fieldset { font-size: 20px;}
label:hover , input:hover { font-size: 25px;}
<fieldset>
<legend> XXX </legend>
<label for="photo"> Photo </label>
<input type="file" name="photo" id="photo">
<br>
<label for="imagePreview"> Preview: </label>
<img id="preview">
</fieldset>
你的意思是这样的
fieldset { font-size: 20px;}
fieldset:hover label,fieldset:hover input { font-size: 25px;}
<fieldset>
<legend> XXX </legend>
<label for="photo"> Photo </label>
<input type="file" name="photo" id="photo">
<br>
<label for="imagePreview"> Preview: </label>
<img id="preview">
</fieldset>
如何在悬停时改变字体大小,而不改变背景大小?