I am having trouble linking my HTML pages together. My code is below.
I have anchored the links the best way I know how to, but when I put them in HTML format and click on the hyperlink, it tells me the file cannot be found.
I have three pages I need to link together, and before I test it out, I put them all in one folder on my desktop and try to pull them up and I run into that error.
Here is my code. For ease of access, they are divided by headers of INDEX, SERVICES, and CONTACT. However, they are three separate html files.
<!DOCTYPE html>
<html lang=“en”>
<head>
<title>Trillium Media Design</title>
<meta charset=“utf-8”>
</head>
<body>
<header>
<h1>Trillium Media Design</h1>
</header>
<nav>
<b> <a href=“index.html”>Home</a>
<a href=“services.html”>Services</a>
<a href=“contact.html”>Contact</a>
</b>
</nav>
<main>
<h2>New Media and Web Design</h2>
<p>Trillium Media Design offers a comprehensive range of services to take your company's Web presence to the next level.</p>
<h3>Meeting Your Business Needs</h3>
<p>Our expert designers will listen to you as they create a website that helps to promote and grow your business.</p>
<footer>
<small><i>Copyright © 2018 Michael Vitucci</i></small></footer>
</body>
</html>
SERVICES
<!DOCTYPE html>
<html lang=“en”>
<head>
<title>Trillium Media Design-Services</title>
<meta charset=“utf-8”>
</head>
<body>
<header>
<h1>Trillium Media Design</h1>
</header>
<nav>
<b> <a href=“index.html”>Home</a>
<a href=“services.html”>Services</a>
<a href=“contact.html”>Contact</a>
</b>
</nav>
<main>
<h2>Our Services Meet Your Business Needs</h2>
<dl>
<dt><strong>Website Design></strong></dt>
<dd>Whether your needs are large or small, Trillium can get you on the Web!</dd>
<dt>strong>E-Commerce Solutions</strong></dt>
<dd>Trillium offers quick entry into the e-commerce marketplace.</dd>
<dt><strong>Search Engine Optimization</strong></dt>
<dd>Most people find new sites using search engines. Trillium can get your website noticed.</dd>
</dl>
<footer>
<small><i>Copyright © 2018 Michael Vitucci</i></small></footer>
</body>
</html>
CONTACT
<!DOCTYPE html>
<html lang=“en”>
<head>
<title>Trillium Media Design-Contact</title>
<meta charset=“utf-8”>
</head>
<body>
<header>
<h1>Trillium Media Design</h1>
</header>
<nav>
<b><a href=“index”>Home</a>
<a href=“services”>Services</a>
<a href=“contact”>Contact</a>
</b>
</nav>
<main>
<h2>Contact Trillium Media Design Today</h2>
<ul>
<li>E-Mail:
<a href=“mailto:contact#trilliummediadesign.com”>contact#trilliummediadesign.com</a>
</li>
<li>Phone: 555-555-5555</li>
</ul>
<footer>
<small><i>Copyright © 2018 Michael Vitucci</i></small></footer>
</body>
</html>
NEW CODE taken from browser source of Index page.
<!DOCTYPE html>
<html lang=“en”>
<head>
<title>Trillium Media Design</title>
<meta charset=“utf-8”>
</head>
<body>
<header>
<h1>Trillium Media Design</h1>
</header>
<nav>
<b> Home
Services
Contact
</b>
</nav>
<main>
<h2>New Media and Web Design</h2>
<p>Trillium Media Design offers a comprehensive range of services to take your company's Web presence to the next level.</p>
<h3>Meeting Your Business Needs</h3>
<p>Our expert designers will listen to you as they create a website that helps to promote and grow your business.</p>
<footer>
<small><i>Copyright © 2018 Hannah Markel</i></small></footer>
</body>
</html>
This is the browser URL I get from the Index page.
file:///C:/Users/Michael%20Vitucci/Desktop/michaeltest/michaelindex.html
This is the browser URL I get from the error page.
file:///C:/Users/Michael%20Vitucci/Desktop/michaeltest/index.html
You are using typographic quotation marks, while you should use double quotes (and this applies to all attributes). For example, instead of: Home.
check all these files are in the same directory as index.html?, else you have to mention relative path from the directory where these files are kept and if they are in same directory still issue try like "./services.html"
<b> Home
Services
Contact
</b>
Have you tried adding the whole address?
Home
Are these files are on the same level, i.e is index.html and about.html placed in same folder if they are placed in the same folder you can directly access that file via "./about.html" from index.html file, if the files are placed in different folders at the same level, then you need to go up one level i.e "../about/about.html";
p.s to avoid any typos you can use tools like emmet for HTML, and to avoid path mismatch issues you can use extensions like path Intellisense.
(Emmet and path Intellisense are extensions available in vs code).
Related
Image is not showing in browser using the image tag where am i wrong?
i want to add image in web and i am unable to do it using in visual code i don't know where from image to be added in the URL of image so anyone guide.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign up </title>
</head>
<body>
<div class="Header">
<a href="/" class="LogoWrapper" >
<img src="D:\my-angular-projects\signup-form\src\image\Snap.jpg" alt="Scone O'Clock logo" />
</a>
<p class="Strap">Scones: the most resplendent of snacks </p>
</div>
<div class="IntroWrapper">
<p class="IntroText">
Occasionally maligned and misunderstood; the scone is a quintessentially British classic.
</p>
<div class="MoneyShot">
<img class="MoneyShotImg" src="D:\my-angular-projects\signup-form\src\image\1555932407.jpg" alt="Incredible scones" />
<p class="ImageCaption">Incredible scones, picture from Wikipedia</p>
</div>
</div>
<p>Recipe and serving suggestions follow.</p>
<div class="Ingredients">
<h3 class="SubHeader">
Ingredients</h3>
<ul>
</ul>
</div>
<div class="HowToMake">
<h3 class="SubHeader">Method</h3>
<ol class="MethodWrapper">
</ol>
</div>
</body>
</html>
the problem is that your file retrieves the image based on where the html file is somewhere and it does not check the entire computer hard drive.
So if you want the problem fixed you can start from the html files location basically. So if your html file is in the src folder your img tag shall be
<img src="image/1555932407.jpg">
else if you have your html file in the signup-form folder i shall work with this
<img src="src/image/1555932407.jpg">
Hopefully you found this useful otherwise just comment this post.
Visual Studio Code automatically retrieves files from the root directory, so it lists all of the files for you - making it easier to implement images and other stuff. It's one of the main reasons I use VSCode.
The image location depends on where your HTML file is. Use forward slashes when specifying folders/files, and use ../ to go up a directory.
I am using Sublime text to write some HTML and CSS files. I've created my index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta -->
<meta charset="UTF-8" />
<title>RainyDayBakes</title>
<!-- Styles -->
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h1 style="text-align:center">RainyDayBakes</h1>
<nav style="text-align:center">
<a href=”C:\Users\sarah\Documents\Simmons\CS-321\page1.html”> About </a>
<a href=”page2.html”> Menu </a>
<a href=”page3.html”> Gallery </a>
<a href=”page4.html”> Order </a>
<a href=”page5.html”> Contact Us </a>
</nav>
<img src="cake.png" alt="oreo crumble cake" class="center">
<h3>Welcome to RainyDayBakes!</h3>
<p>We are a local bakery specializing in creative cakes, cupcakes and cookies!</p>
<p>In addition to being open daily we also offer custom ordered confections.</p>
<!-- Scripts -->
<script src="scripts/index.js"></script>
</body>
<footer>
</footer>
</html>
my page1.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>This is Page One </title>
</head>
<body>
</body>
<footer>
</footer>
</html>
and my style.css:
<style>
h1 {
color:red;
}
</style>
When I try to run index.html in Chrome, the link to page1.html says it doesn't exist, and the CSS won't show up. They're all in the same folder, I've saved all the files, and I'm running on Chrome. Every other solution I've found refers to making a typo, the directories being different, etc. but as said, they're all in the same folder, and I haven't noticed a typo (but it's entirely possible when you're too close to your code).
First off, you're not even using the tag anywhere in your code, so that's why the style isn't showing up. Secondly, if they are in the same folder, just link your about page to page1.html; not the full directory listings.
You are using typographical quotes in your links' href attributes, which won't work. Change those to regular quotes.
Let the link be this way instead href=”page1.html”
You might want to put a link to your CSS file on all your pages, I don't see it on your page1.html You probably already know about this resource but I mention it just in case you don't: W3 Schools is very handy for a quick reference to a lot of HTML/CSS questions.
So you have two issues:
For page1.html, would suggest adding file:// or file:/// to the beginning of the href element, or maybe retyping the line since the other links worked
For your CSS, remove the tag, it's for when you put the style inside the HTML file(embedded)
This isn't an issue with your code. I was having the same exact problem too and i recently discovered that the problem likely lies in the IDE that you're using. I was using stackblitz and recived the same output. But when i switched to an online compiler and litteraly copy & pasted the code with the same file names, the code started working correctly. Try using an online compiler and see how that works out for you. It worked for me.
The compiler I used is:
https://www.onlinegdb.com/
make sure to switch the languate to HTML using the language dropdown on the top right corner.
I am trying to run my web site off my own server using this: http://fragments.turtlemeat.com/javawebserver.php.
While everything works great when I run my website locally and when I ran it on a real server, I cannot get the CSS to load while I run it through my own server.
Here is my HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta content="text/html: charset=utf-8" http-equiv="Content-Type"/>
<title>AddictingJava</title>
<link rel="stylesheet" href="CSS/default.css" type="text/css" />
</head>
<body>
<header>
</header>
<!-- Navigation Start -->
<section class="Nav">
<section class="Logo">
<nav class="HomeLogo">
</nav>
</section>
<ul>
<li><nav class="GamesButton">
</li>
</nav>
<li><nav class="ProfileButton">
</li>
</nav>
<li><nav class="ForumsButton">
<ul id="DropNav">
<li>General Discussion</li>
<li>Contact Us</li>
</ul>
</li>
</nav>
<li><nav class="NewsButton">
</li>
</nav>
</ul>
</section>
<nav class="Download">
Get Client
</nav>
<!-- Navigation End -->
<section class="AboutSite">
<article>
<p>AddictingJava is a site dedicated to bringing you a unique experience with minI game sites. We hope to get user feedback as we grow and make the site a very fun place to visit overall. Although it doesn't seem like this site has very much we are currently planning a lot for it, so be sure to check back regularly to see when we update the site.<br><br>
If you wish to download our client click here or the Get Client button above.
</article>
</section>
<section class="RecentNews">
<figure class="TopRecentNewsPicture">
<img src="websitepics/newnewspic.png">
</figure>
<article class="TopRecentNews">
<h5>7/7/2014 - Announcment.</h5>
<p>Read all about things we are working on as of today.</p>
</article>
<figure class="MidRecentNewsPicture">
<img src="websitepics/newgamepic.png">
</figure>
<article class="MidRecentNews">
<h5>7/7/2014 - Client added.</h5>
<p>The AddictingJava Client was added.</p>
</article>
<figure class="BotRecentNewsPicture">
<img src="websitepics/newnewspic.png">
</figure>
<article class="BotRecentNews">
<h5>3/14/2014 - Website created!!!!</h5>
<p>The begining of everything.</p>
</article>
</section>
<section class="footer">
<p>© 2014 AddictingJava, Inc. All rights reserved. </p>
</section>
</body>
</html>
Check to see that your file path is correct to your css file.
This link tag
<link rel="stylesheet" href="CSS/default.css" type="text/css" />
assumes there is an uppercase CSS folder in the same folder as javawebserver.php.
if it is at the root it would be
/javawebserver.php
/CSS/default.css
Make sure your css-folder is renamed in uppercase. On a local machine (windows file systems) a reference to "css", "CSS" or even "cSs" is a reference to the same folder. So if your folder is named in lowercase the link would work on your local machine.
Linux/UNIX file systems on the other hand are case sensitive so on an Apache web server the link would only work if the folder or file is referenced with the correct upper/lowercase.
I’m just trying to insert an html absolute link to my texteditor on Mac and I get this on the browser url:
file:///Users/yasser/Desktop/211Website/Labs/https://delicious.com/jodi.reed/browsers...
and file not found in Firefox or Chrome or Safari. When I delete the path before the http the page opens fine...
The code is below-
<!DOCTYPE html>
<html>
<!-- Lab2 Yasser Abdelhalim -->
<head> <meta charset="UTF-8">
<title> Lab2 Yasser Abdelhalim </title>
</head>
<body>
<h1> Yasser’s Web Development resources </h1> this is description for heading number one
<div>
<h2> Background </h2>
<ul>
<li><a href=“delicious.com/jodi.reed/browsers”>link</a></li>
<li><a href=“delicious.com/jodi.reed/browsers”>link</a></li>
<li><a href=“delicious.com/jodi.reed/browsers”>link</a></li>
</ul>
<h2> Web programing </h2>
<ul>
</div>
</body>
</html>
I think (without seeing anything else) you just need to add the initial part of your URLs, as your ocmputer is thinking they're local, relative files (in the same directory as the file with this code in).
Try using this code:
<!DOCTYPE html>
<html> <!-- Lab2 Yasser Abdelhalim -->
<head>
<meta charset="UTF-8">
<title>Lab2 Yasser Abdelhalim</title>
</head>
<body>
<h1>Yasser’s Web Development resources</h1> this is description for heading number one
<div>
<h2>Background</h2>
<ul>
<li>
link
</li>
<li>
link
</li>
<li>
link
</li>
</ul>
</div>
</body>
</html>
Try typing the full address in here, including speech marks (double quotes).. sometimes when copying and pasting URLs it copies the formatted speech marks from some fontstyles.
Apache is the webserver that runs on Linux, it pretty much is a foundation or base of every website around (with some exceptions).
Are you using Windows or Mac? You would be better to be working in a proper web server environment (I can explain)
Here is the code:
<html>
<head>
<title> ATS Business and Games - Home </title>
<link rel="stylesheet" type="text/css" href="formatting.css"/">
<meta name= "description" content="This page has our rules along with links to our external and internal download pages.">
<meta name="keywords" content="ATS ats business and games video tutorials video videos tutorial minecraft">
</head>
<!-------------------------------------------------------------------------------------------------------------------------------->
<body>
<a href="http://atsbusinessandgames.co.cc">
<div class="toper" align="top">
<p style="color:white"> ATS Business and Games <img align="right"
src="http://atsbusinessandgames.co.cc/pictures/business-logo-small-with-tag-line.GIF" alt="ATS Business and Games Logo with tag line"
width=115px height=100px> </p>
</div>
</a>
<!-------------------------------------------------------------------------------------------------------------------------------->
<div class="navt">
<p style="text-align:center;color:white"> Home
</div>
<!-------------------------------------------------------------------------------------------------------------------------------->
<p> <span><b><font size="5" color="black"><h1>Rules for Downloads</h1></b></font>
<font size="4" color="black">Please note that this section is here to protect both us and you.
Proceeding to any download page beyond this assumes that you have read and understood all these rules.
If you have any questions then you may contact us (the link can be found at the bottom of every page).
<!-------------------------------------------------------------------------------------------------------------------------------->
<div class="bottom" align="bottom">
<p style="text-align:center;color:white"> Copyright (C) 2011
<a href="mailto:info#atsbusinessandgames.co.cc?subject=Information Request&body=What information would you like. We will try and get to you as soon
as possible!%0A%0A">Contact Us</a> </p>
</div>
</body>
</html>
So you can see how the formatting looks here is the link to the page:
http://www.atsbusinessandgames.co.cc/Downloads
and here is what the formatting of the page should look like:
http://www.atsbusinessandgames.co.cc/
Can someone please tell me how I can fix the formatting?
Note: I am working on the page so the body code may look a little different (as in more paragraphs). If I make any major changes I'll post them here otherwise right click then left click on view source.
You should refer to ../formatting.css instead of formatting.css in the Downloads part.
Also, there is a " at the end which shouldn't be there, but I don't think it's a problem for any browsers
<link rel="stylesheet" type="text/css" href="../formatting.css"/>