-
January 3rd, 2012, 04:22 AM
#1
quick easy question
i have this simple code:
Code:
<html>
<head>
<title>menu mockup</title>
<style type="text/css">
.show {display: none; }
.hide:focus + .show {display: inline; }
.hide:focus { display: none; }
.hide:focus ~ #list { display:none; }
@media print { .hide, .show { display: none; } }
</style>
</head>
<body>
<p>Here's a list</p>
<div>
<a href="#" class="hide">[hide]</a>
<a href="#" class="show">[show]</a>
<ol id="list">
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
</ol>
</div>
</body>
</html>
It shows the expanded version and 'hide' link as default. I can't seem to get it to reverse this - show collapsed version with 'show' link as default.
Anyone??
Thanks and Blessings
"In most gardens they make the beds too soft - so that the flowers are always asleep" - Tiger Lily
-
January 3rd, 2012, 06:13 AM
#2
Not sure if you're trying to not use javascripts intentionally but, if not, you may find these links useful.
http://www.murraytestsite.com/collapsiblelist.htm#
For pure CSS check out:
http://www.thecssninja.com/css/css-tree-menu
"Do you know why the system is slow?" they ask
"It's probably something to do with..." I look up today's excuse ".. clock speed"
-BOFH
-
January 3rd, 2012, 05:38 PM
#3
Nothing against JS per se. I just hate the grey button look that I have never been able to change and have it look right cross-browser.
Im not even trying to do this to display lists, I just used them for the example.
I want to display the first few lines of essays, and have a <see more> botton that stays in place at the bottom whether expanded or collapsed.
I haven't used CSS since 2.1 and Im real rusty.
The code I posted is great, its just the wrong default mode and no tampering that Ive done has fixed it.
"In most gardens they make the beds too soft - so that the flowers are always asleep" - Tiger Lily
Similar Threads
-
By DerekK in forum Network Security Discussions
Replies: 4
Last Post: September 10th, 2004, 10:35 PM
-
By Zelfaldor in forum AntiOnline's General Chit Chat
Replies: 6
Last Post: January 26th, 2004, 04:50 AM
-
By Obliterate in forum Newbie Security Questions
Replies: 16
Last Post: August 26th, 2002, 10:44 AM
-
By Black-Mage21 in forum AntiOnline's General Chit Chat
Replies: 7
Last Post: August 19th, 2002, 02:43 AM
-
By lewzer in forum Newbie Security Questions
Replies: 3
Last Post: August 7th, 2002, 03:07 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|