SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member flannel jesus's Avatar
    Join Date
    Nov 2012
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Expanding Hidden Content

    I am making a website, and on the front page is a list of books:

    book1
    book2
    book3

    etc.

    I want for the user to click the Book1 box, for example, and have a previously hidden chapters list fold downward, so that after the click the page appears like this:

    Book1
    ch1
    ch2
    ch3
    Book2
    Book3

    Is this doable with only html and css? What html elements would I use? Lists, like a navigation menu? And what would the css look like?
    It's most important to answer what html element should I use, as I will be structuring the page first and styling it later.

  2. #2
    SitePoint Evangelist Tapan's Avatar
    Join Date
    May 2005
    Location
    India
    Posts
    564
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I think you're looking for this:

    http://www.hongkiat.com/blog/css-content-accordion/
    Demo: http://media02.hongkiat.com/css-base...l#vertservices

    Just get rid of the styles or keep them and it will achieve what you have asked for.

    Hope it helps.

    Thanks.

  3. #3
    SitePoint Member flannel jesus's Avatar
    Join Date
    Nov 2012
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Tapan ;
    Yes, I think that that was what I was looking for.

    Now I have a new problem, when I right-click in Explorer, "create new txt file" isn't an option...
    Probably from installing Notepad++

    Thanks for that link

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,221
    Mentioned
    457 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by flannel jesus View Post
    when I right-click in Explorer, "create new txt file" isn't an option...
    Why do you want to do that? There's prolly a better option.

  5. #5
    SitePoint Member flannel jesus's Avatar
    Join Date
    Nov 2012
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want to do that so I can create a new txt file in whichever folder I'm in quickly. I don't know of any faster way. Do you?

    btw by "explorer" I mean "windows explorer," not "internet explorer". Don't know if that was clear.

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,221
    Mentioned
    457 Post(s)
    Tagged
    8 Thread(s)
    O, I see (I did think you meant IE!). Because I have my simple .txt program set up to do code, I also had a similar problem (although on a Mac). I just created a blank .txt file that always sits on my desktop, and when I want a new one, I just Option/click to duplicate it and drag it where I want. Very simple.

  7. #7
    SitePoint Member flannel jesus's Avatar
    Join Date
    Nov 2012
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I did actually solve my problem after making that post. I had to edit some registry values to do it.

    Incidentally, the reason I needed to make .txt files was to then turn them into .html or .css files (more types later I'm sure), but in fact the registry edits I made to make .txt available again I then used to make "new .html document" available from the right-click menu as well. So, now I can just right-click in whichever folder I want to create an html file in, and make it on the spot! CSS as well.

  8. #8
    SitePoint Member flannel jesus's Avatar
    Join Date
    Nov 2012
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For the record, Tapan, I ended up using the guide and it works beautifully. I styled it in a much different way, of course, and I was able to achieve exactly what I had visualized before making this thread (well, almost exactly -- Mac Firefox renders it a bit weird...).

  9. #9
    SitePoint Evangelist Tapan's Avatar
    Join Date
    May 2005
    Location
    India
    Posts
    564
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi

    Are you using a proper doctype ?

    Thanks.


Bookmarks

Posting Permissions

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