當我重新調整窗口大小時,標題移動會在右側留下空間。 (請參閱圖片)。如果我水平地縮小窗口,則間隙增加。我只能通過將標題的位置設置爲fixed
來解決此問題,但文本重疊。我希望標題隨垂直滾動移動。任何幫助在這裏我出錯是高度讚賞。在窗口上移動標題調整大小
*{
\t padding:0;
\t margin:0 auto;
\t font-family: 'Museo Slab 300';
}
html{
\t background: url("Images/backlines.png") no-repeat center center fixed;
}
.company-header {
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%,color-stop(0, rgb(226, 226, 226)),color-stop(0, rgb(254, 254, 254)),color-stop(0.1, rgb(254, 254, 254)),color-stop(1, rgb(219, 219, 219)),color-stop(1, rgb(209, 209, 209)));
height: 140px;
box-shadow: 0px 2px;
position: absolute;
width: 100%;
top: 0px;
}
.company-footer{
\t position: fixed;
\t right: 0;
\t bottom: 0;
\t left: 0;
\t padding: 1rem;
\t background-color: #efefef;
\t text-align: left;
\t z-index:-1;
box-shadow: 0px -4px rgba(0, 173, 239, 1); \t
}
img#logo-image {
position: absolute;
left: 270px;
}
div#setting-dropdown {
position: relative;
float: right;
right: 250px;
top: 58px;
}
div#setting-dropdown-content {
\t display: none;
background: rgba(0, 173, 239, 1);
width: 196px;
margin-left: -70px;
padding: 4px 5px 5px 7px;
}
div#setting-dropdown-content a {
color: white;
text-decoration: none;
font-size: 16px;
font-family: 'Museo Slab 300';
display: inline-block;
}
div#setting-dropdown i {
display: inline-block;
padding: 5px;
padding-right: 7px;
text-align: center;
border-radius: 10px 10px 0 0;
padding-bottom: 10px;
\t color: rgba(0, 173, 239, 1);
}
div#setting-dropdown:hover i {
background-color: rgba(0, 173, 239, 1);
\t color:white;
}
#setting-dropdown:hover #setting-dropdown-content {
\t display:block;
}
p#setting-dropdown {
font-size: 20px;
font-weight: bold;
}
button#company-logout {
background: rgba(255, 255, 255, 1);
border: none;
border-radius: 40px 40px 40px 40px;
width: 135px;
height: 40px;
font-size: 19px;
font-weight: 900;
font-family: 'Museo Slab 700';
float: right;
top: 54px;
right: -40px;
position: relative;
}
div#log-in {
position: relative;
top: 200px;
}
div#welcome-text {
margin-left: 276px;
font-family: 'Museo Slab 300';
font-size: 22px;
}
div#loginHeader {
\t margin-top: 60px;
\t margin-left: 276px;
}
div#dropdown-main-content {
position: relative;
top: 230px;
left: 276px;
display: inline-flex;
}
.dropdown {
position: relative;
width: 11em;
top: 60px;
right: 260px;
}
.dropbtn {
color: white;
width: 100%;
height: 3.2em;
font-size: 16px;
border: none;
text-align: start;
font-weight: 900;
background: rgba(0, 173, 239, 1);
border-radius: 50px 50px 50px 50px;
-moz-border-radius: 0px;
z-index: 2;
text-indent: 23px;
}
.dropdown-content {
display: none;
z-index: -1;
background-color: #f9f9f9;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
margin-top: -64px;
width: 176px;
}
.dropdown a {
\t background:url("Images/sidearrow.png") no-repeat 7px;
}
.dropdown-content a {
color: black;
padding: .75em;
text-decoration: none;
display: block;
border: 1px solid #000;
border-top: none;
text-indent: 12px;
width: 150px;
}
.dropdown:hover .dropdown-content {
display: block;
}
.dropdown:hover .dropbtn {
background-color: #3e8e41;
}
.dropdown-content a:hover {
\t background:url("Images/sidewhite.png") no-repeat 3px;
\t background-color: rgb(255,131,0);
\t color:white;
\t font-weight:900;
}
.dropdown-content a:first-child {
padding-top: 35px;
background: url("Images/sidearrow.png") no-repeat 7px 36px;
}
.dropdown-content a:first-child:hover {
background: url("Images/sidewhite.png") no-repeat 3px 36px;
color:white;
background-color: rgb(255,131,0);
font-weight:900;
}
img#sphere {
position: relative;
width: 35px;
\t height: 34px ;
left: 133px;
bottom: 42px;
}
img#sphere-arrow {
position: relative;
bottom: 44px;
left: 99px;
}
div#login-form {
\t margin-top: 100px;
margin-left: 276px;
}
.page-label {
font-size: 19px;
}
button#loginSubmit {
margin-top: 75px;
background: rgba(0, 173, 239, 1);
border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 40px 40px 40px 40px;
width: 185px;
height: 60px;
font-size: 20px;
font-family: sans-serif;
color: white;
font-weight: 900;
border: none;
position: absolute;
margin-left: 278px;
}
div#login-landingpage{
margin-left: 276px;
margin-top: 90px; \t
}
select.security-questions {
width: 450px;
height: 40px;
font-weight: bold;
}
.security-question-labels {
font-size: 21px;
font-family: 'Museo Slab 300';
}
<!DOCTYPE html>
<html>
<head>
\t <title>Averios</title>
\t <link rel="stylesheet" type="text/css" href="test.css">
\t <link rel="stylesheet" href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" />
\t
<meta charset="utf-8">
</head>
<body>
<div class="company-header">
\t <a href="http://fuzionanalytics.com/"><img id="averios-logo-image" src="Images/averioslogo.png" width="176" height="129"></a>
\t <div id="setting-dropdown">
\t \t <!-- SETTING DROPDOWN WILL GO HERE -->
\t \t <p id="setting-dropdown"> SETTINGS <i class="ion-chevron-down"></i></p>
\t \t <div id="setting-dropdown-content">
\t \t \t <a href="#">Change Password</a>
\t \t \t <a href="#">Change Security Settings</a>
\t \t </div>
\t </div>
\t <button id="company-logout"> LOGOUT </button>
</div>
<div id="log-in">
\t <div id="loginHeader">
\t \t <h1>Portal</h1>
\t </div>
\t <br>
\t <br>
\t <div id="welcome-text">
\t \t <p> Welcome name </p>
\t \t <p> Your last login was time on date </p>
\t \t <br>
\t \t <p> Please select an application below to begin </p>
\t </div>
</div>
<div id="dropdown-main-content">
\t \t <img id="pulse-image" src="C:\Users\user\Desktop\Final-Designs\Images\pulse.png" width="320" height="50" alt=""/>
\t \t <div id="dropdown-one">
\t \t <div class="dropdown">
\t \t <button class="dropbtn">SELECT</button>
\t \t <img id="sphere" src="C:\Users\user\Desktop\Final-Designs\Images\sphere.png" alt=""/>
\t \t <img id="sphere-arrow" src="C:\Users\user\Desktop\Final-Designs\Images\arrow.png" alt=""/>
\t \t <div class="dropdown-content">
\t \t \t <a href="#">option0</a>
\t \t \t <a href="#">option1</a>
\t \t </div>
\t \t </div>
\t </div>
\t <!-- SENTINAL -->
\t <img id="sentinal-image" src="C:\Users\user\Desktop\Final-Designs\Images\sentinal.png" width="380" height="50" alt=""/>
\t <div id="dropdown-second">
\t \t <div class="dropdown">
\t \t <button class="dropbtn">SELECT</button>
\t \t <img id="sphere" src="C:\Users\user\Desktop\Final-Designs\Images\sphere.png" alt=""/>
\t \t <img id="sphere-arrow" src="C:\Users\user\Desktop\Final-Designs\Images\arrow.png" alt=""/> \t \t
\t \t <!--<div class="sphere-two">
\t \t \t <div id="arrow-two">
\t \t \t \t <img src="C:\Users\user\Desktop\Images\arrow.png" width="29" height="27" alt=""/>
\t \t \t </div>
\t \t </div>-->
\t \t <div class="dropdown-content">
\t \t \t <a href="#">option0</a>
\t \t \t <a href="#">option1</a>
\t \t </div>
\t \t </div>
\t </div>
</div>
<div class="company-footer">
\t <div id="footer-text">
\t \t © 2016 Company, All Rights Reserved.
\t </div>
</div>
</body>
</html>
事實上,描述的行爲並不在你的代碼段存在? – sinisake
@sinisake我只是跑了一小段,當你水平滾動時,我看到一個白色塊。不確定你指的是什麼。 – Maddy
如果你可以提供jsfiddle –