Home  >  Article  >  Web Front-end  >  How to modify the font size of td element in table with css

How to modify the font size of td element in table with css

WBOY
WBOYOriginal
2021-12-01 18:07:2510227browse

In CSS, you can use the "font-size" attribute to modify the font size of the td element in the table. The function of this attribute is to set the font size of the element. You only need to add "font-size:" to the td element: Font size value;" style is enough.

How to modify the font size of td element in table with css

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

How to modify the font size of the td element in the table in css

In css, you can use the font-size attribute to set the size of the table text . The following example explains how to set the font size in the table with css.

The example is as follows:

1. Create a new html file, named test.html, to explain how to set the font size in the table with css. Create a form for testing. Set the class attribute of the table tag to lone.

How to modify the font size of td element in table with css

2. In the css tag, define the style of the table through class and define its width as 250px. Use the font-size attribute to set the size of the table text to 30px.

How to modify the font size of td element in table with css

Open the test.html file in the browser to check the effect.

How to modify the font size of td element in table with css

Summary:

1. Create a table and set the class attribute of the table tag to lone.

2. In the css tag, define the style of the table through class and define its width as 250px.

3. In the css tag, use the font-size attribute to set the size of the table text to 30px.

4. Open the test.html file in the browser to check the effect.

(Learning video sharing: css video tutorial)

The above is the detailed content of How to modify the font size of td element in table with css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn