简体   繁体   中英

line 3 divs on one line

I am trying to get a signup form to be on the same line instead of the default 3 lines.

I have tried to add display: inline-block; which made no difference and I have also tried to put a container around the divs but that didn't make a difference.

I do not have much experience of css but I do understand it. I was wondering if someone with a little more experience may be able to help.

    <!-- Begin MailChimp Signup Form -->
<div id="mc_embed_signup">
<form action="//digital-realms.us12.list-manage.com/subscribe/post?u=b3dcff09f16684d5f73852c78&amp;id=af1750ad39" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
    <div id="mc_embed_signup_scroll">

<div>Sign up to free e-Mail alerts for the latest news, offers & more: </div>
<div class="mc-field-group">
    <input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
</div>
    <div id="mce-responses" class="clear">
        <div class="response" id="mce-error-response" style="display:none"></div>
        <div class="response" id="mce-success-response" style="display:none"></div>
    </div>    <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
    <div style="position: absolute; left: -5000px;"><input type="text" name="b_b3dcff09f16684d5f73852c78_af1750ad39" tabindex="-1" value=""></div>
    <div class="clear opt-in" "><input type="submit" value="Sign Up" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
    </div>
</form>
</div>

<!--End mc_embed_signup-->

Thank you.

ps: The code came from MailChimp and they set the classes so I do not have any css of my own to include.

Use the following html

 .parent { width: 100%; } .block1 { width: 30%; float: left; padding-right: 10px; } .block2 { width: 30%; float: left; padding-right: 10px; } .block3 { width: 30%; float: left; } 
 <div class="parent"> <div class="block1">Content 1</div> <div class="block2">Content 2</div> <div class="block3">Content 3</div> </div> 

You may change the width. and insert your html into the content 1, content 2, content 3

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM