Simple HTML code doesn't work

Discussing Html . Code , Software , other

Moderators: macek, egami, gesf

amg
New php-forum User
New php-forum User
Posts: 1
Joined: Thu Sep 13, 2012 2:46 am

Simple HTML code doesn't work

Postby amg » Thu Sep 13, 2012 3:23 am

Hi,

I am testing HTML code without any server and it doesn't work. Here is the code:

Code: Select all

<!DOCTYPE html>
<html>
<head>
<title>Home Page</title>
<body>

<h1>My site</h1>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec iaculis posuere justo. Nam vel neque. Proin sagittis mauris sit amet nisl. Sed ipsum. Aliquan vitae
justo.

<h2>Latest projects</h2>
Etiam consectetuer, mauris vitae cursus scelerisque, dui turpis dignissim justo, et eusimod enim odio sit amet erat. Aliquam dui ligula, porttitor eu, facilisis vitae,
ornare sed, tortor.<br><br>
<a href="../Portfolio/index.html">Site Projects</a>

<body>
</html>

Code: Select all


<html>
<head>
<title>Links</title>
<body>

<h1>Latest projects</h1>
<a href="../index.html">Home page</a>

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec iaculis posuere justo. Nam vel neque.

<h2>Project 1</h2>
Etiam consectetuer, mauris vitae cursus scelerisque, dui turpis dignissim justo, et eusimod enim odio sit amet erat.<br><br>
<a href="/images/Project1.jpg">Image project 1</a>
<h2>Project 2</h2>
Etiam consectetuer, mauris vitae cursus scelerisque, dui turpis dignissim justo, et eusimod enim odio sit amet erat.<br><br>
<a href="/images/Project2.jpg">Image project 2</a>
<body>
</html>


When I run the Home Page code in Firefox, I can watch all the information correctly, but when I click on Site Projects link Firefox remains in the same page.

How can I change to the Links page? I have this one in root folder on my computer and the other one in the Protfolio folder also in my computer.

Thanks.

kingsemsem
New php-forum User
New php-forum User
Posts: 1
Joined: Wed Oct 24, 2012 11:23 am

Re: Simple HTML code doesn't work

Postby kingsemsem » Wed Oct 24, 2012 11:31 am

Hello,
its simple code

**************************************************

<html>
<head>
<title>Links</title>
</head>
<body>

<h1>Latest projects</h1>
<a href="../index.html">Home page</a>

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec iaculis posuere justo. Nam vel neque.

<h2>Project 1</h2>
Etiam consectetuer, mauris vitae cursus scelerisque, dui turpis dignissim justo, et eusimod enim odio

sit amet erat.<br><br>
<a href="/images/Project1.jpg">Image project 1</a>
<h2>Project 2</h2>
Etiam consectetuer, mauris vitae cursus scelerisque, dui turpis dignissim justo, et eusimod enim odio

sit amet erat.<br><br>
<a href="/images/Project2.jpg">Image project 2</a>
</body>
</html>
**************************************************************

you forget
1-header end tag </head>
2- back slash in this tag </body>

try this code it will work

johnmacd
New php-forum User
New php-forum User
Posts: 19
Joined: Wed Jun 12, 2013 9:30 pm
Contact:

Re: Simple HTML code doesn't work

Postby johnmacd » Sun Jun 23, 2013 9:39 pm

First check the body tag in your php code. If it is not redirecting then check the path of the file.

aksstgsb
New php-forum User
New php-forum User
Posts: 13
Joined: Fri Dec 13, 2013 3:57 am

Re: Simple HTML code doesn't work

Postby aksstgsb » Fri Dec 13, 2013 4:04 am

Your closing </head> tag in missing in the code. Take a look on it.

User avatar
PreetiGarg
New php-forum User
New php-forum User
Posts: 14
Joined: Fri Dec 28, 2012 2:27 am
Contact:

Re: Simple HTML code doesn't work

Postby PreetiGarg » Tue Jan 14, 2014 11:16 pm

The problem in this code is parh. so correct this path...

omitsolutions
New php-forum User
New php-forum User
Posts: 3
Joined: Thu Jan 16, 2014 8:57 pm
Contact:

Re: Simple HTML code doesn't work

Postby omitsolutions » Thu Jan 16, 2014 9:08 pm

First of all check the body tag. If it is not redirecting then check the path of the file.

User avatar
virinchisoftware
New php-forum User
New php-forum User
Posts: 7
Joined: Fri May 02, 2014 3:29 am
Location: Delhi
Contact:

Re: Simple HTML code doesn't work

Postby virinchisoftware » Fri May 02, 2014 3:49 am

Hi,
First of all you should close head tag before body tag open.
May be your path is wrong.
Once try without .. (double dot).

At last, Close body tag before </html>.

User avatar
WebOutGateway
New php-forum User
New php-forum User
Posts: 59
Joined: Mon Jun 13, 2011 9:25 pm
Location: Pasig City, Philippines
Contact:

Re: Simple HTML code doesn't work

Postby WebOutGateway » Wed Jun 10, 2015 10:44 pm

It shows that your a beginner, Make some practices and find tutorials over the internet will help you a lot.
Anyways regarding to your problems tags is important since it was basic from html you have to check the open and close tags that you construct.
Next recheck the path directory. ../ is advisable to use when your about to call a file out of the folder that your file has been save, if ever you file has been save in the same folder you can just call it by its path without the ../

Hope you get the point in there. You can do it.
Thanks


Return to “HTML Basics”

Who is online

Users browsing this forum: No registered users and 2 guests