473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Problem with CSS Mouseover

Hello,

I want to design a mouseover text using the following example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="de">
<head>
<title>Infobox</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
<!--
#box a {
color:#ffffff;
background:#b3b06c;
font:bold 16px verdana, sans-serif;
text-decoration:none;
display:block;
width:150px;
padding:5px;
border:1px solid black;}

#box a:hover {
color:black;
background:#ddd8b7;}

#box a span {display:none;}

#box a:hover span {
position:absolute; top:10px; right:10px; z-index:3;
display:block;
width:300px;
color:black;
background:#ffffff;
font:normal 16px courier, sans-serif;
border:1px solid black;
padding:10px;}
-->
</style>
</head>
<body>

<div id="box"><a href="#">INFOBOX<span>Lorem ipsum dolor sit
amet.</span></a></div>

</body>
</html>

As you see the text in the span-tag is hidden (display:none) until the
mouseover (hover) effect is called.

This works fine, also in IE.
My problem is now, that if I am using a <a>-tag in the <span>-tag,
everything after the <a>-tag is _NOT_ hidden with display:none.

A simple example using the same css-definitions would be:

<div id="box"><a href="#">INFOBOX<span>Lorem ipsum <a
href="something">dolor</asit amet.</span></a></div>
I think it is because I cannot use a <a>-tag inside an <a>-tag.

So do you know any other solutions to solve this problem?

Regards,

Martin
Sep 24 '06 #1
1 2705
Martin Pöpping wrote:
I want to design a mouseover text using the following example:
You should have posted the URL, and you should have considered whether you
really have an HTML problem or something else.
<div id="box"><a href="#">INFOBOX<span>Lorem ipsum dolor sit
amet.</span></a></div>
- -
As you see the text in the span-tag is hidden (display:none) until the
mouseover (hover) effect is called.
You forgot the usual CSS caveats. When CSS is off - e.g., when a search
engine robot analyzes you document, the content is
INFOBOXLorem ipsum dolor sit amet.
(without a space after the "X").
This works fine, also in IE.
For some values of "works". By the way, when the user clicks on the link
text, he jumps to the start of the document. This doesn't match my value for
"works".
My problem is now, that if I am using a <a>-tag in the <span>-tag,
everything after the <a>-tag is _NOT_ hidden with display:none.
That would be invalid markup, so why would you use it?

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Sep 24 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jim Buzbee | last post by:
I have a subroutine that inserts image objects into a page for me. It works fine except for one thing. My mouseover settings don't appear to take. i.e. I see nothing at all when I move the mouse...
3
by: richk | last post by:
For some reason when I add additional buttons a 3rd button and beyond i cant get the effect to work and I get errors...I cant understand why... <SCRIPT LANGUAGE = "javascript"><!-- if...
3
by: VK | last post by:
To PointedEars with my deep respect. Author ;-) There were a question a while ago about events. Now I see that my original explanation was not full. Check this sample out: <html> <head>...
2
by: Alex | last post by:
On my page I have a lot string like this: <span onmouseover="callMe(this)" onmouseout="callMe(null)" >abc1</span> <span onmouseover="callMe(this)" onmouseout="callMe(null)" >abc2</span> <span...
4
by: ericjiii | last post by:
Hi. A friend of mine asked me if I could look at one of his java scripts in order to get it working. Unfortunately I am stumped and was wondeirng if somebody with a bit more experience than myself...
1
by: dave345 | last post by:
This javascript issue is in an app using C# / .Net 2.0 running on XP. First post, please mention if I mess up any conventions of this forum. I’ve got a mouseover event that only works properly...
1
by: Oltmans | last post by:
Hi, I've been using LIs (<li>) and using Sortables (docs.jquery.com/UI/ Sortables/sortabl) to sort the LIs. I've attached a mouseover function with each LI. Problem (in IE 6 & 7) is that...
1
by: Sunny | last post by:
Hi, IE7 has a zoom feature.(In IE7, If you look at lower Right Corner, there is a button that let you set the zoom level of ur webpage. the default is 100%.) The problem is I am drawing vml...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.