我想使用 fullpage.js 为自己创建一个网站,但我在某些元素上遇到了一些麻烦。我有这个无序列表,我想将列表居中,以便项目居中。我已经尝试了一切,但没有任何作用。我有一个居中的浮动 div,并且列表稍微推到了右侧。这是代码:.homepage-block{ display: table; background-color: green; margin: 0 auto;}#icons{ list-style-type: none; display: flex; background-color: red; justify-content: center;}li{ margin: 0 10px;}.fab{ font-size: 2rem;}<!DOCTYPE html><html><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Danijel Tomić - Portfolio</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/3.0.8/fullpage.min.css" integrity="sha256-+dIh4jG2jQTHZwW81yUo8h6tzXWcNumyNL5XPZbwp1E=" crossorigin="anonymous" /> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> <link rel="stylesheet" href="style.css"> <script src="https://kit.fontawesome.com/8d59324b96.js" crossorigin="anonymous"></script></head><body> <div id="fullPage"> <div class="section s1 bg-primary"> <div class="homepage-block"> <h1>Danijel</h1> <hr> <ul id="icons"> <li><i class="fab fa-github"></i></li> <li><i class="fab fa-linkedin"></i></li> <li><i class="fab fa-twitter"></i></li> </ul> </div> </div> <div class="section s2"> <h1>hello</h1> <hr> </div> <div class="section s3"> <h1>hello</h1> </div> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/3.0.8/fullpage.min.js"></script> <script>
目前暂无任何回答
- 0 回答
- 0 关注
- 123 浏览
添加回答
举报
0/150
提交
取消