html 我有麻烦得到下面固定

3yhwsihp  于 2023-10-14  发布在  其他
关注(0)|答案(2)|浏览(117)

请我需要帮助修复此代码是响应。它看起来正常时,在桌面浏览器,但在移动的设备上的按钮不工作。下面是我真的需要帮助的代码来完成这一点。

.aos-animate.plan__tabs-row {
    visibility: inherit;
    -webkit-animation-name: fadeInDown;
    animation-name: fadeInDown;
}
.aos-animate.plan__tabs-row {
    visibility: inherit;
    -webkit-animation-name: fadeInDown;
    animation-name: fadeInDown;
}
.plan__tabs-row {
    margin: 25px 0;
    position: relative;
    -webkit-animation-duration: 1s;
    animation-duration: 1s;
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
    visibility: hidden;
}
.plan__tabs-row {
    margin: 25px 0;
    position: relative;
    -webkit-animation-duration: 1s;
    animation-duration: 1s;
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
    visibility: hidden;
}
<div class="plan__tabs-row aos-init aos-animate" data-aos="animation">
  <div class="plan__tab-conteiner">
    <button class="plan__pm-action check"><i></i> Precious Metals</button>
    <button class="plan__real-action"><i></i>Real Estate</button>
    <button class="plan__energy-action"><i></i> Energy</button>
    <button class="plan__forex-action"><i></i>Forex</button>                
  </div>
</div>
50few1ms

50few1ms1#

解决这个问题的最好方法是在脚本中创建函数:
超文本标记语言:

<div class="plan__tabs-row aos-init aos-animate" data-aos="animation">
   <div class="plan__tab-conteiner">
      <button class="plan__pm-action check" onclick="Meta()"><i></i> Precious Metals</button>
      <button class="plan__real-action" onclick="Esta()><i></i>Real Estate</button>
      <button class="plan__energy-action" onclick="Ener()><i></i> Energy</button>
      <button class="plan__forex-action" onclick="Fore()><i></i>Forex</button>                
   </div>
</div>

JS:

function Meta(){
  //Code
}
function Esta(){
  //Code
}
function Ener(){
  //Code
}
function Fore(){
  //Code
}
o4tp2gmn

o4tp2gmn2#

要在移动的设备上实现响应式按钮设计,可以在屏幕尺寸减小时使用媒体查询来定制按钮的外观。下面是如何为此目的自定义代码的示例:

.aos-animate.plan__tabs-row {
    visibility: inherit;
    -webkit-animation-name: fadeInDown;
    animation-name: fadeInDown;
}
.aos-animate.plan__tabs-row {
    visibility: inherit;
    -webkit-animation-name: fadeInDown;
    animation-name: fadeInDown;
}
.plan__tabs-row {
    margin: 25px 0;
    position: relative;
    -webkit-animation-duration: 1s;
    animation-duration: 1s;
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
    visibility: hidden;
}
.plan__tabs-row {
    margin: 25px 0;
    position: relative;
    -webkit-animation-duration: 1s;
    animation-duration: 1s;
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
    visibility: hidden;
}

        /* Mobile styles */
        @media (max-width: 768px) {
            .plan__tab-conteiner {
                flex-direction: column;
            }

            .plan__tab-conteiner button {
                margin-bottom: 10px;
                width: 100%;
            }
        }
<div class="plan__tabs-row aos-init aos-animate" data-aos="animation">
        <div class="plan__tab-conteiner">
            <button class="plan__pm-action check"><i></i> Precious Metals</button>
            <button class="plan__real-action"><i></i> Real Estate</button>
            <button class="plan__energy-action"><i></i> Energy</button>
            <button class="plan__forex-action"><i></i> Forex</button>                
        </div>
    </div>

这仅仅是一个例证;使用@media查询可以获得更好的结果。600px用于手机和768px用于平板电脑

相关问题