Drop Down Menu Code - Page 1 - Post...

User 2113283 Photo


Registered User
24 posts

OK. I'm not that great with code. But I managed to make the following work in "preview" mode (Google Chrome). But when I publish to SDrive, the menu doesn't show up.

It's a drop down menu with .png images instead of text and then each image links to its respective page on the site. I've put the code into the Body Html section, and then I tried to put the <head> to the Head Html section, but neither works.

What am I doing wrong?

<html>
<head>
<style>
body{font-family:lucida sans console;}
table{font-size:80%;background:white}
a{color:black;text-decoration:none;font:bold}
a:hover{color:#FFFFFF}
td.menu{background:white}
table.menu
{
font-size:100%;
position:absolute;
visibility:hidden;
}
</style>
<script type="text/javascript">
function showmenu(elmnt)
{
document.getElementById(elmnt).style.visibility="visible";
}
function hidemenu(elmnt)
{
document.getElementById(elmnt).style.visibility="hidden";
}
</script>
</head>

<body>
<table width="100%">
<tr bgcolor="#FFFFFF">
<td onmouseover="showmenu('Graphic Design')" onmouseout="hidemenu('Graphic Design')">
<img src="C:\Users\Anji\Documents\ATLEENHOUTS WEBSITE FILES\textgraphicdesign.png"><br />
<table class="menu" id="Graphic Design" width="120">
<tr><td class="menu"><a href="C:\Users\Anji\Documents\ATLEENHOUTS_website\LogoDesign.html"><img src="C:\Users\Anji\Documents\ATLEENHOUTS WEBSITE FILES\textlogodesign.png"></td></tr>
<tr><td class="menu"><a href="C:\Users\Anji\Documents\ATLEENHOUTS_website\WebDesign.html"><img src="C:\Users\Anji\Documents\ATLEENHOUTS WEBSITE FILES\textwebdesign.png"></td></tr>
</table>
</td>
<td onmouseover="showmenu('Photography')" onmouseout="hidemenu('Photography')">
<img src="C:\Users\Anji\Documents\ATLEENHOUTS WEBSITE FILES\textphotography.png"><br />
<table class="menu" id="Photography" width="120">
<tr><td class="menu"><a href="C:\Users\Anji\Documents\ATLEENHOUTS_website\PhotographyEnvironment.html"><img src="C:\Users\Anji\Documents\ATLEENHOUTS WEBSITE FILES\textenvironment.png"></td></tr>
<tr><td class="menu"><a href="C:\Users\Anji\Documents\ATLEENHOUTS_website\PhotographyInteraction.html"><img src="C:\Users\Anji\Documents\ATLEENHOUTS WEBSITE FILES\textinteraction.png"></td></tr>
<tr><td class="menu"><a href="C:\Users\Anji\Documents\ATLEENHOUTS_website\PhotographyConceptual.html"><img src="C:\Users\Anji\Documents\ATLEENHOUTS WEBSITE FILES\textconceptual.png"></td></tr>
</table>
</td>
<td onmouseover="showmenu('Writing')" onmouseout="hidemenu('Writing')">
<img src="C:\Users\Anji\Documents\ATLEENHOUTS WEBSITE FILES\textwriting.png"><br />
<table class="menu" id="Writing" width="120">
<tr><td class="menu"><a href="C:\Users\Anji\Documents\ATLEENHOUTS_website\WritingEssays.html"><img src="C:\Users\Anji\Documents\ATLEENHOUTS WEBSITE FILES\textessays.png"></td></tr>
<tr><td class="menu"><a href="C:\Users\Anji\Documents\ATLEENHOUTS_website\WritingArticlesl.html"><img src="C:\Users\Anji\Documents\ATLEENHOUTS WEBSITE FILES\textarticles.png"></td></tr>
<tr><td class="menu"><a href="C:\Users\Anji\Documents\ATLEENHOUTS_website\WritingCreative.html"><img src="C:\Users\Anji\Documents\ATLEENHOUTS WEBSITE FILES\textcreative.png"></td></tr>
</table>
</td>
</tr>
</table>
</body>

</html>


ATLEENHOUTS
User 103173 Photo


VP of Software Development
0 posts

All of your links are wrong. They are pointing to a local file path:

"C:\Users\Anji\Documents\ATLEENHOUTS_website\WritingEssays.html

This is the same thing that happened with that <div> you made with images. Those images were also pointing to a local file path.
Learn the essentials with these quick tips for Responsive Site Designer, Responsive Email Designer, Foundation Framer, and the new Bootstrap Builder. You'll be making awesome, code-free responsive websites and newsletters like a boss.
User 2113283 Photo


Registered User
24 posts

Hi Scott,
So what is the <a href> supposed to be? I can't link the Icon to its respective page in VSD using the Link button. I've never had to do this before - y'know, belly flopping into the great blue yonder - so I'm definitely not sure what the links are supposed to be. I can't link to a URL cause none of my images have a URL... and same goes for the links to the pages themselves. Do I 'add file' with every singles image to the server and then use that file path as the url?
ATLEENHOUTS
User 364143 Photo


Guest
5,410 posts

<a href> is an html tag that creates links on a web page.
CoffeeCup... Yeah, they are the best!
User 2028484 Photo


Registered User
94 posts

http://www.htmlcodetutorial.com/linking/_A.html

http://www.w3schools.com/tags/att_a_href.asp

Your links seem to be pointing to your hard drive. You need your links to point to where your images are located on your server, or in this case - sdrive. I don’t use sdrive but it should be pretty straight forward. Let’s say that your images for the menu are located in a folder named ‘menu’. The menu folder is also located in a separate folder named ‘images’ (where all of your sites images are kept). Now lets say you have an image of a ball (ball.png) on your menu. An example of how the link would look would be;

http://anji.coffeecup.com/images/menu/ball.png

(assuming your sdrive is called ‘Anji’). You should be able to visit that URL (http://anji.coffeecup.com/images/menu/ball.png) and see just a picture of the ball. Hope that helps :)


You do not need a parachute to skydive. You only need a parachute to skydive twice.
User 2113283 Photo


Registered User
24 posts

Ah Angel, you truly live up to your name!

That's what I was lookin' for. So all those a href tags need to point to the specific file on the server itself and not in my hard drive. So, what I would need to do is add files, upload to s drive, then copy paste the url at the top for each of those files. Correctomundo?

so it would look like http://atleenhouts.coffeecup.com/images … graphy.png
and so on for every sort of image on my site, including the pages http://......../photography.html ?

And so, do I need to organize my files according to page or can I just upload everything that I use under the root folder?
ATLEENHOUTS
User 364143 Photo


Guest
5,410 posts

You can organize your site as you wish as long as the paths are correct when referencing files and links. It helps to organize things though. Links can be relative or absolute.

Absolute = http://www.mysite.com/forums/file.php

Relative = /forums/file.php
CoffeeCup... Yeah, they are the best!
User 2113283 Photo


Registered User
24 posts

Thanks guys for all your input. I've got the basic structure up and running: http://atleenhouts.coffeecup.com :D
ATLEENHOUTS
User 462238 Photo


Registered User
144 posts

Before u get to far into it, you might want to use a page width of 960px or so....Looking at your link, a scroll ball is needed to view the full width if a favorites bar is open....960px or there abouts comfortably positions in most monitors. Check it out before getting too deep in your structure and having to change everything

J
User 2113283 Photo


Registered User
24 posts

oh ok i'll think about that. i use chrome so it fits nicely on my screen 1280px. i just might do that cause there is a lot of white empty space isn't there! thanks j
ATLEENHOUTS

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.