www.webdeveloper.com
Results 1 to 7 of 7

Thread: drop-down menu strictly css?

Hybrid View

  1. #1
    Join Date
    Sep 2011
    Posts
    3

    Smile drop-down menu strictly css?

    Is it possible to create a drop-down menu strictly in CSS? I cannot find a site that demonstrates this.

  2. #2
    Join Date
    Sep 2011
    Posts
    2
    Yes it is totally possible. I have supplied a demonstration link below:
    http://jsfiddle.net/ndRhj/

    You have my permission to copy this code and adapt it according to your needs.

    (I would suggest adding javascript to extend the functionality of the dropdown to be used by clicks/taps so that tablet users are not ill-effected. Because in its current state the dropdown relies entirely on the :hover event.)

  3. #3
    Join Date
    Sep 2011
    Posts
    3

    eliminate HTML?

    John,

    Thank you.
    But is there a way to eliminate HTML?

  4. #4
    Join Date
    Sep 2011
    Posts
    2
    No. CSS is used to style markup. It's a dependent language, CSS by itself won't render anything.

  5. #5
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,105
    Code:
    But is there a way to eliminate HTML?
    Where are you going with this? Why in the world would you want to eliminate the HTML?
    I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!

  6. #6
    Join Date
    Sep 2011
    Posts
    3

    resolved

    If the drop down menu was only integrated within CSS, I would not have to update each individual (20+pages) of code. For instance, I have a drop-down menu (js, css, html files) and when I want to make a change, I have to change each instance of the drop down menu HTML-wise.

    Any advice?

  7. #7
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,105
    You'll want to use a server side include for global content.

    Ex:

    Code:
    <?php
       include('menu.php');
       <p>content on the rest of your page</p>
    ?>
    menu.php would contain your global content.
    I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles