Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reuse HTML with css

If I want to resuse a part of the HTML along with the associated css, whats the best way to do this?

like image 424
Hector Barbossa Avatar asked Mar 08 '26 09:03

Hector Barbossa


2 Answers

User a server-side language like PHP to generate the HTML.

like image 129
Emil Ivanov Avatar answered Mar 11 '26 07:03

Emil Ivanov


You may want to create a sort of template right? you may have to use a server-side language like PHP to do it.

You may need to create some files like: header.php, body.php and footer.php

and an index.php file would work like this:

<?php
     require "header.php";
     require "body.php";
     require "footer.php";
¿>
like image 27
Alfrekjv Avatar answered Mar 11 '26 08:03

Alfrekjv



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!