• Hello.
    I took this code from wpbeginner blog, which is supposed to style the comment area. I tried adding the code to the custom css area, and it worked only that the width and height of the author and site text box have changed and do not look good. the author text box is not as wide and is much shorter compared to the email and comment box forms and the site text box is also shorter than the rest, see my site: [ redundant link removed ]
    This is the code I added:

    /* Highlight active form field */
    #respond input[type=text], textarea {
    -webkit-transition: all 0.30s ease-in-out;
    -moz-transition: all 0.30s ease-in-out;
    -ms-transition: all 0.30s ease-in-out;
    -o-transition: all 0.30s ease-in-out;
    outline: none;
    padding: 3px 0px 3px 3px;
    margin: 5px 1px 3px 0px;
    border: 1px solid #DDDDDD;
    }
    #respond input[type=text]:focus,
    input[type=email]:focus,
    input[type=url]:focus,
    textarea:focus {
    box-shadow: 0 0 5px rgba(81, 203, 238, 1);
    margin: 5px 1px 3px 0px;
    border: 2px solid rgba(81, 203, 238, 1);
    }
    #submit {
    background:-moz-linear-gradient(top, #44c767 5%, #5cbf2a 100%);
    background:-webkit-linear-gradient(top, #44c767 5%, #5cbf2a 100%);
    background:-o-linear-gradient(top, #44c767 5%, #5cbf2a 100%);
    background:-ms-linear-gradient(top, #44c767 5%, #5cbf2a 100%);
    background:linear-gradient(to bottom, #44c767 5%, #5cbf2a 100%);
    background-color:#44c767;
    border:1px solid #18ab29;
    display:inline-block;
    cursor:pointer;
    color:#ffffff;
    font-family:Arial;
    font-size:17px;
    padding: px 31px;
    text-decoration:none;
    text-shadow:0px 1px 0px #2f6627;
    }
    #submit:hover {
    background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #5cbf2a), color-stop(1, #44c767));
    background:-moz-linear-gradient(top, #5cbf2a 5%, #44c767 100%);
    background:-webkit-linear-gradient(top, #5cbf2a 5%, #44c767 100%);
    background:-o-linear-gradient(top, #5cbf2a 5%, #44c767 100%);
    background:-ms-linear-gradient(top, #5cbf2a 5%, #44c767 100%);
    background:linear-gradient(to bottom, #5cbf2a 5%, #44c767 100%);
    background-color:#5cbf2a;
    }
    #submit:active {
    position:relative;
    top:1px;
    }
    #url {
    color: #1d1d1d;
    font-family: monospace;
    }

    I am a beginner in coding and couldn’t manage changing this back to normal.
    Thank you in advance.

    • This topic was modified 5 years, 10 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi @davil2008

    Do you want to change the size of the boxes here: https://prnt.sc/u0si37 ?

    Sorry, but could you please elaborate a little more on what results you are expecting to look in that comment form so that I can help you in the right direction?

    Also, I request you to please remove the CSS that you have used to customize that part.

    I’m looking forward to hearing back from you. 🙂

    Thread Starter Daniel

    (@davil2008)

    Sorry, if I wasn’t clear enough. What I meant is that the code makes the author and website boxes width and height change and are not the same as the email form, which doesn’t look good. see screenshot without code: https://ibb.co/D9c2HKp
    with code: https://prnt.sc/u0si37
    I now removed the css I added as you asked.

    • This reply was modified 5 years, 9 months ago by Daniel.

    Hi @davil2008

    As I understood you want to change the height and width of boxes. Right?

    You can use below CSS to change the height and width of Name, Email, and Site box:

    input {
        height:50px;
        width:50%;
    }

    And you can use below CSS to change height and width of response box:

    #respond textarea {
        width: 100%;
        height: 150px;
    }

    In both cases, you can adjust the height and width value according to your requirements. 🙂

    Thread Starter Daniel

    (@davil2008)

    Thank you !!! on desktop it now looks great, you can visit the site to see, however when I check on mobile the author, website and email forms aren’t full width on the screen, you can use the inspect tool on mobile version to see what I mean.

    Hi @davil2008

    You can use below CSS to get full width in mobile devices:

    @media (max-width: 480px) { 
      input {
        width: 100%;
      } 
    }

    Please let me know if you have any further questions. 🙂

    Thread Starter Daniel

    (@davil2008)

    Yes, perfect !!! But I just noticed that the

    input {
        height:50px;
        width:50%;
    }

    code is also working on the sites search form, which results in this: https://ibb.co/5vp7xHN
    Is there a way to exclude the search form from the css ?

    Hi @davil2008

    I’m really sorry, I forgot to take care of other elements. Currently, CSS is applying to all places having an input area but we want it to target only on the comment form.

    So please delete all CSS that I have provided and use the below one:

    .comment-form input {
        height: 50px;
        width: 50%;
    }
    
    @media (max-width: 480px) { 
      .comment-form input {
        width: 100%;
      } 
    }

    Sorry for the inconvenience caused to you.

    Thread Starter Daniel

    (@davil2008)

    Yes, this fixed this !! I can’t believe your apologising to me when you solved all of my problems !! this is the third time your answering me in these forums, and I fond it hard to believe that this coincidence… All three times you gave me exactly what I needed and you never disappointed me.

    Hi @davil2008

    Thank you so much for your kind words and I’m very happy to help you. 🙂

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Comment form width and height go wrong after customization’ is closed to new replies.