Hello! I do not know if I could be very clear with the title of my question. But my question is with the following code:
<div id="newsletter" class="col-sm-12">
<div class="news-title">
<i class="fa fa-envelope hidden-xs hidden-sm"></i>RECEBA OFERTAS E LANÇAMENTOS NO SEU E-MAIL!
</div>
<div class="news-input">
<input type="hidden" name="source" value="ecommerce">
<input type="text" name="name_news" placeholder="Digite seu nome" class="form-control input-lg">
<input type="email" name="email_news" placeholder="Digite seu e-mail" class="form-control input-lg">
<span class="input-group-btn">
<button type="button" class="btn btn-lg btn-newsletter" id="newseltter_send" data-loading-text="ENVIANDO...">ENVIAR</button>
</span>
</div>
</div>
I want to be using margin-bottom:10px;
in .news-title
only if the input[name="name_news"]
element exists.
I know that you have to use jQuery to solve this, but I want to know if you can do it using only CSS. I tried using the following parameter:
#newsletter > .news-title ~ .news-input > input[name="name_news"]
But it did not work, because it gives the margin in the input element. I hope someone can help me with this, thanks: D