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

DIV element buttons - how do you set rollover effects correctly?

The applicable CSS is as follows:
______________________________________
div.BUD
{
background-color: maroon;
color: beige;
border: 3px outset;
text-align: center;
margin: 9px;
width: 138px;
font-style:normal; font-variant:normal; font-weight:bold; font-size:12pt;
font-family:trebuchet, sans-serif
}
div.BUD a
{
TEXT-DECORATION: none;
background-color: maroon;
color: beige;
}
div.BUD a:hover
{
width: 138px;
color: lavender;
background-color: darkorchid;
border-style:inset;
}
______________________________________
Applicable HTML:

<DIV class="BUD">
<a href="publishing-tools">Publisher Tools</a>
</DIV>
<DIV class="BUD">
<a href="software">Software Index</a>
</DIV>
______________________________________
The inset & colour change does not apply to the entire DIV instead of just
to the hyperlink itself. See www.geoceanis.com for this little catastrophe!
:^)

So, I'm a little baffled as to how I managed to stuff this up. What is the
difference between code that highlights only the link within the DIV
element, and code that highlights the entire DIV element...?

Thanks in advance...

--
Timothy Casey GPEMC! >11950 is the nu****@fieldcraft.biz 2email
Terms & conditions apply. See www.fieldcraft.biz/GPEMC
Discover valid interoperable web menus, IE security, TSR Control,
& the most advanced speed reading application @ www.fieldcraft.biz
Aug 2 '06 #1
4 6497

Number 11950 - GPEMC! Replace number with 11950 wrote:
The inset & colour change does not apply to the entire DIV instead of just
to the hyperlink itself. See www.geoceanis.com for this little catastrophe!
Haven't hacked on your example myself, but the usual fix is to set
a { width: 100% }
Couple of other comments:

- Don't mess with anything with a:hover except for colours. Anything
involving fonts, sizes, positions etc. can cause an annoying jump when
you move over the link.

- I'd use <lirather than <div>. You've got a related set of them,
it's a list.

Aug 2 '06 #2
"Andy Dingley" <di*****@codesmiths.comwrote in message
news:11**********************@75g2000cwc.googlegro ups.com...
>
Number 11950 - GPEMC! Replace number with 11950 wrote:
The inset & colour change does not apply to the entire DIV instead of
just
to the hyperlink itself. See www.geoceanis.com for this little
catastrophe!
>
Haven't hacked on your example myself, but the usual fix is to set
a { width: 100% }
The user agent just won't listen. For some reason, this line is being
ignored. Also tried:

a, a:hover { width: 100% } [no effect]
a:hover { width: 100% } [no effect]

I've also tried placing these lines before then after the "div.BUD" +
"div.BUD a" + "div.BUD a:hover" specifications, and I have tried placing the
"width: 100%;" line within the "div.BUD a" + "div.BUD a:hover"
specifications - all without effect.

It stands to reason that the width should not be ignored especially when it
is not flagged for non-conformance - am I misunderstanding the CSS
specification? I'm combining this with the HTML 4.0 Strict DTD to ensure
that the fixed branding & web menus when they go in, will function
correctly - could this be complicating matters?
Couple of other comments:

- Don't mess with anything with a:hover except for colours. Anything
involving fonts, sizes, positions etc. can cause an annoying jump when
you move over the link.
Ya don't say! :^) - a tiny little jump I've seen used to make the button
appear to pop out as the mouse hovers over it, but some of the web menus
I've messed with in the past have been very jumpy...
>
- I'd use <lirather than <div>. You've got a related set of them,
it's a list.
Using <DIV>s for vertical sidebar & <SPAN>s for horizontal toolbar - I've
seen the use of list elements for this before - can list elements be set to
equidistant spacing on the same line like a <SPANelement?

Thanks in advance...

--
Timothy Casey GPEMC! >11950 is the nu****@fieldcraft.biz 2email
Terms & conditions apply. See www.fieldcraft.biz/GPEMC
Discover valid interoperable web menus, IE security, TSR Control,
& the most advanced speed reading application @ www.fieldcraft.biz
Aug 3 '06 #3

"Andy Dingley" <di*****@codesmiths.comwrote in message
news:11**********************@75g2000cwc.googlegro ups.com...
>
Number 11950 - GPEMC! Replace number with 11950 wrote:
The inset & colour change does not apply to the entire DIV instead of
just
to the hyperlink itself. See www.geoceanis.com for this little
catastrophe!
>
Haven't hacked on your example myself, but the usual fix is to set
a { width: 100% }
[SNIP]

Tried setting
a { display: block; }

this seems to do the trick...

What is the significance of setting

-a { display: block; }
OR
a { display: block; }
OR
+a { display: block; }

???

I've seen this use of "+" & "-" in certain stylesheets but haven't a clue as
to intended function...

Thanks in advance...

--
Timothy Casey GPEMC! >11950 is the nu****@fieldcraft.biz 2email
Terms & conditions apply. See www.fieldcraft.biz/GPEMC
Discover valid interoperable web menus, IE security, TSR Control,
& the most advanced speed reading application @ www.fieldcraft.biz

Aug 3 '06 #4
Number 11950 - GPEMC! Replace number with 11950 wrote:
"Andy Dingley" <di*****@codesmiths.comwrote in message
news:11**********************@75g2000cwc.googlegro ups.com...

Number 11950 - GPEMC! Replace number with 11950 wrote:
The inset & colour change does not apply to the entire DIV instead of
just
to the hyperlink itself. See www.geoceanis.com for this little
catastrophe!

Haven't hacked on your example myself, but the usual fix is to set
a { width: 100% }
[SNIP]

Tried setting
a { display: block; }

this seems to do the trick...

What is the significance of setting

-a { display: block; }
OR
a { display: block; }
OR
+a { display: block; }
I've had the same problem, it took me a while to discover how useful
"display" can be:
block: separate entity, line break before and after
inline: part of a paragraph or whatever, no auto-line breaks
none: hide the element entirely, great if you like rich-clients (pop-up
menus, etc).

display:none has important differences from visibility:hidden. Found a
good, brief, working explanation here:
http://www.devx.com/tips/Tip/13638

hth
???

I've seen this use of "+" & "-" in certain stylesheets but haven't a clue as
to intended function...

Thanks in advance...

--
Timothy Casey GPEMC! >11950 is the nu****@fieldcraft.biz 2email
Terms & conditions apply. See www.fieldcraft.biz/GPEMC
Discover valid interoperable web menus, IE security, TSR Control,
& the most advanced speed reading application @ www.fieldcraft.biz
Aug 3 '06 #5

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

Similar topics

5
by: Brian Angliss | last post by:
I'm relatively new to scripting in JavaScript, so I'm not too surprised I'm having difficulty scripting up an animation effect for my personal site. What I'm trying to do is the following: When...
1
by: Max Biancofiore | last post by:
I am working on a new website. Please, can everybody go to www.intheloop.org.uk\sw5\index.html and tell me: 1) How long do the buttons take to download (please, also state connection speed)?...
1
by: Dave | last post by:
Hi all, I was trying to make an image submit button with a rollover and discovered to my suprise that there is no way to access a form element of the "image" type. I tried specifying it by name...
47
by: Lauren Quantrell | last post by:
I have constructed the following code that simulates the common rollover effect when moving the mouse over a label (this example makes the label bold.) I'm wondering if anyone has come up with...
2
by: Blake | last post by:
Can someone point me to a good article or online tutorial or sample app that explains how to create rollover effects *without* using JavaScript to swap out images? Thanks!
6
by: AJBopp | last post by:
I'm wrestling with CSS variations between Firefox and IE. I'm trying to create rollover buttons in a menu frame. It is working perfectly in Firefox but in IE only the first button is properly...
3
by: laredotornado | last post by:
Hi, Can anyone recommend a good site that has example of css designed buttons with roll over states? I want to make nice "Save" and "Cancel" buttons but would prefer not to use Photoshop when...
2
by: eholz1 | last post by:
Hello CSS and StyleSheet members, I have decided to move away from Dreamweaver javascript rollover buttons, in favor of a CSS type rollover button. (hope that is ok). I plan to use PHP to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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...
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
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,...

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.