如何在手机上的标题和价格标签之间添加保证金

时间:2017-07-11 08:49:50

标签: html css

我想在移动设备的标题和价格标签之间添加一个保证金(休息.h3{ margin:5px; } // and .tags{ margin:5px; } )。该网站是http://www.jokerleb.com。我试过了

<?php
$servername = "localhost";
$username = "Crypted";
$password = "appCrypted";
$dbname = "Crypted";

// Post Method
//$hwInfo = $_POST["hwInfo"];  
$trial = $_GET["trial"];  
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection

if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 
$sql = "UPDATE users SET trial='$trial' WHERE hwInfo='4871-1598-0155-1531'";

if ($conn->query($sql) === TRUE) {
    echo "Record updated successfully";
} else {
    echo "Error updating record: " . $conn->error;
}

$conn->close();
?>

我也尝试过其他div和媒体查询,没有任何效果,似乎只是申请保证金不会改变任何东西。我一直在研究这个超级愚蠢的问题2天,不知道为什么它不起作用。

enter image description here

2 个答案:

答案 0 :(得分:3)

只需添加以下media query即可解决问题。

  @media (max-width:400px) {
       .tags {
        margin-bottom: 8px; /* Added */
        padding: 0;
        float: right;
        right: 24px;
        bottom: -12px;
    }
  }

答案 1 :(得分:1)

你这样做是错误的!它疯狂地漂浮着。你可能需要这样做,它会起作用:

@media screen and (max-width: 400px) {
  .post-block .post-right h3 {
    max-width: 100%;
    float: none;
    padding-top: 40px;
  }
}

预览

preview