พอดีผมจะทำเว็บให้มันรองรับ Responsive
แต่พอลองเทสด้วยหน้าจอขนาด 320px มันควรจะใช้ไฟล์ 320.css แต่มันกลับไปใช้ไฟล์ 400.css แทนอะครับ
ผมทำผิดตรงไหนช่วยแนะนำทีครับ ขอบคุณครับ
index.html
<link rel='stylesheet' href='style.css' type='text/css' media='all' />
<div class="container">
</div>
style.css
@import url("main.css");
@import url("320.css");
@import url("400.css");
main.css
.container
{
margin: 0 auto;
position: relative;
width: 1000px;
}
320.css
@media screen and (max-width: 479px) { /* target= mobile 480 wide */
.container
{
margin: 0 auto;
position: relative;
width: 320px;
}
}
400.css
@media screen and (max-width: 768px) { /* target= mobile 480 wide */
.container
{
margin: 0 auto;
position: relative;
width: 460px;
}
}