HTML内の<i class="fas fa-bars"></i>にmargin:0 auto;やmargin-left:auto;など試しても右寄せされません。bootstrapは使ってません。お願いします!
html
1<!DOCTYPE html> 2<html lang="ja"> 3<head> 4 <meta charset="UTF-8"> 5 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 6 <title>模写2</title> 7 <link rel="stylesheet" href="copy.css"> 8 <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css"> 9</head> 10<body> 11 <header> 12 <div class="head"> 13 <a href="#"><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzNjAiIGhlaWdodD0iNTgiIHZpZXdCb3g9IjAgMCAzNjAgNTgiPgogICAgPGRlZnM+CiAgICAgICAgPHN0eWxlPgogICAgICAgICAgICAuY2xzLTF7ZmlsbDojMjI0NzVkfQogICAgICAgIDwvc3R5bGU+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0iY29tbW11bmVfbG9nbyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTQ3LjI3OSAtMjYuNDg2KSI+CiAgICAgICAgPGcgaWQ9Ikdyb3VwXzM3OSIgZGF0YS1uYW1lPSJHcm91cCAzNzkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDExMS41NyA0My4yNjEpIj4KICAgICAgICAgICAgPHBhdGggaWQ9IlBhdGhfMTgzIiBkPSJNMjIzLjU2NiA4Ny4xODhjLTMuMDU5IDMuOTcyLTcuMzUzIDUuOTU5LTEyLjkzNiA1Ljk1OS05LjcxNSAwLTE2LTYuNi0xNi0xNC45MjIgMC04LjUzNSA2LjY1Ni0xNS4wODMgMTYuMS0xNS4wODMgNS41ODIgMCAxMC4zMDUgMi4zMDggMTMuMTUxIDYuNWwtNS45NTggMy4yNzRhOC45NzIgOC45NzIgMCAwIDAtNy4xMzktMy4yMjFjLTUuNDc1IDAtOC45NjQgMy43LTguOTY0IDguNjQyIDAgNC44MzEgMy4zODI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jMzNSA5Ny45YTEzLjc3MSAxMy43NzEgMCAwIDEtMi4zLTUuNDZsLS4xNjktLjkyOS02LjI5NSAxLjE0OS4xNy45MjlhMjAuMjE4IDIwLjIxOCAwIDAgMCAzLjM3OSA4LjAxMWwuNTQ2Ljc3IDUuMjE1LTMuN3oiIGNsYXNzPSJjbHMtMSIgZGF0YS1uYW1lPSJQYXRoIDE5NyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTU3LjgzNiAtNjEuMTg2KSIvPgogICAgICAgICAgICA8cGF0aCBpZD0iUGF0aF8xOTgiIGQ9Ik03My45NjQgNzIuNjg1YTEzLjU1MyAxMy41NTMgMCAwIDEgMi4yNDctNS40ODVsLjU0LS43NzUtNS4yNDUtMy42NTYtLjU0Ljc3NWExOS43IDE5LjcgMCAwIDAtMy4yODUgNy45NThsLS4yMDYgMS4xMzkgNi4zMzEuOTQ4eiIgY2xhc3M9ImNscy0xIiBkYXRhLW5hbWU9IlBhdGggMTk4IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtNTcuNzg2IC00NS44NDkpIi8+CiAgICAgICAgICAgIDxwYXRoIGlkPSJQYXRoXzE5OSIgZD0iTTg4LjEgMTExLjIyNWwtLjc3Ni0uNTM4LTMuNjQyIDUuMjU1Ljc3Ni41MzhhMTkuNjk0IDE5LjY5NCAwIDAgMCA3LjkgMy4yNWwxLjEuMjEgMS4wMDktNi4zMy0uOTE3LS4xNTlhMTMuNTY3IDEzLjU2NyAwIDAgMS01LjQ1LTIuMjI2eiIgY2xhc3M9ImNscy0xIiBkYXRhLW5hbWU9IlBhdGggMTk5IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtNjYuMjE4IC03MS4zODIpIi8+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4K"></a> 14 <i class="fas fa-bars"></i> 15 </div> 16 </header> 17</body> 18</html>
css
1body{margin: 0; 2 padding: 0; 3 width: 100%; 4 height: 100%; 5} 6header .head{position: fixed; 7 width: 100%; 8 height: 76px; 9 background-color: white; 10 top: 0px; 11 box-shadow: 0 2px 10px 2px rgb(156, 156, 156);} 12.head img{width: 150px; 13 max-width: 250px; 14 margin-left: 20px; 15 margin-bottom: auto; 16 margin-top: 28px;} 17.head i{font-size: 30px; 18 color: rgb(19, 43, 20); 19 } 20 21
回答2件
あなたの回答
tips
プレビュー