简体   繁体   English

在使网站更具响应性方面需要帮助

[英]Need help on making website more responsive

I am trying to learn how to make my website ( https://noel.dog/ ) more responsive.我正在尝试学习如何使我的网站( https://noel.dog/ )更具响应性。 At the moment when I go on mobile there is a white background that shows.当我在手机上使用 go 时,显示的是白色背景。 I am trying to make it so as I decrease the page size, the boxes stack vertically instead of horizontally.我正在尝试这样做,以便在减小页面大小时,框垂直而不是水平堆叠。

 .boxes { display: flex; position: absolute; top: 50%; left: 50%; cursor: none; transform: translate(-50%, -50%); }.box { width: 150px; height: 170px; padding: 50px; margin: 30px; background-color: #090c0cfa; border: 1px solid #fe712f; border: 1px solid rgba(255, 255, 255, 0.03); border-radius: 3px; }.box:hover { border: 1px solid #fe712f; background-color: rgba(254, 106, 47, 0.03); }
 <div class="boxes"> <div class="box" id="Unwarmed" data-tilt data-tilt-glare data-tilt-max-glare="0.1"> <h1>Unwarmed Gmails</h1> <button class="details" type="button" onclick="run1()">View details</button> <button class="purchase" onclick="purchase1()">Purchase</button> </div> <div class="box" id="Oneclick" data-tilt data-tilt-glare data-tilt-max-glare="0.1"> <h1>Oneclick Gmails</h1> <button class="details" type="button" onclick="run2()">View details</button> <button class="purchase" onclick="purchase1()">Purchase</button> </div> <div class="box" id="Warmed" data-tilt data-tilt-glare data-tilt-max-glare="0.1"> <h1>Warmed Gmails</h1> <button class="details" type="button" onclick="run3()">View details</button> </div>

Adding flex-direction:column;添加flex-direction:column; changes the orientation of the boxes.改变盒子的方向。

 .boxes { display: flex; flex-direction:column; position: absolute; top: 50%; left: 50%; cursor: none; transform: translate(-50%, -50%); }.box { width: 150px; height: 170px; padding: 50px; margin: 30px; background-color: #090c0cfa; border: 1px solid #fe712f; border: 1px solid rgba(255, 255, 255, 0.03); border-radius: 3px; }.box:hover { border: 1px solid #fe712f; background-color: rgba(254, 106, 47, 0.03); }
 <div class="boxes"> <div class="box" id="Unwarmed" data-tilt data-tilt-glare data-tilt-max-glare="0.1"> <h1>Unwarmed Gmails</h1> <button class="details" type="button" onclick="run1()">View details</button> <button class="purchase" onclick="purchase1()">Purchase</button> </div> <div class="box" id="Oneclick" data-tilt data-tilt-glare data-tilt-max-glare="0.1"> <h1>Oneclick Gmails</h1> <button class="details" type="button" onclick="run2()">View details</button> <button class="purchase" onclick="purchase1()">Purchase</button> </div> <div class="box" id="Warmed" data-tilt data-tilt-glare data-tilt-max-glare="0.1"> <h1>Warmed Gmails</h1> <button class="details" type="button" onclick="run3()">View details</button> </div>

Just a little suggestion cause you already got the answer.只是一个小建议,因为你已经得到了答案。 Try using percentages when you are working with padding or width or vw(view width).在使用填充或宽度或 vw(视图宽度)时尝试使用百分比。 You'll know when you implement these things.当你实施这些事情时,你就会知道。 Hope I could help.希望我能帮上忙。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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