+ 3

HTML

How to create multiple html files for an multiple page website

14th Jan 2025, 1:22 AM
darius franklin
darius franklin - avatar
10 RĂ©ponses
+ 3
yes, if you want to do it in Sololearn, make a single page app instead. Hiding and showing sections is not hard.
14th Jan 2025, 9:18 AM
Bob_Li
Bob_Li - avatar
+ 2
you can't do this in Sololearn. your codes can't access each other here.
14th Jan 2025, 2:49 AM
Bob_Li
Bob_Li - avatar
+ 2
Then how can I do it?
14th Jan 2025, 3:50 AM
darius franklin
darius franklin - avatar
+ 2
On your home computer, you can put all the Web pages files into a folder and/or link to them. https://www.sololearn.com/discuss/1724138/?ref=app https://www.sololearn.com/discuss/1689338/?ref=app
14th Jan 2025, 8:44 AM
Ausgrindtube
Ausgrindtube - avatar
+ 2
Just like it with <a href=""></a>
15th Jan 2025, 5:28 AM
The creator Of Camsord
The creator Of Camsord - avatar
+ 2
You use <a> anchor tags to link between your HTML files. Often inside a <nav> section at the top of each page. For the "href" attribute of <a>, you typically use relative file paths for local files instead of absolute file paths. 👉 Absolute file path example "https://www.mysite.com/images/pets.jpg" 👉 Relative file path rules 1) leading slash - start at local root directory 2) leading single dot - start at current directory (where file you are working with is stored) 3) leading double period - start at parent folder of current directory 4) no leading slash or dots - same as rule #2 5) from starting folder, separate folders with slashes to go down directory tree 6) you can chain double dots to go further up directory tree a) example "../../sample.txt" - access a text file 2 directories up from current directory 👉 Relative file path examples "/css/common.css" "../videos/game.ogg" "next_page.html" "./third_page.html" 👉 Same relative path rules used for "href"/"src" in <link> and <script>
15th Jan 2025, 7:05 AM
Shardis Wolfe
+ 2
To create multiple HTML files for a multi-page website, follow these steps: 1. **Plan Your Website Structure**: Decide on the layout and structure of your website. Identify the pages you need, such as Home, About, Contact, Services, etc. 2. **Create Individual HTML Files**: For each page, create a separate HTML file. You can name them according to their purpose, such as: - `index.html` (for the Home page) - `about.html` (for the About page) - `contact.html` (for the Contact page) - `services.html` (for the Services page) 3. **Write Basic HTML Template**: Each HTML file should have a basic template. Here’s an example: ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Page Title</title> <!-- Change title for each page --> <link rel="stylesheet" href="styles.css"> <!-- Link to your CSS file --> </head> <body> <header> <nav> <ul> <li><a href="index.html">Home</a></li> <li><a href="about.html">About</a></li> <li><a href="services.html">Services</a></li> <li><a href="contact.html">Contact</a></li> </ul> </nav> </header> <main> <h1>Welcome to My Website</h1> <!-- Change content for each page --> </main> <footer> <p>&copy; 2023 My Website</p> </footer> </body> </html> ``` 4. **Customize Each Page**: Modify the content within the `<main>` section and the `<title>` of each HTML file to reflect the specific content for that page. 5. **Link Your Pages**: Ensure that the navigation links in each HTML file point to the appropriate files, enabling users to navigate your website easily. 6. **Create a CSS File**: (Optional but recommended) Create a `styles.css` file to style your website’s layout and design. 7. **Test Your Website**: Open each HTML file in a web browser
15th Jan 2025, 4:25 PM
Jesse innocent ojie
+ 2
Jesse innocent ojie if you're using an A.I. answer, it's appropriate to say so. See here: https://www.sololearn.com/discuss/3021159/?ref=app
15th Jan 2025, 6:04 PM
Ausgrindtube
Ausgrindtube - avatar
+ 1
[16/1, 07.27] .: import requests import pandas as pd from bs4 import BeautifulSoup th = “https://www.jobs.id/lowongan-kerja?kata-kunci=part time” halaman = requests.get(th) hasil = BeautifulSoup(halaman.content, ‘html.parser’) lowkers = hasil.find_all(class_=”single-job-ads”) posisi = [] instansi = [] gaji = [] for p in lowkers: t1 = p.select(“h3”) t2 = t1[0].select(“a”) posisi.append(t2[0].get_text()) t1 = p.select(“p”) t2 = t1[0].select(“a”) [16/1, 07.28] .: try: instansi.append(t2[0].get_text()) except: instansi.append(“-”) t2 = t1[1].select(“span”) try: gaji.append(t2[1].get_text()) except: gaji.append(t2[0].get_text()) print(posisi) print(instansi) print(gaji)
16th Jan 2025, 12:52 AM
Alfin Pratama mianto
Alfin Pratama mianto - avatar