.leafとh3を真ん中によせつつ、.leafの上にh3を真ん中に乗せたいのですが上手くいきません、、
良い方法がありましたらご教授ください。
<html lang="ja"> <head> <meta charset="utf-8"> <title></title> <link href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" rel="stylesheet"> <style> .main{ margin: 30px auto; text-align: center; } .con{ display: flex; align-items: center; margin: 0 auto; } .con h3{ font-size: 30px; position: fixed; z-index: 2; text-align: center; margin-top: -1px; } .con::before,.con::after{ height: 1px; background-color: black; content: ""; flex-grow: 1; display: inline-block; } .con::before{ margin-right: .4em; } .con::after{ margin-left: .4em; } .leaf{ color: #bbb; font-size: 4em; } </style> </head> <body> <div class="main"> <div class="con"> <h3>content</h3> <i class="fab fa-pagelines leaf"></i> </div> </div> </body> </html> コード
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。