CSS 使分页链接在浏览器边距右侧 200 像素

标签 css

下面的分页代码显示得很好。但是,它总是靠浏览器的边缘左对齐。

如何将它向右移动 200 像素?

HTML:

echo " <div class='pages'><a href='http://www.domain.com/index.php?currentpage=1' class='links'><<</a></div> "; 

echo " <div class='pages'><a href='http://www.domain.com/index.php?currentpage=$prevpage' class='links'><</a></div> ";   

echo " <div class='pages'>[<b>$x</b>] </div>";  

echo " <div class='pages'><a href='http://www.domain.com/index.php?currentpage=$x' class='links'>$x</a></div> ";  

echo " <div class='pages'><a href='http://www.domain.com/index.php?currentpage=$nextpage' class='links'>></a></div> "; 

CSS:

    .pages
        {
        color: #000000;
        overflow: hidden;
        display: block;
        float: left;
        margin: 4px;
        margin-top: 1600px;
        margin-bottom:0px;
        margin-left: 10px;
        padding-bottom: 0px;
        font-family: Georgia, "Times New Roman", Times, serif;
        font-size: 24px;
        }   


 a.links:link {
    color: #004284; text-decoration: none;
    text-align:center;
    margin-left:8px;
    margin-bottom:0px;
    padding:2px;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 24px;
    }

 a.links:visited {
    color: #004284; text-decoration: none;
    text-align:center;
    margin-left:8px;
    margin-bottom:0px;
    padding:2px;
    font-family:Georgia, "Times New Roman", Times, serif;
    font-size: 24px;
    }

 a.links:active {
    color: #004284; text-decoration: none; 
    text-align:center;
    margin-left:8px;
    margin-bottom:0px;
    padding:2px;
    font-family:Georgia, "Times New Roman", Times, serif;
    font-size: 24px;
    }

 a.links:hover {
    color: #FFFFFF; text-decoration: none; 
    background-color: #004284;
    text-align:center;
    margin-left:8px;
    margin-bottom:0px;
    padding:2px;
    font-family:Georgia, "Times New Roman", Times, serif;
    font-size: 24px;
    }

最佳答案

或者您可以简单地将其包装到外部 <div> 中,然后您可以一起控制它们:

<div id="wrap">
<div class='pages'><a href='http://www.domain.com/index.php?currentpage=1' class='links'><<</a></div> 
<div class='pages'><a href='http://www.domain.com/index.php?currentpage=1' class='links'><<</a></div> 
....
</div>

然后只是CSS它:

#wrap {
margin-left: 200px;
}

关于CSS 使分页链接在浏览器边距右侧 200 像素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8310417/

相关文章:

css - Shiny Dashboard 框和表格格式不一致

html - 滚动时悬停文本不会相对于元素移动

javascript - 基于父 CSS 状态的条件子动画(带有用于 React 的样式化组件)

asp.net - 插入/更新 XML

html - 图像 <a> 垂直和水平居中对齐并在两者中都使用 % 调整大小

html - 溢出:隐藏影响缩放图像

html - 如何检测[如果! webkit] 通过媒体查询

javascript - 谷歌地图标记在移动设备中悬停时显示标签

javascript - 我正在尝试从存储在数据库中的 pdf 中检索,但是它返回的是路径而不是文件本身

html - flexbox 元素中的白线不会消失