How can we solve the problem of uniform headers and referencing different css codes? -Php Tutorial
Source: Internet
Author: User
When creating a website page, the header is always made into a uniform part, and then introduced on different pages. However, different pages may have their own different styles, different js, and of course different & amp; lt; title & amp; gt; and other information. These general parts are changed because of these differences... when you create a website page, the header part is always unified and then introduced on different pages. However, different pages may have their own different styles, different js, and of course different . <Br/> How do we solve these differences? <Br/> I can think of two solutions <br/> + judgment in the header <br/> + fine-grained header, which is only a common part, for the rest, let the pages be written by yourself. </P> reply content: <p> when creating a website page, the header is always made into a uniform part and then introduced on different pages. However, different pages may have their own different styles, different js, and of course different <title> and other information. <Br/> How do we solve these differences? <Br/> I can think of two solutions <br/> + judgment in the header <br/> + fine-grained header, which is only a common part, for the rest, let the pages be written by yourself. </P> <p class = "answer fmt" data-id = "1020000000354342"> <p> On the page on which the header needs to be referenced: </p> <pre> <code class = "lang-php"> <? Php $ page_title = 'default page name'; $ page_css = ''; $ page_script =''; require_once ('header. php');?> </Code> </pre> <p> header. php: </p> <pre> <code class = "lang-php"> <peader> <title> <? = $ Page_title?>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service