[Resolved] Selecting homepage element through css

Home Forums Support Selecting homepage element through css

  • This topic has 3 replies, 2 voices, and was last updated 1 year ago by Leo.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #998683
    Ghadeer

    I am using a static homepage with sections. I need to edit an html element that is generated automatically by GeneratePress, which is #main or .site-main (I need to make it absolute as I am trying to create a full page scroll homepage).

    Is there a way (in CSS) to select the #main or .site-main only in the homepage? I want to edit it only for the homepage not the entire site. While working I came across some ids like #post-14 that are uniquely generated for each page/post, so I thought about using them to target down the #main in the homepage – but I can’t find them anymore.

    So my question is, would it be correct to try and edit the #main element of the homepage through a specific homepage id? And if so, where can I find that id. Thanks a million.

    #998689
    Leo
    Staff
    Customer Support

    Hi there,

    There is always a unique class in the <body> tag.

    For home page, you can use .home or .page-id-14:
    https://www.screencast.com/t/lzwQq8f2nyfA

    Let me know if this helps 🙂

    #998850
    Ghadeer

    Thanks! That definitely helped.

    #999249
    Leo
    Staff
    Customer Support
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.