A
A
Alexander Timofeev2015-10-13 08:02:19
css
Alexander Timofeev, 2015-10-13 08:02:19

What tools are there to set the header and footer for all pages in one file during layout?

What tools are there to set the header and footer for all pages in one file during layout?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Denis Ineshin, 2015-10-13
@aldtimofeev

1. Building on the server from different files
2. Using SSI
3. Using project build systems like Grunt / Gulp (preferred)

C
Cat Anton, 2015-10-13
@27cm

You can use HTML import , but you need to know a little about JavaScript: https://learn.javascript.ru/link-import

M
Magzhan Birgebayuly, 2015-10-13
@henhanshi

If you use only html , there is one "so-so" way:
index.html

<!doctype html>
<html lang='ru' ><body>
  <div id='header' >
    <a href='/' >Главная</a>
    <a href='/page1.html' target='niframe' >Страница 1</a>
    <a href='/page2.html' target='niframe' >Страница 2</a>
  </div>
  <iframe name='niframe' ></iframe>
  <div id='footer' >...</div>
</body></html>

When you click on the link "Page 1/2", these pages will open inside the iframe
And so then - install some better CMS-ku. For example ModX, create a template:
<!doctype html>
<html lang='ru' ><body>
  <div id='header' >
    <a href='/' >Главная</a>
    <a href='/page1.html' >Страница 1</a>
    <a href='/page2.html' >Страница 2</a>
  </div>
  
  <div id='footer' >...</div>
</body></html>

and all pages that will use this template, the content will be located together

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question