0
我有一個帶有頭部的div。該div調整與瀏覽器,但文字保持相同的大小,並沒有正確調整大小。Div和Text一起調整大小以保持比例
.header {
min-width:100%;
\t min-height:13%;
\t position: fixed;
\t margin:auto;
\t top: 0;
\t z-index: 1;
\t background: rgb(0, 0, 0);
\t background: rgba(0, 0, 0, 0.7);
}
.headerTitle {
\t left: 0;
\t width:100%;
\t height:100%;
\t position: absolute;
\t color:black;
\t font: bold 24px/45px Helvetica, Sans-Serif;
\t letter-spacing: -1px;
\t margin-left: 3%;
\t font-size: 500%;
}
<div id="homepageHeader" class="header">
\t \t <h1 id="homepageHeaderTitle" class="headerTitle">Text Here</h1>
\t \t <!-- insert menu buttons here -->
\t </div>
建立你的評論,這是一個偉大的文章,利用SASS功能:https://css-tricks.com/between-the-lines/ –
謝謝你!這對我有很大幫助 – Tom