January 4, 2018
當我製作手機版網頁時,習慣性的沿用PC版的CSS定義
發現一個跟 padding 完全無關的問題(BUG)
HTML for mobile
CSS for mobile
正常的 CSS for mobile
發現一個跟 padding 完全無關的問題(BUG)
HTML for mobile
<a href="index.php">首頁 home</a><a href="Category.php">商品清單 Category</a><span>某某商品名稱</span>
CSS for mobile
nav{
width: 100%;
background: url(../i/iconHomeGray-19.png) no-repeat left center;
margin: 0 20px 0px 0;
padding: 0 0 0 25px;
color: rgba(0,0,0,1.00);
font-size: 120%;
line-height: 200%; /*記得不能加上行高*/
}
nav a{
display: inline-block;
background: rgba(101,109,168,0.70);
margin: 0 5px 0 0;
padding: 2px 4px; /*完全不為所動*/
border-radius: 9px;
color: rgba(255,255,255,0.90);
line-height: 200%; /*設定這裡的行高也會有問題*/
}
nav span{
display: inline-block;
}
width: 100%;
background: url(../i/iconHomeGray-19.png) no-repeat left center;
margin: 0 20px 0px 0;
padding: 0 0 0 25px;
color: rgba(0,0,0,1.00);
font-size: 120%;
line-height: 200%; /*記得不能加上行高*/
}
nav a{
display: inline-block;
background: rgba(101,109,168,0.70);
margin: 0 5px 0 0;
padding: 2px 4px; /*完全不為所動*/
border-radius: 9px;
color: rgba(255,255,255,0.90);
line-height: 200%; /*設定這裡的行高也會有問題*/
}
nav span{
display: inline-block;
}
正常的 CSS for mobile
nav{
width: 100%;
background: url(../i/iconHomeGray-19.png) no-repeat left center;
margin: 0 20px 0px 0;
padding: 0 0 0 25px;
color: rgba(0,0,0,1.00);
font-size: 120%;
/* line-height: 200%; 去除行高*/
}
nav a{
display: inline-block;
background: rgba(101,109,168,0.70);
margin: 0 5px 0 0;
padding: 2px 6px; /*改變這個部分*/
border-radius: 9px;
color: rgba(255,255,255,0.90);
/* line-height: 200%; 去除行高*/
}
nav span{
display: inline-block;
}
width: 100%;
background: url(../i/iconHomeGray-19.png) no-repeat left center;
margin: 0 20px 0px 0;
padding: 0 0 0 25px;
color: rgba(0,0,0,1.00);
font-size: 120%;
/* line-height: 200%; 去除行高*/
}
nav a{
display: inline-block;
background: rgba(101,109,168,0.70);
margin: 0 5px 0 0;
padding: 2px 6px; /*改變這個部分*/
border-radius: 9px;
color: rgba(255,255,255,0.90);
/* line-height: 200%; 去除行高*/
}
nav span{
display: inline-block;
}
0 Comment(s)