Reputation: 2017
I am trying to create something in jquery that will add a default font-size to every element on the page if it doesn't already have one.
How would I do that?
Upvotes: 0
Views: 52
Reputation: 1
Read up on CSS Resets. With a little research you'll see how to set a default font size that can be flexibly overridden in ways that you can easily control. You'll prefer to do this in CSS, and perhaps use JS to make unique localized modifications, if anything. Most of your style markup can and should be in CSS.
Upvotes: 0
Reputation: 30607
No need for jQuery. Just use the css universal selector like
*{
font-size: 12px;
}
Upvotes: 1
Reputation: 1868
Use CSS for this.
body {
font-size: 14px; /* Or whatever size you want */
}
Upvotes: 0