I have little problem and don't know why it doesn't work. I tried to change font size for label tag, but I can't set less than 10px. Why?
.group {
margin-bottom: 20px;
}
.group label {
font-size: 10px;
}
.group2 label {
font-size: 8px;
}
<div class="group">
<label for="input1">First label</label>
<input type="text" name="input1">
</div>
<div class="group group2">
<label for="input2">Second label</label>
<input type="text" name="input2">
</div>
To change the font size in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <p> tag, with the CSS property font-size. HTML5 do not support the <font> tag, so the CSS style is used to add font size.
In HTML, you can change the size of text with the <font> tag using the size attribute. The size attribute specifies how large a font will be displayed in either relative or absolute terms. Close the <font> tag with </font> to return to a normal text size.
To change font properties, highlight the address, right-click, and click Font. Make your changes, and click OK. Still on the Labels window, click the New Document button at the bottom. A Word document will appear containing the labels.
Click the data label and drag it to the size you want. Tip: You can set other size (Excel and PowerPoint) and alignment options in Size & Properties (Layout & Properties in Outlook or Word). Double-click the data label and then click Size & Properties.
I have tested this one on my side and it works as intended.
If you are loading the styles via a stylesheet it is possible that your browser has cached this, and you may need to clear browser caches.
Some browsers do also supply default values for most HTML elements. (Something to consider)
EDIT: It turned out that cached CSS in Opera was responsible non-updating styling.
Working as required. Remember to re-run your code snippet after making changes.
.group {
margin-bottom: 20px;
}
.group label {
font-size: 10px;
}
.group2 label {
font-size: 4px;
}
<div class="group">
<label for="input1">First label</label>
<input type="text" name="input1">
</div>
<div class="group group2">
<label for="input2">Second label</label>
<input type="text" name="input2">
</div>
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