473,406 Members | 2,894 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,406 software developers and data experts.

The elusive hover and <p>

I am having trouble with hover and <p>.
I have reduced the problem to this:

Given a HTML-page like this:
<body>

<a>Number1</a>

<div id="content">

<a>Number2</a>

<p class="nav">

<a>Pnav1</a<a>Pnav2</a>

</p>

<div class="nav">

<a>DIVnav1</a<a>DIVnav22</a>

</div>

<br />

</div>

<a>Number3</a>

</body>
And a CSS like this:

a {font-size: 0.9em;}

a:link {color: red ; text-decoration: none;}

a:visited {color: gray; text-decoration: none;}

a:hover {color: red ; background-color: black; text-decoration: underline;}

a:active {color: red; text-transform: uppercase ; text-decoration:
underline;}

..nav a:hover {color: yellow ; background-color: black; text-decoration:
underline;}

..nav a {font-size:2em font: 1.3em "Trebuchet MS", verdana,
sans-serif;text-decoration: none;text-transform: uppercase;padding: 5px;

margin: 0px 10px;border-style:solid;border-width: 1px;border-color:#542F17;}

p {font-family: Verdana, Arial, sans-serif;font-size: 0.9em;}

/*p:hover {}*/

If I run this page and move the mouse over the text no hovering effect
occurs.

If I uncomment the last line in the CSS it works.

Can someone please explain what I dont grasp?

/k


Oct 31 '08 #1
2 1294
your anchors do not have an href specification (link), so none of the psuedo
(:) properties work.

-- bruce (sqlwork.com)
"kurt sune" wrote:
I am having trouble with hover and <p>.
I have reduced the problem to this:

Given a HTML-page like this:
<body>

<a>Number1</a>

<div id="content">

<a>Number2</a>

<p class="nav">

<a>Pnav1</a<a>Pnav2</a>

</p>

<div class="nav">

<a>DIVnav1</a<a>DIVnav22</a>

</div>

<br />

</div>

<a>Number3</a>

</body>
And a CSS like this:

a {font-size: 0.9em;}

a:link {color: red ; text-decoration: none;}

a:visited {color: gray; text-decoration: none;}

a:hover {color: red ; background-color: black; text-decoration: underline;}

a:active {color: red; text-transform: uppercase ; text-decoration:
underline;}

..nav a:hover {color: yellow ; background-color: black; text-decoration:
underline;}

..nav a {font-size:2em font: 1.3em "Trebuchet MS", verdana,
sans-serif;text-decoration: none;text-transform: uppercase;padding: 5px;

margin: 0px 10px;border-style:solid;border-width: 1px;border-color:#542F17;}

p {font-family: Verdana, Arial, sans-serif;font-size: 0.9em;}

/*p:hover {}*/

If I run this page and move the mouse over the text no hovering effect
occurs.

If I uncomment the last line in the CSS it works.

Can someone please explain what I dont grasp?

/k


Oct 31 '08 #2
Thanks, you are right about that.

But why does the inclusion of "p:hover {}"
triggers the hover-action on a <a>-tag that lacks the href?

/k

"bruce barker" <br*********@discussions.microsoft.comwrote in message
news:2A**********************************@microsof t.com...
your anchors do not have an href specification (link), so none of the
psuedo
(:) properties work.

-- bruce (sqlwork.com)


Nov 3 '08 #3

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

Similar topics

2
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are...
2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
6
by: Alan J. Flavell | last post by:
The page under discussion was http://ppewww.ph.gla.ac.uk/~flavell/www/html-smac.html An email correspondent referred to the link text "screenshot" in part 2, which in his case was coming at the...
6
by: mike | last post by:
I wonder if someone would be kind enough to enlighten me about the use of the > character in a stylesheet. E.g. li:hover > ul {display: block;} I think I know what the > achieves by looking at...
1
by: RJN | last post by:
Hi I'm using XMLTextReader to parse the contents of XML. I have issues when the xml content itself has some special characters like & ,> etc. <CompanyName>Johnson & Jhonson</CompanyName>...
1
by: JezB | last post by:
I'm binding a DataGrid web-control to data fetched from a database. However some of my data fields contain text that is within <...> characters - I notice that everything between the <> is...
1
by: RJN | last post by:
Hi I'm using XMLTextReader to parse the contents of XML. I have issues when the xml content itself has some special characters like & ,> etc. <CompanyName>Johnson & Jhonson</CompanyName>...
1
by: mike | last post by:
I've got some code like this: gametype_id = Request.Form("gametype_id") response.write "<br>gametype_id from form>" & gametype_id & "<" response.write "<br>gametype_id from database>" &...
3
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
14
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that the...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.