If you really want to have the HTML for your links in just one place, I would recommend to dig in a server-side programming language.
Let´s say you have four different (static, no server-side programming) HTML files, like page1.html
for your home page, page2.html
, page3.html
and page4.html
.
So, because the file names remain constant you could place the same HTML markup for your links in all four HTML files. Now you should use CSS to style the links the way you like. This CSS goes into another file, `styles.css' , for example.
Example HTML for page1.html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page 1</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- this is the reference to your css -->
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Page 1</h1>
<ul class="navigation">
<li><a href="page2.html">Page 2</a></li>
<li><a href="page3.html">Page 3</a></li>
<li><a href="page4.html">Page 4</a></li>
</ul>
</body>
</html>
Example HTML for page2.html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page 2</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- this is the reference to your css -->
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Page 2</h1>
<ul class="navigation">
<li><a href="page1.html">Page 1</a></li>
<li><a href="page3.html">Page 3</a></li>
<li><a href="page4.html">Page 4</a></li>
</ul>
<!--
here comes the content you will change daily
-->
</body>
</html>
Example CSS for styles.css
.navigation {
padding-left: 0;
list-style: none;
margin-left: -5px;
}
.navigation > li {
display: inline-block;
padding-left: 5px;
padding-right: 5px;
}
By the way, index.html
would be a better name for your home page, so you can reach the file with a URL like http://www.yourDomain.com
and don´t have to place the file name in the URL like http://www.yourDomain.com/page1.html
.
Now you have the same HTML markup for your links in your four HTML files. That means any time you have to change the HTML of your links, you have to do the same changes in all HTML files. But you have the code which is responsible for the layout in just one place.
Because you just want to change the content of the three pages daily, this approach seems reasonable to me.