In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how jquery changes the font to Song style". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to change the font to Song style by jquery.
Modification methods: 1, use css () to control font-family style, syntax "text element .css (" font-family "," Song style "); 2, use attr () to set font style, syntax" text element .attr ("style", "font-family:' Arial'") ".
The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.
In a browser, parse an html document whose text has a default font.
Method 1: use css ()
The css () method returns or sets one or more style properties of the matching element.
You just need to use the css () method to set the font-family property and set the property value to "Arial".
Example:
$(document) .ready (function () {$("button") .click (function () {$("# zt"). Css ("font-family", "Arial");})
Default font
Modify font
Change the font to Song style
Method 2: using attr () method
The attr () method sets or returns the property value of the selected element.
You can use this method to set the style property and add font-family: "Song style"; style.
Example:
$(document) .ready (function () {$("button") .click (function () {$("p"). Attr ("style", "font-family:' Arial'");})
This is a passage.
This is a passage.
Change the font to Song style
Description:
The font-family attribute specifies the font of an element.
The font-family property should set several font names as a "backup" mechanism, and if the browser does not support the first font, it will try the next font.
Note: if the name of the font family is more than one word, it must be in quotation marks, such as Font Family: "Arial".
The property value of this property:
Value description
Family-name
Generic-family
A priority list of font family names or / and class family names used for an element.
Default value: depends on the browser.
Inherit states that font families should be inherited from the parent element. At this point, I believe you have a deeper understanding of "how jquery changes the font to Song style". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.