如何使用引导程序和响应式设置响应式页脚

时间:2018-07-26 20:03:34

标签: html5 css3 web bootstrap-4

任何可以帮助我的人。我想使用引导程序和自定义CSS使网站的页脚具有响应性。

请帮助我,我所需的输出就像下面 Desktop Mobile 中的这两个。 请帮助我解决此问题

台式机

enter image description here

移动

enter image description here

这是我当前的代码

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
	<footer>
		<div class="container">
			<div class="row">
				<div class="col-12">
				  <h3 >Connect With Us</h3>
				  <div class="border-bottom"></div>
				</div>
			</div>
		<div class="row padding-top-15px">
		<div class="col-md-8 col-sm-12 col-xs-12">
			<form>
			  <input type="text" placeholder="Name" required />
			  <input type="email" placeholder="Email" required />
			  <input type="submit" value="Subscribe" class="btn swatch-1"> 
			  <a href="#" data-toggle="modal" data-target="#invitefriendModal" class="btn">Refer a Friend</a>
			</form>
		</div>

		<div class="col-md-4 col-sm-12 conl-xs-12"> 
			<div class="footer-social">
				<a href="#" class="fa fa-facebook"></a>
				<a href="#" class="fa fa-google"></a>
				<a href="#" class="fa fa-linkedin"></a>
				<a href="#" target="_blank" >Legal</a> <span>Accreditation Number</span>
			</div>
		</div>
		</div>
		  </div>
    </footer>

1 个答案:

答案 0 :(得分:0)

@import url('http://fonts.googleapis.com/css?family=Open+Sans:100,200,300,400,500,600,700,800,900');
    body {
      font-family: Open Sans, Arial;
      }
    .btn.swatch-1{background-color: #20b8cd;color: #fff !important;}
    .btn{font-size: 1em;line-height: 1.6em;border-radius: 0.2em;border:none;padding: 0.3em 2em;}
    footer{
        padding: 2% 4% 1%;
        color: #fff;
        background: #1b1b1b;
        font-size: 0.8em;
    }
    placeholder{
        padding:0px;
        color:#fff;
    }
    footer input[type="text"],input[type="email"]{
        background-color:transparent;
        border-bottom:2px solid #fff;
        border-top:none;
        border-left:none;
        border-right:none;
        margin: 0px 20px 0px 0px;
        font-family:Open Sans, Arial, sans-serif;
        font-size:1.2em;
        color:#fff;
    }
    footer input[type="email"]{
        margin-right:10px;
    }
    footer a {
        margin: 0 1em;
        white-space: nowrap;
        color: #fff;
        line-height: 2em;
    }

    footer small {
        display: block;
        margin: 1em 1.7em;
        font-size: 0.7em;
        opacity: 0.4;
    }

    footer .socials i {
        margin: 0em 0.1em;
        font-size: 1.2em;
        line-height: 1.6;
        display: block;
    }

    footer .socials {
        border: 1px solid #fff !important;
        display: inline-block;
        border-radius: 2em;
        padding: 0;
    }

    footer a.btn {
        border: 1px solid #fff !important;
        text-transform:uppercase;
    }
    footer .btn {
        text-transform:uppercase;
    }
    footer h3{
        text-transform:uppercase;
        
    }
    footer h3:after{
        height:5px;
        width:60px;
        background-color:#03d1c1;
        margin-bottom:10px
        
    }
    footer .footer-social .fa {
      padding: 10px;
      font-size: 15px;
      width: 35px;
      text-align: center;
      text-decoration: none;
      margin: 0px 2px;
      border-radius: 3px;
    }

    footer .footer-social .fa:hover {
        opacity: 0.7;
    }

    .fa-facebook {
      background: #3B5998;
      color: white;
    }

    .fa-twitter {
      background: #55ACEE;
      color: white;
    }

    .fa-google {
      background: #dd4b39;
      color: white;
    }

    .fa-linkedin {
      background: #007bb5;
      color: white;
    }

    @media (max-width: 575.98px) {

    footer {
        font-size: 1em;
    }
    footer h3{
        text-align: center;
        text-transform: uppercase;
        font-size: 1.8em;
        font-weight: 600;
    }
    footer .border-bottom{
        height: 5px;
        max-width: 100px;
        background-color: #46b8cd;
        /* border-bottom: none; */
        border-bottom: none !important;
        margin: 0 auto 10px auto;
    }
    footer .footer-social{
        margin-top: 20px;
    }
    footer input[type="text"], input[type="email"] {
        margin-top: 10px;
        width:100%; 
    }
    footer .btn {
        margin: 20px 0 0 0;

    }
    footer form{
        text-align: center;
    }


    }

请查看下面的css,我忘了将其包含在上面。