简体   繁体   中英

PHP file in Twitter Bootstrap?

I want to develop a site with Bootstrap css.

Because I will have some form that connect to the database, so I will make some of my file in HTML and the rest in PHP.

But the problem is that Bootstrap is only compatible in .HTML file.

So how I can do this? How to make it possible?

You can use HTML inside a PHP file just as if it was only a HTML file. You can place your

PHP is server side code meaning the server hosting the .php file interprets what code is within the tags and then displays the entire page to the browser just as any HTML page or similar depending on what your script does. The browser doesn't handle any PHP.

So to use bootstrap within a php page you could do something like this:

<?php
$example = 'example';
?>
<html>
<head>
<title>PHP in HTML Example</title>
<script src="js/bootstrap.min.js"></script>
<link rel='stylesheet' type='text/css' href='css/bootstrap.min.css'>
</head>
<body>
<h1>Short code <?=$example;?></h1>
</body>
</html>

只需在文本编辑器中使用另存为 ,并将html文件另存为.php即可

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM