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 call css from div in html page

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces the "html page how to call css" related knowledge, editor through the actual case to show you the operation process, the method of operation is simple and fast, practical, I hope that this "html page how to call css" article can help you solve the problem.

1. First, we create a new Html file in the development tool and name it test.html. The code after successful creation is as follows:

How to call css from div in html page

two。 Add a tag to the created code, and add a class class tag to the tag. The name of the class tag is defined as ceshi; code as follows:

How do I call div in the html page? how do I call css in the div in the css html page?

3. Create a new css file in the same project, name it test.css, and save the file in the css folder in the project. Write the css style of div in the html page using the ceshi class name. Set the font size to 30px and the font color to blue. The code is as follows:

@ charset "utf-8"; .ceshi {font-size: 30px; color: blue;}

4. In the test.html file, load the external css file using the link tag and add the path to the css file in the href property. The code is as follows:

How do I call div in the html page? how do I call css in the div in the css html page?

5. We save all the files and click run in the development tool.

This is the end of the introduction on "how div calls css in the html page". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

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

Development

Wechat

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

12
Report