HOME | DD

Vayde — CSS Drop+Fly

Published: 2008-08-15 20:47:12 +0000 UTC; Views: 1797; Favourites: 22; Downloads: 134
Redirect to original
Description So here's a drop and fly menu for people to use in their journals. The CSS, initially less than 20 lines long has become substatially bloated thanks to dA not allowing the use of the child selector . So I apologise for the chunk of code in advance.

I allowed for up to 4 fly menus, which should hopefully be more than enough, even for the social butterflies who like a link to every aspect of their lives!

Live version: here .

Click download to get the code as a .html file. I recommend opening it in notepad++ which is a good simple code editing program. The code is neatly organised with comments - however, here's some stuff:

  • This is free to use and edit by anyone on dA as long as you credit me somehow.

  • You will need to remove the comments and whitespace from the html for your actual journal (I use this ).

  • If you are confident with XHTML and CSS and want to create a submenu that I haven't provided an example for in the live version then here are some tips to help you:

    • Remember to use .drop and .fly for each drop and fly menu respectively.

    • Place the last item in .menu within .bfix.

    • Place the highest list element within .bfix - If this element is also a fly menu, put it in .bfix2 aswell - if you have some border issues then it is probably because you forgot to do this!

  • Will not work in Internet Explorer. (Tested in Mozilla Firefox v3.0.1.). Valid CSS 2.1 and XHTML 1.0 Transitional. You need to be a dA subscriber to use CSS in your journal.
Related content
Comments: 11

SkinnedRat [2008-08-18 03:48:54 +0000 UTC]

"Will not work in Internet Explorer"

And I'm not surprised. I just spent 2 weeks of my life trying to get drop downs working cross platform for a website I'm working on... (I'm not a front end developer)

Nice work Looks good

👍: 0 ⏩: 1

Vayde In reply to SkinnedRat [2008-09-01 10:22:01 +0000 UTC]

I thought I replied to this! lol oops

Thanks man

👍: 0 ⏩: 1

SkinnedRat In reply to Vayde [2008-09-01 10:23:32 +0000 UTC]

No worries, I haven't been very diligent with my messages lately either ;D

👍: 0 ⏩: 0

foundsoundfunny [2008-08-17 16:05:01 +0000 UTC]

Not bad, though it could be done without the extra div tags

👍: 0 ⏩: 1

Vayde In reply to foundsoundfunny [2008-08-17 17:06:34 +0000 UTC]

You mean the border fixes? Yeah that was a bit messy of me, but I had such a nice condensed version with the child selectors that after dA said "no" I kinda abandoned all reason lol

If you wanna trim it down that'd be awesome!

👍: 0 ⏩: 1

foundsoundfunny In reply to Vayde [2008-08-17 23:36:06 +0000 UTC]

I wrote a tutorial on making these a while ago - [link] - basically you just manipulate the fact you can target each 'layer' as you go down the tree, if something you applied to a list item above conflicts with something below, you just cancel the property.

The section on horizontal menus is currently incomplete, but you'll still be able to see how I did without the extra divs. In the end, y'know, it doesn't really matter, since most people will code up the list once and they wont have to bother with it again, but we should strive to keep things clean

For an external resource on CSS hover menus, try checking out 'suckerfish' dropdowns @ htmldog.com - that's where I originally learnt how to do it.

Oh, and technically, I wouldn't say it only works in Firefox, even if you haven't tested it in any other browser IE should be the only one giving you problems. Opera and Safari etc should handle it much like Firefox

Anyhow. It's really cool to have another active member of our little CSS community here contributing resources, so keep it up. (I learnt something about child selectors I didn't know before too! )

👍: 0 ⏩: 1

Vayde In reply to foundsoundfunny [2008-08-18 00:03:43 +0000 UTC]

Haha nice I should have checked to see if you'd done something like that! I was just thinking about how to do one and lists seemed like a good plan

I like the cancelling the property as you go down approach too I didn't think of that! I am really only just starting out with these CSS experiments so do forgive my untidiness!

That page on selectors is really interesting there's all kinda of bizarre things like + signs and the[] thingy lol I don't remember the technical terms off the top of my head. I think I stumbled across it when I was browsing code somewhere and did a search to see what it was, quite handy really!

Oh and I shall amend the bit about Firefox!

👍: 0 ⏩: 0

cybergranny [2008-08-17 08:02:23 +0000 UTC]

Thanks for it ^^
I don't think that I need that but thanks for sharing it

👍: 0 ⏩: 1

Vayde In reply to cybergranny [2008-08-17 14:48:06 +0000 UTC]

No problemo, I gotta keep busy somehow

👍: 0 ⏩: 1

cybergranny In reply to Vayde [2008-08-17 15:25:42 +0000 UTC]

hehehhehhe

👍: 0 ⏩: 0

CallsTheDogHamburger [2008-08-16 03:11:45 +0000 UTC]

Awesome.

👍: 0 ⏩: 0