【发布时间】:2018-02-16 10:41:14
【问题描述】:
我正在努力解决这个问题。任何帮助或建议将不胜感激。我的目标是当屏幕小于 700 像素时,内容将从当前的并排列变为块显示。但目前我的专栏只是并排。我设法让它在 jsfiddle 中工作,但不能让它做任何事情,然后在崇高的文本中缩小在一起。
footer {
background-color: #333538;
/* padding: 24px 0; */
margin-top: 12px;
}
footer p {
color: white;
margin-bottom: 12px !important;
}
.social {
list-style-type: none;
padding: 0;
}
.social li {
display: inline;
margin-right: 12px;
}
.copyright {
/* padding: 12px 0; */
text-align: center;
}
.column-half {
margin: 0 12px 24px 12px;
width: 400px;
background-color: blue;
/*float: left;*/
}
.row-foot {
display: flex;
flex-direction: row;
margin: 72px;
}
.container {
width: 1200px;
margin: 0 auto;
}
@media (max-width: 700px) {
.row-foot {
display: block;
}
.container {
width: auto;
}
}
<footer>
<div class="container">
<div class="row-foot">
<div class="column-half">
<h4>BOOK AN APPOINTMENT</h4>
<p>The Paw Pad is a professioanl dog grooming service based in lytham</p>
<p>Strit practice to a high hygeine standard ensuring your dog leaves in good health as well as a great coat</p>
<p>All request are welcome and I'll be happy to help in any way I can</p>
<p><b>Opening Hours</b></p>
<p><i>Monday to Friday 10am-5pm</i></p>
</div> <!-- end column half -->
<div class="column-half">
<h4>Get in touch</h4>
<p>46 aaaaa ddddt</p>
<p>fy8 gr6</p>
<p>000000000</p>
<p><a href="mailto:fdjhgfdhgf@gmail.com">thgfhgfhgs@gmail.com</a></p>
<li class="social"><a href="#"><img src="C:\Users\Sue\Desktop\sublime-
text\images/facebook-logo2.png" alt="Facebook"></a></li>
</div>
</div>
</div>
</footer>
【问题讨论】:
-
我会使用具有不同
flex-direction(行/列)的 Flexbox:css-tricks.com/snippets/css/a-guide-to-flexbox -
请设置为code sn-p
-
谢谢,我去看看。
-
成功了!我使用了弹性包装。应该对以后有用。感谢您的提示
标签: html css media-queries block