Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] See more – see less CSS-Html problem

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #204547
    fredtheted
    Participant

    I’m trying to add coding in my HTML so that only the first 9 lines of text are shown unless the surfer clicks on “See more”.

    I’m retired but still trying to help a friend update his website. Can some kind person look at this page http://www.go-there.co.uk/attractions/a-blank.phtml and scroll down to the two boxes and tell me where I’ve gone wrong.

    The top one works fine but I need each box to be independent of the other. Is there a way around this?

    Please note that I don’t have access to the <head> so some JS is out of the question.

    Thanks.

    #204550
    Paulie_D
    Member

    It’s because both labels are linked to the same checkbox

    <label for="post-1" class="read-more-trigger"></label>
    

    Make the second one

    <label for="post-2" class="read-more-trigger"></label>
    

    I see from a previous thread you have a lot of these…well that’s the downside of the “checkbox hack”.

    Javascript / Jquery just does this so much easier.

    #204552
    Shikkediel
    Participant

    It could also be a lot more compact than what I initially posted in the other thread, without the need for a line of script for each clickable item…

    #204553
    fredtheted
    Participant

    A big thank you to Paulie_D and Shikkediel who have helped me make this work. Just one more question before closing (but not sure if you’ll know the answer) and that is ‘when I produce a separate totally new page can I name them as “post-1” to “post-10” or do I have to continue numbering the new page “post-11” to “post-20”?

    #204554
    Paulie_D
    Member

    If it’s a new page then you can repeat IDs & names with no problems.

    #204561
    fredtheted
    Participant

    Thanks. If in the USA do have a great July 4th.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘CSS’ is closed to new topics and replies.