Forums

Give help. Get help.

  • # May 17, 2018 at 7:29 am

    Hi all,

    What I want to achieve is following:

    domain.com/folder1/…

    domain.com/folder2/…

    For every URL in folder1 I want to use a specific color set (headline, linkcolor, color sidebar)

    For every URL in folder2 I want to use another color set (headline, linkcolor, color sidebar)

    What is the best way to do this without javascript?

    With my knowledge I think that using different IDs could solve the problem

    div#folder1 h1 h2 h3 a …. {…}

    div#folder2 h1 h2 h3 a …. {…}

    How would you do it?

    Thanks in advance!

    Tobi

    # May 17, 2018 at 7:37 am

    Folders are not HTML elements…the are part of the path to the page which has the HTML body element or whatever,

    If each page inside the folder has a class on, say, the body reflecting the folder number then what you are suggesting is possible….but it’s a lot of work to maintain.

    # May 17, 2018 at 7:44 am

    Sry, my fault.

    I meant that I put everything that is in “folder1” in a <div> with id=”folder1″ and so on.

    Would this work?

    # May 17, 2018 at 8:15 am

    Sure, you could, but it’s probably easier to use the body element as the identifier since everything will be a child of the body.

    I prefer classes to IDs but that’s up to you.

    # May 17, 2018 at 8:16 am

    Frankly, I think you might find CSS Custom Properties very useful here.

    https://www.smashingmagazine.com/2018/05/css-custom-properties-strategy-guide/

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag