Я не могу выбрать кнопку ввода ввода внутри тегов формы на CSS - PullRequest
0 голосов
/ 26 января 2020

Как ссылка на тему, я не могу выбрать отправку, хотя я пытался изменить код на CSS, используя nth-child, nth-type-of, [type = submit] и так далее. Если кто-нибудь знает, как мы можем получить доступ к элементу на css, пожалуйста, помогите мне.

#subButton{
      padding: 2% 7%;
      background: #e32b7a;
      text-align: center;
      border: none;
      color: white;
      text-transform: uppercase;
      font-size: 10pt;
      letter-spacing: 0.02em;
      transition: all .3s;
      position: relative;
      margin: 24px 0 0 0;
      overflow: hidden;
      z-index: 1;
    }
    #subButton:after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 100%;
      border: none;
      background-color: #f42988;
      color: white;
      z-index: -2;
    }
    #subButton:before {
      content: '';
      color: cornsilk;
      position: absolute;
      bottom: 0;
      left: 0;
      width: 0%;
      height: 100%;
      background-color: #db257a;
      text-align: left;
      transition: all .3s;
      z-index: -1;
    }
    #subButton:hover {
      color: #fff;
    }
    #subButton:hover:before {
      width: 100%;
    }
    
<section class="newsLetter">
          <h1><i>Better design info gives you better inspiration.</i></h1>
          <form method="post" action="send2.php" class="content">
                  <div><input type="text" name="name" placeholder="Name" required></div>
                  <div><input type="text" name="email" placeholder="Email" required></div>
                  <div><input type="submit" id="subButton" value="Subscribe"></div>
          </form>
</section>

1 Ответ

1 голос
/ 26 января 2020

Вы можете использовать input[type=submit] или input:nth-child(3) вместо #subButton.

...