Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #873747

    Hello together,

    i want to style three different contact forms on one website with different background-colors. (Enfold) The code i´m using is already working but for one style for all contactforms.
    The question is how i can make three different codes working for three different page names. I tried with if(is_page) but it didnt work.

    The code i´m using (maybe you can tell me a more kind one)

    .input-text, #top .main_color input[type=”text”], .main_color input[type=”input”], .main_color input[type=”password”], .main_color input[type=”email”], .main_color input[type=”number”], .main_color input[type=”url”], .main_color input[type=”tel”], .main_color input[type=”search”], #top .main_color textarea, .main_color select {
    border-color: #000000;
    background-color: #89bd26;
    color: #ffffff;

    the contact form for “Page one” should have the back-ground color : #89bd26
    “” “Page two” ” ” : #004883
    “” “Page three” ” ” : #f07a60

    i hope you can help me
    greetings Felix

    #874035

    Hey Florian,

    If you inspect each page in your browser, you will find the page ID class in the body tag. You can use that to target the forms on the different pages:

    .page-id-101 .element {
      Your CSS
    }

    Best regards,
    Rikard

    #874092

    hey,
    thank you for your quick response, but it doesnt work when i use
    .page-id-34 .element {
    CSS
    }
    the code isn´t working, but the ID is the right one.

    I linked the website in private content, hope you can help me

    thank you again
    best regards

    #874444

    Hi,

    The code I posted was just an example, it won’t do anything. You would have to replace .element with the class of the element you are trying to target and then also add the CSS arguments inside of the block where it reads CSS. Since you posted some CSS in your first post I thought you might know CSS but I’m guessing I was wrong?

    If you need further help then please explain exactly what you are looking to achieve.

    Best regards,
    Rikard

    #874796

    Hey,
    I think we missunderstood each other :) I just know some simple coding to change some css or html, but I have no advanced skills.
    When I wrote “.page-id-34 .element {CSS}” I just used it as a placeholder but I worked with a real code.
    So when I use
    #top .main_color textarea { background-color: #89BD26; }
    #top .main_color input[type=’text’] { background-color: #89BD26; }
    the colorstyle of my contact form is changing the right way, but on every contact form on my Website.

    But I have 3 different contact forms on 3 different pages on the same website and they should all have some different color style. But when I use .page-id-34 this way..

    .page-id-34 #top .main_color textarea { background-color: #89BD26; }
    .page-id-34 #top .main_color input[type=’text’] { background-color: #89BD26; }

    the code isn´t working anymore.
    So I need help to distinguish these 3 different pages with the ID´s 34,36,38, to make a different colorstyle for each ID.

    I hope I was able to explain my Problem clearly to you.

    Greetings

    #875733

    Hi,

    Please try this instead:

    .page-id-34 textarea { background-color: #89BD26; }
    .page-id-34 input[type=’text’] { background-color: #89BD26; }

    Generally you don’t need this bit:

    #top .main_color

    Best regards,
    Rikard

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.