Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use css to set web page font in frontpage2000

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to use css to set web page fonts in frontpage2000", the explanation content in the article is simple and clear, easy to learn and understand, please follow the idea of small series slowly in-depth, together to study and learn "how to use css to set web page fonts in frontpage2000" bar!

We can use css to set up a myriad of web page fonts, but all changes are consistent, and any changes must follow the basic syntax of css. So let's start by understanding the basic syntax of CSS, which looks like this: HTML tags {tag attributes: attribute values;… }. When setting fonts, you can achieve your goal by changing the attribute values of font attributes correctly. Font attributes are divided into five types: font-family, font-style, font-variant, font-weight, font-size. In addition, font attribute is an overall attribute, and the above attributes and attribute values can be specified one by one. Their functions and attribute values are as follows:

1. font family

Function: Specify font type by font-family to change the font of HTML logo or element, you can set up a list of available fonts. The browser selects fonts from front to back.

Its syntax is: h2 {font-family: font type, font type, font type}

2. Font style (font-style)

Function: Make text appear as italic or italic, etc. Attribute values: normal-normal, italic-italic, oblique-oblique

Syntax: h2{font-style: attribute value}

3. Font deformation (font-variant)

Function: Make lowercase letters in text appear as capital letters in smaller fonts, often used to design special titles.

Attribute values: normal and small-caps

Syntax: h2{font-variant: attribute value}

4. Bold font (font-weight)

Function: Used to set the thickness of font strokes.

Attribute Value: Normality- normal

Relativity- bold, bolder, light, lighter

Gradient- 100, 200, 300, 400(equivalent to normal), 500, 600, 700(equivalent to bold, lighter, bolder, and values 100-900).

The syntax is: h2

< font-weight: 属性值>

5. Font size (font-size)

Function: Change font size.

Attribute value: Length-measured in millimeters (mm), centimeters (cm), inches (in), pounds (pt), pixels (px), pica(pc), ex(height of lowercase x), or em(font height).

Percent-Percentage relative to the font size of its parent element. Absolute size is divided into xx-small, x-small, small, medium, large, x-large, xx-large seven kinds, they are in various fonts medium size proportional scaling, each level of 1.5 times. Relative size: There are two types: larger and smaller. The size after scaling is determined according to the original size of the font. Percentage: Set the font to a percentage of its original size. You can specify any number.

Syntax: {font-size: attribute value}

6. Font (font)

Function: Abbreviated attribute, provides a quick way to set all attributes of a font.

Attribute value: font attribute value is the value listed above, and the order of content is font-style; font-variant; font-weight; font-size; line-height; font-family. Some attributes can be omitted, and attribute values are separated by spaces.

Syntax: {font: Attribute Value 1 Attribute Value 2... Attribute Value n}

Let me give you an example: Set the three words "network" to bold font. First, type the three words "network" on the page. Since the font thickness is determined by the attribute "font bold," after entering html editing mode and finding these words, add the codes of "font bold" and its attribute values before and after them, such as: network

After completing the above steps, the three words "network" will be changed from normal font to bold font. If you want to change to another font, just change the font attributes and attribute values in the code.

I mentioned above that the font attribute is a global attribute and that you can quickly set all the attributes of a font. The following example shows you how to define multiple attributes for text. I'm still targeting the three words "networked," only this time it's a 16-point skewed font. The setup steps are similar to above, but the code should be changed to: Networking

After completion, these three words had two attributes at the same time. Compare the two figures below to see the difference before and after the modification.

It should also be noted that although frontpage2000 can also change font size and font type, it does not have the same precise control of fonts as css, such as frontpage2000 can not set font size to 16 points. If you copy the above code directly into the html editing page, it will make the "" symbols become strange characters, so it is better to type them directly in the application.

The above description is how to set the font of some text in the page, but if you want to set the font of the whole or several pages, you must apply the following methods:

When you just want to define the style of the current page, you can use embedded style sheets. An embedded style sheet is a cascading style sheet that is "embedded" within the tags of a web page. Styles in an embedded style sheet can only be used on the same page.

External style sheets can be used when you want to apply the same style consistently across all or some of the pages on your site. Defining styles in one or more external style sheets and linking them to all pages ensures consistency in the appearance of all pages. If you decide to change a style, you only need to make one change in the external style sheet, and that change is reflected on all pages linked to that style sheet. External stylesheets usually have a.css file extension, such as 1.css.

Here is an example of how to set all text on a web page to popular 9-point characters to explain how to use the above two methods.

If you want to set only the current page, you need to use the embedded stylesheet. In this case, just go to the html edit page and add the following code to and:

BODY {FONT-SIZE: 9pt}

TH {FONT-SIZE: 9pt}

TD {FONT-SIZE: 9pt}

The effect can be seen after completion.

If you want several pages to have the same settings applied, use an external style sheet. First, create a new style sheet in frontpage. The specific steps are to click File--New--Web Page in turn, click Style Sheet in the pop-up window, and select Common Style Sheet. Then, type the following code:

BODY {FONT-SIZE: 9pt}

TH {FONT-SIZE: 9pt}

TD {FONT-SIZE: 9pt}

Note: If you copy directly into it, it will generate redundant code.

Save this file in the site directory. When editing a web page, click the Format-Style Sheet link and select the above files in the pop-up window.

Thank you for reading, the above is "how to use css in frontpage2000 to set web page fonts" content, after the study of this article, I believe we have a deeper understanding of how to use css in frontpage2000 to set web page fonts, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report