0

I'm building a lightning component and trying to use span in a div. My code is as below

<div class="subscribe slds-col--padded slds-size--1-of-3">
<div class="input-group">
  <input class="slds-input" label="Sign up" type="text" placeholder="Enter your email address">
  <span class="input-group-btn"><button type="button" class="btn btn-default">Subscribe</button></span>
  </input></div></div>

But the span is not rendering. That means button is showing up.

1

Close you </input> tag before <Span>

Try this and let us know if this works for you or not

<div class="subscribe slds-col--padded slds-size--1-of-3">
        <div class="input-group">
            <input class="slds-input" label="Sign up" type="text" placeholder="Enter your email address"></input>
            <span class="input-group-btn"><button type="button" class="btn btn-default">Subscribe</button></span>
        </div>
</div>
  • Thanks, Samir. its funny I tried earlier and it didn't worked. I tried again after your answer and it worked :). – SFDC Mafia - VIC Feb 5 '18 at 12:30
  • Glad I could help. – Samir Feb 5 '18 at 12:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.