•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 456,506 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,649 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 10055 | Replies: 34
![]() |
| |
•
•
Join Date: Aug 2004
Posts: 22
Reputation:
Rep Power: 5
Solved Threads: 0
I'm creating a dynamic dropdown menu for my website. All information will be stored in a database. None of the images will have names on them. Ex: Home, Software, Support, ... These names will be found in a database along with their sub-menus, the drop downs. I have the whole thing created, statically, right now. Once I'm done with the static version I'm going to cut it all up and turn it into ASP.NET classes and such so that all data populated on each page will be generated dynamically from a database.
*** See attached screen shot
Wow... Now to my question which is probably very simple but I'm pretty green when it comes to HTML, Java Script, and CSS. My menus are extremely small gifs and I want to place a layer on top the image with the name of that button. Ex: Home, Software, Support, Contact Us, ... What is the easiest way to accomplish this and if I could get a simple example I would greatly appreciate it.
As always, thanks in advance.
- Eric
*** See attached screen shot
Wow... Now to my question which is probably very simple but I'm pretty green when it comes to HTML, Java Script, and CSS. My menus are extremely small gifs and I want to place a layer on top the image with the name of that button. Ex: Home, Software, Support, Contact Us, ... What is the easiest way to accomplish this and if I could get a simple example I would greatly appreciate it.
As always, thanks in advance.
- Eric
for your second query it sounds like you might be better off using a css background for the image. I've used a span for the example below, but it applies whether you use divs, a list, tables, etc.
<span style="background: url(background.gif) left no-repeat;"><a href="#">link text</a></span>
<span style="background: url(background.gif) left no-repeat;"><a href="#">link text</a></span>
•
•
Join Date: Aug 2004
Posts: 22
Reputation:
Rep Power: 5
Solved Threads: 0
Could you hold my hand for just a second? I cut and pasted your code snippet and replaced my image tag with your span tag. See attachment for new screen shot. The image no longer displays. Could you please assist?
Original Code:
Newly Edited Code:
Again, thanks in advance
- Eric
Original Code:
<TD colSpan="2"><A onmouseover="MenuOver(this,'home')" onmouseout="MenuOut(this,'home')" href="http://www.derivetech.us/"><IMG src="images/btn_default.gif" border="0" name="home_Img"></A>
Newly Edited Code:
<TD colSpan="2"><A onmouseover="MenuOver(this,'home')" onmouseout="MenuOut(this,'home')" href="http://www.derivetech.us/"><span style="background: url("images/btn_default.gif") name="home_Img" left no-repeat;"><a href="#">Home</a></span></A>Again, thanks in advance
- Eric
<span style="background: url("images/btn_default.gif") left no-repeat;" name="home_Img">
The name thing shouldn't be in your style declaration.
Also do you need this name thing? I assume it's related to a javascript funtion?
The name thing shouldn't be in your style declaration.
Also do you need this name thing? I assume it's related to a javascript funtion?
can you describe the rollover effect you want to create?
check out my menu things: www.webdevfaqs.com/css.php and scroll down to the menu examples.
I'm currently writing a simple tutorial set on css/divs/basic web design with css, but it's not finished yet. I can show you what's there and write the rest quickly if you like?
check out my menu things: www.webdevfaqs.com/css.php and scroll down to the menu examples.
I'm currently writing a simple tutorial set on css/divs/basic web design with css, but it's not finished yet. I can show you what's there and write the rest quickly if you like?
•
•
Join Date: Aug 2004
Posts: 22
Reputation:
Rep Power: 5
Solved Threads: 0
I pass objects to move my images around. I send the name of the object to my JS function and then, simply put, I set the scr = new image path. It works very smooth and uses very little java script code. I would think that the SPAN would work as long as I can name the SPAN object.
The rollover effect:
Static label which is the name of the button: Home, Software, Products, Contact Us, ...
Under this label I would like to have an image which has a rollover event and click event.
The rollover event replaces the image with a new image and the click event would take you to the desired page.
Hope this helps.
- Eric
The rollover effect:
Static label which is the name of the button: Home, Software, Products, Contact Us, ...
Under this label I would like to have an image which has a rollover event and click event.
The rollover event replaces the image with a new image and the click event would take you to the desired page.
Hope this helps.
- Eric
in that case what I would suggest is using css menu hovers.
if we assume your menu code is all within a div classed as menu.
In the head section of your document:
<style type="text/css">
<!--
.menu a {
background: #ffffff url(background_norm.jpg) left no-repeat;
}
.menu a:hover {
background: #ffffff url(background_hover.jpg) left no-repeat;
}
.menu a:active {
background: #ffffff url(background_active.jpg) left no-repeat;
}
-->
</style>
you might also want to use display: block and set widths and heights on all of those:
.menu a {
background: #ffffff url(background_norm.jpg) left no-repeat;
display: block;
height: 20px;
width: 150px;
}
Does that help at all? You can also set names on the a tags.
if we assume your menu code is all within a div classed as menu.
In the head section of your document:
<style type="text/css">
<!--
.menu a {
background: #ffffff url(background_norm.jpg) left no-repeat;
}
.menu a:hover {
background: #ffffff url(background_hover.jpg) left no-repeat;
}
.menu a:active {
background: #ffffff url(background_active.jpg) left no-repeat;
}
-->
</style>
you might also want to use display: block and set widths and heights on all of those:
.menu a {
background: #ffffff url(background_norm.jpg) left no-repeat;
display: block;
height: 20px;
width: 150px;
}
Does that help at all? You can also set names on the a tags.
•
•
Join Date: Aug 2004
Posts: 22
Reputation:
Rep Power: 5
Solved Threads: 0
Wow... I did not know you could do that with CSS. How would I make the call from the body to the STYLE section?
Are the CSS tags platform independent? A few years ago I produced a website for a client and all of the menus were coded using layers in JavaScript. I had a very painful experience with the cross platform issue.
- Eric
Are the CSS tags platform independent? A few years ago I produced a website for a client and all of the menus were coded using layers in JavaScript. I had a very painful experience with the cross platform issue.
- Eric
![]() |
•
•
•
•
•
•
•
•
DaniWeb HTML and CSS Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- dynamic menu using ruby (Ruby)
Other Threads in the HTML and CSS Forum
- Previous Thread: Layout in CSS
- Next Thread: using animated footage in a web site


Hybrid Mode