The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> LOL Newb question. Please help all mighty masters of HTML!
SkyB0lt
post Oct 8 2006, 01:00 PM
Post #1


Novice
**

Group: Members
Posts: 21
Joined: 27-September 06
Member No.: 253



Ok, well if I can even explain this.. OY I am such a newb.
I am currently going through a LEARN HTML book and am creating a stupid little reminder site for my own reference. So far I have been picking it up quick but now I have hit a snag.

I am trying to use (FRAGMENTING?) links on my page. Example.

At the top of the page.

<P> [
<A HREF="#P" TITLE="P Tag">P Command</A>|
]</P>

And elsewhere on the page I am using the
<A NAME="P"></A>
etc.

This seems to work GREAT!!!

Now I tried to add base elements to the page so I could test quick linking. This didn’t work so well as now none of my HREF="" whatever stuff didn’t work.

So I just added the
<BASE HREF="http://www.cnn.com/">
and then the link that I wanted to work
<A HREF="WORLD/" TITLE="World News" TARGET="_blank"> Cnn world news<br></A>
Followed by
</BASE>


This works just fine, and I could still use the elements.

At this point I thought I was doing great but I then ran the site through a validation service site and this is what it tells me.

Error Line 168 column 32: document type does not allow element "BASE" here.
<BASE HREF="http://www.cnn.com/">
The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

And it also doesn’t like the </BASE>



Any ideas????????????????

Thanks for those who can make sense of my nonsense above!

SHAWN
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
SkyB0lt
post Oct 8 2006, 01:01 PM
Post #2


Novice
**

Group: Members
Posts: 21
Joined: 27-September 06
Member No.: 253



Here is the whole site. Plase understand that I know the img doesnt work because it is on my desktop. Also please dont laugh at the lamness of it for it is nothing more than an excercise for me to learn.




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>
Font Tag
</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<P> [
<A HREF="#P" TITLE="P Tag">P Command</A> |
<A HREF="#H">Hyperlinks</A> |
<A HREF="#F">Fragments</A> |
<A HREF="#Q">Quotes</A> |
<A HREF="#PR">Pre</A> |
<A HREF="#A">Aligning</A> |
<A HREF="#L">Lists</A> |
<A HREF="#F">Fonts</A> |
<A HREF="#NOTE">Note to self</A> |
<A HREF="#IMG">Images</A> |
]</P>

<P>
<A NAME="#P"></A>
<P> This is a test to see if I remember how to build pages.</P>
<P> Here I am going to use the P command so that my line drops 1<BR>
If this worked I should be on the next line down!</P>
<BR>
<BR>
<BR>
<BR>
<P> I put 4 breaks in so I could go down 4 spaces. Also I&nbsp;used
the andnbsp; to keep all of this on the same line </P>
<BR>
<BR>
<BR>
<BR>
<A NAME="Q"></A>
<P> Now it is time to "quote". This can be done by <CODE>""</CODE> from the keyboard
or &quot;typing&quot theandquot; b4 the word and then andquote after.
</P>
<BR>
<BR>
<BR>
<BR>
<P>
<A NAME="PR"></A>
By putting a pre tag in my page I can do whatever
I want without tags. This is cool. Watch
</P>

<PRE>
This
Is
How Stuff
Pre Fun Huh?
Works.
</PRE>
<BR>
<BR>
<BR>
<BR>
<A NAME="A"></A>
<P> Ok, now I have to align some stuff. I am going to do this here.
<P ALIGN="RIGHT"> This should be to the right because I used
The p ALIGN="RIGHT code
</P>
<P ALIGN="JUSTIFY"> This should be justified because I am typed that as the =.
I really dont know the differance though.
</P>
<P ALIGN="CENTER"> This is a test to see if center does anything! Guess it does!
</P>
<BR>
<BR>
<BR>
<BR>
<A NAME="L"></A>
<P> Now on to lists. These can be hard, but here it goes<BR>
There are 3 types of lists<BR>
<OL>
<LI> Ordered Lists
<LI> Definition Lists
<LI> Unordered Lists
</OL>
<P ALIGN="CENTER">
The above is an example of a Ordered list. This is done with
</P>
<P>
OL<BR>
then LI<BR>
Also I can use OL TYPE="I" for roman numerals, "a" for letters, or even
OL START="7" TYPE="1" to start with a higher number or letter.</P>
<P ALIGN="CENTER"> The Definition list looks like this
</P>
<DL>
<DT>One
<DD>For the money
<DT>Two
<DD>For the show
</DL>
<P ALIGN="CENTER"> This is the definition list. <BR>
To do this you will do this<BR>
DT Then the word<BR>
DD The definition.<BR>
</P>

<P ALIGN="CENTER"> The last list type is Undordered Lists.
</P>
<UL>
<LI> TYPE="square"
<LI> TYPE="disc"
<LI> TYPE="circle"
</UL>
<P ALIGN="CENTER"> The Unorderd Lists and the Ordered lists can also go deeper.<BR> Like this.</P>
<UL>
<LI> This will be a disc
<UL>
<LI> This may be a circle or square
</UL>
</UL>
<BR>
<BR>
<BR>
<BR>
<A NAME="F"></A>
<P ALIGN="center">
Now it is time to learn fonts. Fonts are annoying and I hate picking<BR>
one and just usually use the one that a site or program chooses for me.<BR>
</P>
<P> To change a font we type in brackets<BR>
FONT FACE="The font name"</P>
<P ALIGN="center">
We can also devine the size like this
</P>
<P> FONT FACE="TFN SIZE="3" or SIZE="+2"
</P>
<P ALIGN="center">
Not everyone has the the same fonts on their cpu.<BR>
There is a solution however.
</P>
<P> Here is the solution.<BR>
FONT FACE="tfn,tfn,tfn"<BR>
<FONT FACE="chiller">This is chiller<BR></FONT>
<FONT FACE="forte">This is forte.</FONT>
</P>

<P> Simply type <CODE>/font</CODE> in brackets and you good!
<BR>
<BR>
<BR>
<BR>
<P ALIGN="CENTER">
<A NAME="NOTE"></A>
<FONT SIZE="+1">At this point I am going to put some notes as a reminder to myself.<BR>
It is very very important to remember to close tags!<BR>
It also helps to remain organized in your codein.<BR>
If you are not, looking for errors or ohter issues will take longer than you like.
</FONT>
</P>
<BR>
<BR>
<BR>
<BR>
<P>
<A NAME="#H"></A>
</P>
<BASE HREF="http://www.cnn.com/">
<P> Now it is time for hyperlinks! Here I am going to use a base <BR>
<CODE>http://www.cnn.com/.</CODE>
<P>It is right above this text <BR>
and should be closed with <CODE>/BASE</CODE>.</P>
<P> Now I can link to sites right from cnn. like this.<BR>
<A HREF="WORLD/" TITLE="World News" TARGET="_blank"> Cnn world news<br></A>
</BASE>
</P>
<BR>
<BR>
<BR>
<BR>
<A NAME="F"></A>
<P> Now it is time to discuss fragments. Here is an example.<BR>
On the page we will have a <CODE> "A HREF="#AK">AK /A </CODE><BR>
Then someone near else we will have <CODE>A NAME="AK">/A </CODE><BR>
The top code would be visable html and the botom code will be an invisable
link on the page.
</P>
<BR>
<BR>
<BR>
<BR>
<A NAME="IMG"></A>
<P ALIGN="CENTER">
Now it is time to talk about Images. I think.
</P>
<P>
The code would be <CODE>IMG SRC="bla.gif"</CODE><BR> The SRC tag reffers
to the location of the gif on the server.</P>
<P ALIGN="CENTER">
<FONT SIZE="+2">
Example</P></FONT>
<P>
<IMG SRC="C:\Documents and Settings\Shawn\Desktop\Web stuff\152.jpg"><BR>
<BR>
It is also possibe to change the size of the image.<BR>
<CODE>IMG SRC="bla.bla" WIDTH=120 HEIGHT=120></CODE><BR>
<P ALIGN="CENTER">
<FONT SIZE="+2">
Example</P></FONT>
<P>

<IMG SRC="C:\Documents and Settings\Shawn\Desktop\Web stuff\152.jpg" WIDTH=120 HEIGHT=120>
</P>







</BODY>
</HTML>








Thanks,
Shawn
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Oct 8 2006, 01:21 PM
Post #3


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,731
Joined: 9-August 06
Member No.: 6



QUOTE(SkyB0lt @ Oct 8 2006, 08:00 PM) *

Any ideas????????????????


Sure. tongue.gif

You have just been a tad too creative. Firstly, BASE is an empty element. That means it doesn't have any content and no closing tag. IMG is another empty element (yes, it embeds an image in the page but it has no content, i.e. other elements or text). Other elements can't be nested inside BASE. Secondly, BASE goes in the head of the document.
http://www.htmlhelp.com/reference/html40/head/base.html

With me so far? So, even if it's handy to use BASE the way you have, it's not what it's intended for. Most often BASE's href should refer to the document it's in. The purpose being that if I save your page to my hard disk and view it from there, relative links will still work. You can read about other uses at the page in the reference.

While I don't think it's "wrong" to make it point to CNN, it's a little, well, odd. It will cause problems for you too, since you can only have one BASE. smile.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
SkyB0lt
post Oct 8 2006, 01:43 PM
Post #4


Novice
**

Group: Members
Posts: 21
Joined: 27-September 06
Member No.: 253



Pandy, thanks for the advise.

I was using it as an example for myself to learn from only, and cnn was used because its a fast loading easy site.

I thought it was suposed to be in the head of the doc. This presents a problem however.

If I put it in the head of the doc then my
<A HREF="#P" TITLE="P Tag">P Command</A>|
content does not apear to work. This is the problem.

Should I abandon the BASE tag?

Thanks,
Shawn
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Oct 8 2006, 02:12 PM
Post #5


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,731
Joined: 9-August 06
Member No.: 6



QUOTE(SkyB0lt @ Oct 8 2006, 08:43 PM) *

If I put it in the head of the doc then my
<A HREF="#P" TITLE="P Tag">P Command</A>|
content does not apear to work. This is the problem.


Exactly. Neither will other relative URLs pointing to somewhere else on your site. <a href="index.html">HOME</a> will resolve to http://cnn.com/index.html .

QUOTE
Should I abandon the BASE tag?

For this purpose I think you should.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
SkyB0lt
post Oct 8 2006, 02:29 PM
Post #6


Novice
**

Group: Members
Posts: 21
Joined: 27-September 06
Member No.: 253



Well, the PANDY's have it!

consider the BASE removed and stricken from the code!



Thanks for the help!
Shawn
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th April 2024 - 10:34 AM