我被一個額外的關閉咖喱括號在CSS中,我不小心把事先寫其他行。如果我把它留在那裏,它實際上對結果沒有壞處。但是,當我刪除它時,其他元素的位置會重新定位。我不小心把一個額外的關閉花括號
((代碼行,額外的右大支架,其中箭頭指向))
請點擊下面的鏈接,看到兩個結果。
問題:有沒有什麼辦法在不重新定位其他元素的情況下將其刪除?
Without the Close Curly Bracket
body{
font: 15px/1.5 Helvetica, Arial, sans-serif;
padding: 0;
margin: 0;
p(color#282f38);
background-color: #F5F2ED;
font:696863;
}
/*Global*/
.container{
width:80%;
margin:auto;
overflow:hidden;
}
ul{
margin:0;
padding:0;
}
/* Header */
#fixed{
position: fixed;
}
header{
position: fixed;
width: 100%;
background:#282f38;
color:#F5F2ED;
padding-top: 10px;
min-height:50px;
border-bottom:#F5F2ED 3px solid;
}
header a{
color:#F5F2ED;
text-decoration:none;
text-transform:uppercase;
font-size: 18px;
}
header li{
float:left;
display: inline;
padding: 0 20px 0 20px;
}
header #resume{
float: left;
}
header #resume h1{
margin: 0;
padding: 0;
}
header nav{
position: relative;
left: 30%;
float: right;
margin-top: 10px;
}
header .highlight, header .current a{
color:#696863 ;
font-weight: bold;
}
header a:hover{
color:#696863;
font-weight: bold;
}
/* Showcase */
#showcase {
min-height: 350px;
background: url('../Resources/Photographer.png') no-repeat 0 -120px;
align-items: center;
color: #ffffff;
overflow: auto;
}
#showcase h1{
text-align: center;
margin-top: 100px;
font-size: 40px;
margin-bottom: 10px;
}
#showcase p{
text-align:justify;
margin:0;
padding:0;
font-size: 14;
text-indent: inherit;
}
/* Social Medias*/
#socialmedias{
position:fixed;
padding-top: : 5px;
right: 20px;
top: 130px;
display: block;
vertical-align: baseline;
font: inherit;
list-style-type: none;
}
} <<-----------------------------------------------------------------------
/* Message Me Box */
#box{
width: 30%;
overflow: hidden;
padding: 1px;
}
/* Box Border */
.fieldset{
display: inline-block;
border: 3px solid;
float: right;
}
/* Message Me Title */
#legend{
font-size: 20px;
font-weight: bold;
color:#282f38;
}
/* Name Input */
#form-name{
display: block;
width: 200px;
margin-bottom: 10px;
}
/* Email Input */
#form-email{
display: block;
width: 200px;
margin-bottom: 10px;
}
/* Message Input */
#form-message{
display: block;
margin-bottom: 10px;
}
/* Contact */
.button_contact{
position: relative;
height: 30px;
width: 100%;
background:#696863;
color: #F5F2ED;
font-size: 14px;
text-transform: uppercase;
border: 0;
}
謝謝你這麼多帕特里克MLR –
您可以通過掉毛工具 –
@PhumchaiPipatanamongkol嗨運行你的代碼,作爲一般的提示,如果選擇頁面上的ID(如'頭#resume {'),你不應該需要比只使用ID更具體(即'#resume {')。只有當你需要時才如此具體。此外,使用'header'選擇器非常危險,因爲'header'是一個普通元素,這意味着您的頁面可能有多個'header'標籤。你大概只希望你的樣式適用於頁面頁眉,而不是所有可能出現在頁面上的「標題」標籤,所以我建議在頁眉上使用類或ID。 –