';" statement can be called."/> ';" statement can be called.">

Home  >  Article  >  Backend Development  >  How to call css in php

How to call css in php

青灯夜游
青灯夜游Original
2021-05-17 17:57:225549browse

Method: First write the css style code in a ".css" file; then in the PHP file, use "echo '3f0de7bd94c8392047914ec29980d92b';" statement can be called.

How to call css in php

The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer

PHP scripts can also call css styles Yes, we can use the echo statement to call the CSS style

First write the css style code in a ".css" file, such as theme.css; then use the following statement to call it

<?php
echo ‘<link rel=\"stylesheet\" type=\"text/css\" href=\"theme.css\" />&#39;;
?>

Benefits of calling css style sheets from outside the php page:

  • The web page processing speed will be faster, especially when there are many web pages sharing a CSS style sheet. ! Because you don’t have to write the same CSS code for every page, the web page will naturally be slimmer and lighter.

  • It can prevent some users with low computer skills from directly seeing CSS syntax (that is, some people don’t like to be seen). Of course, it means that they cannot see it directly, not that they cannot see it. As you can see, with a little bit of skill, it’s really easy to view the content of a CSS file.

  • Of course it is easy to maintain! As long as you modify one CSS file, no matter if you have thousands of web page files, your latest modified version will prevail!

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to call css in php. 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