ยินดีต้อนรับคุณ, บุคคลทั่วไป กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน

เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น

ThaiSEOBoard.comพัฒนาเว็บไซต์CMS & Free Scriptการทำหัวเว็บแบบ Responsive คงเหลือแต่โลโก้ และแบนเนอร์สินะ
หน้า: 1 [2]  ทั้งหมด   ลงล่าง
พิมพ์
ผู้เขียน หัวข้อ: การทำหัวเว็บแบบ Responsive คงเหลือแต่โลโก้ และแบนเนอร์สินะ  (อ่าน 3548 ครั้ง)
0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้
ptteppawong
Verified Seller
เจ้าพ่อบอร์ดเสียว
*

พลังน้ำใจ: 316
ออฟไลน์ ออฟไลน์

กระทู้: 4,787



ดูรายละเอียด
« ตอบ #20 เมื่อ: 03 พฤษภาคม 2015, 09:09:37 »

ขอบคุณทุกท่านมากนะครับ   ได้รับความรู้เพิ่มเติมอีกเยอะเลยครับ     wanwan017 wanwan017
บันทึกการเข้า
ptteppawong
Verified Seller
เจ้าพ่อบอร์ดเสียว
*

พลังน้ำใจ: 316
ออฟไลน์ ออฟไลน์

กระทู้: 4,787



ดูรายละเอียด
« ตอบ #21 เมื่อ: 04 พฤษภาคม 2015, 11:40:13 »

ขอบคุณครับ  สำหรับทุกความเห็น ....

ถามต่อนะครับ ......

สมมุติผมออกแบบหัวเว็บ   เพื่อการแสดงผลบน Desktop ที่ขนาด   1000 x 200px  

และผมออกแบบขนาดต่าง ๆ   อีก  3  ขนาด  เพื่อการแสดงผลบน tablet  และบนมือถือด้วย  

ใช้โค้ดตัวไหนเช็คครับ  ว่าถ้าเป็นอุปกรณ์แบบนี้ ให้แสดงผลหัวเว็บขนาดนี้มาแสดง    

ที่ต้องถามว่าใช้โค้ดอะไร   เพราะผมไม่เก่งเรื่องโค้ดครับ  ยังไงรบกวนด้วยครับ



ตัวอย่างการเขียน CSS แบบ Media Query ลองเอาไปประยุกต์ดูครับ

<style="text/css">
     .banner{margin:0 auto;}
     .banner-desktop{width:1000px; height:300px; background-color:blue; text-decoration:none;}
     .banner-tablet{width:640px; height:200px; background-color:purple; text-decoration:none;}
     .banner-mobile{width:320px; height:320px; background-color:green; text-decoration:none;}
     @media only screen and (min-width:1000px]){ /*แสดงผลบนหน้าจอ Desktop*/
          .banner{width:1000px;}
          .banner-desktop{display:block;}
          .banner-tablet{display:none;}
          .banner-mobile{display:none;}
     }
     @media only screen and (max-width:999px) and (min-width:640px){ /*แสดงผลบนหน้าจอ Tablet*/
          .banner{width:640px;}
          .banner-desktop{display:none;}
          .banner-tablet{display:block;}
          .banner-mobile{display:none;}
     }
     @media only screen and (max-width:639px){ /*แสดงผลบนหน้าจอ Mobile*/
          .banner{width:320px;}
          .banner-desktop{display:none;}
          .banner-tablet{display:none;}
          .banner-mobile{display:block;}
     }
</style>

<div class="banner">
     <a class="banner-desktop" href="#"></a>
     <a class="banner-tablet" href="#"></a>
     <a class="banner-mobile" href="#"></a>
</div>


แล้วจะใส่ url ของภาพแทรกไว้ตรงโค้ดตำแหน่งไหนครับ.... wanwan017 wanwan017
บันทึกการเข้า
BakKheab
สมุนแก๊งเสียว
*

พลังน้ำใจ: 65
ออฟไลน์ ออฟไลน์

กระทู้: 725



ดูรายละเอียด
« ตอบ #22 เมื่อ: 04 พฤษภาคม 2015, 11:52:58 »

ขอบคุณครับ  สำหรับทุกความเห็น ....

ถามต่อนะครับ ......

สมมุติผมออกแบบหัวเว็บ   เพื่อการแสดงผลบน Desktop ที่ขนาด   1000 x 200px  

และผมออกแบบขนาดต่าง ๆ   อีก  3  ขนาด  เพื่อการแสดงผลบน tablet  และบนมือถือด้วย  

ใช้โค้ดตัวไหนเช็คครับ  ว่าถ้าเป็นอุปกรณ์แบบนี้ ให้แสดงผลหัวเว็บขนาดนี้มาแสดง    

ที่ต้องถามว่าใช้โค้ดอะไร   เพราะผมไม่เก่งเรื่องโค้ดครับ  ยังไงรบกวนด้วยครับ



ตัวอย่างการเขียน CSS แบบ Media Query ลองเอาไปประยุกต์ดูครับ

<style="text/css">
     .banner{margin:0 auto;}
     .banner-desktop{width:1000px; height:300px; background-color:blue; text-decoration:none;}
     .banner-tablet{width:640px; height:200px; background-color:purple; text-decoration:none;}
     .banner-mobile{width:320px; height:320px; background-color:green; text-decoration:none;}
     @media only screen and (min-width:1000px]){ /*แสดงผลบนหน้าจอ Desktop*/
          .banner{width:1000px;}
          .banner-desktop{display:block;}
          .banner-tablet{display:none;}
          .banner-mobile{display:none;}
     }
     @media only screen and (max-width:999px) and (min-width:640px){ /*แสดงผลบนหน้าจอ Tablet*/
          .banner{width:640px;}
          .banner-desktop{display:none;}
          .banner-tablet{display:block;}
          .banner-mobile{display:none;}
     }
     @media only screen and (max-width:639px){ /*แสดงผลบนหน้าจอ Mobile*/
          .banner{width:320px;}
          .banner-desktop{display:none;}
          .banner-tablet{display:none;}
          .banner-mobile{display:block;}
     }
</style>

<div class="banner">
     <a class="banner-desktop" href="#"></a>
     <a class="banner-tablet" href="#"></a>
     <a class="banner-mobile" href="#"></a>
</div>


แล้วจะใส่ url ของภาพแทรกไว้ตรงโค้ดตำแหน่งไหนครับ.... wanwan017 wanwan017

เพิ่ม Tag Img ลงในส่วนของ HTML

<div class="banner">
     <a class="banner-desktop" href="#"><img src="banner-desktop.gif"/></a>
     <a class="banner-tablet" href="#"><img src="banner-tablet.gif"/></a>
     <a class="banner-mobile" href="#"><img src="banner-mobile.gif"/></a>
</div>
บันทึกการเข้า
ptteppawong
Verified Seller
เจ้าพ่อบอร์ดเสียว
*

พลังน้ำใจ: 316
ออฟไลน์ ออฟไลน์

กระทู้: 4,787



ดูรายละเอียด
« ตอบ #23 เมื่อ: 04 พฤษภาคม 2015, 12:38:01 »

ขอบคุณครับ  สำหรับทุกความเห็น ....

ถามต่อนะครับ ......

สมมุติผมออกแบบหัวเว็บ   เพื่อการแสดงผลบน Desktop ที่ขนาด   1000 x 200px  

และผมออกแบบขนาดต่าง ๆ   อีก  3  ขนาด  เพื่อการแสดงผลบน tablet  และบนมือถือด้วย  

ใช้โค้ดตัวไหนเช็คครับ  ว่าถ้าเป็นอุปกรณ์แบบนี้ ให้แสดงผลหัวเว็บขนาดนี้มาแสดง    

ที่ต้องถามว่าใช้โค้ดอะไร   เพราะผมไม่เก่งเรื่องโค้ดครับ  ยังไงรบกวนด้วยครับ




ตัวอย่างการเขียน CSS แบบ Media Query ลองเอาไปประยุกต์ดูครับ

<style="text/css">
     .banner{margin:0 auto;}
     .banner-desktop{width:1000px; height:300px; background-color:blue; text-decoration:none;}
     .banner-tablet{width:640px; height:200px; background-color:purple; text-decoration:none;}
     .banner-mobile{width:320px; height:320px; background-color:green; text-decoration:none;}
     @media only screen and (min-width:1000px]){ /*แสดงผลบนหน้าจอ Desktop*/
          .banner{width:1000px;}
          .banner-desktop{display:block;}
          .banner-tablet{display:none;}
          .banner-mobile{display:none;}
     }
     @media only screen and (max-width:999px) and (min-width:640px){ /*แสดงผลบนหน้าจอ Tablet*/
          .banner{width:640px;}
          .banner-desktop{display:none;}
          .banner-tablet{display:block;}
          .banner-mobile{display:none;}
     }
     @media only screen and (max-width:639px){ /*แสดงผลบนหน้าจอ Mobile*/
          .banner{width:320px;}
          .banner-desktop{display:none;}
          .banner-tablet{display:none;}
          .banner-mobile{display:block;}
     }
</style>

<div class="banner">
     <a class="banner-desktop" href="#"></a>
     <a class="banner-tablet" href="#"></a>
     <a class="banner-mobile" href="#"></a>
</div>



แล้วจะใส่ url ของภาพแทรกไว้ตรงโค้ดตำแหน่งไหนครับ.... wanwan017 wanwan017


เพิ่ม Tag Img ลงในส่วนของ HTML

<div class="banner">
     <a class="banner-desktop" href="#"><img src="banner-desktop.gif"/></a>
     <a class="banner-tablet" href="#"><img src="banner-tablet.gif"/></a>
     <a class="banner-mobile" href="#"><img src="banner-mobile.gif"/></a>
</div>



มันแสดงมาพร้อมกันหมดเลยครับ

http://xn--b3c3acw1an2b3b4a4ira.com/
บันทึกการเข้า
wasantec
หัวหน้าแก๊งเสียว
*

พลังน้ำใจ: 586
ออฟไลน์ ออฟไลน์

กระทู้: 2,613



ดูรายละเอียด
« ตอบ #24 เมื่อ: 04 พฤษภาคม 2015, 13:47:02 »

ขอบคุณครับ  สำหรับทุกความเห็น ....

ถามต่อนะครับ ......

สมมุติผมออกแบบหัวเว็บ   เพื่อการแสดงผลบน Desktop ที่ขนาด   1000 x 200px  

และผมออกแบบขนาดต่าง ๆ   อีก  3  ขนาด  เพื่อการแสดงผลบน tablet  และบนมือถือด้วย  

ใช้โค้ดตัวไหนเช็คครับ  ว่าถ้าเป็นอุปกรณ์แบบนี้ ให้แสดงผลหัวเว็บขนาดนี้มาแสดง    

ที่ต้องถามว่าใช้โค้ดอะไร   เพราะผมไม่เก่งเรื่องโค้ดครับ  ยังไงรบกวนด้วยครับ




ตัวอย่างการเขียน CSS แบบ Media Query ลองเอาไปประยุกต์ดูครับ

<style="text/css">
     .banner{margin:0 auto;}
     .banner-desktop{width:1000px; height:300px; background-color:blue; text-decoration:none;}
     .banner-tablet{width:640px; height:200px; background-color:purple; text-decoration:none;}
     .banner-mobile{width:320px; height:320px; background-color:green; text-decoration:none;}
     @media only screen and (min-width:1000px]){ /*แสดงผลบนหน้าจอ Desktop*/
          .banner{width:1000px;}
          .banner-desktop{display:block;}
          .banner-tablet{display:none;}
          .banner-mobile{display:none;}
     }
     @media only screen and (max-width:999px) and (min-width:640px){ /*แสดงผลบนหน้าจอ Tablet*/
          .banner{width:640px;}
          .banner-desktop{display:none;}
          .banner-tablet{display:block;}
          .banner-mobile{display:none;}
     }
     @media only screen and (max-width:639px){ /*แสดงผลบนหน้าจอ Mobile*/
          .banner{width:320px;}
          .banner-desktop{display:none;}
          .banner-tablet{display:none;}
          .banner-mobile{display:block;}
     }
</style>

<div class="banner">
     <a class="banner-desktop" href="#"></a>
     <a class="banner-tablet" href="#"></a>
     <a class="banner-mobile" href="#"></a>
</div>



แล้วจะใส่ url ของภาพแทรกไว้ตรงโค้ดตำแหน่งไหนครับ.... wanwan017 wanwan017


เพิ่ม Tag Img ลงในส่วนของ HTML

<div class="banner">
     <a class="banner-desktop" href="#"><img src="banner-desktop.gif"/></a>
     <a class="banner-tablet" href="#"><img src="banner-tablet.gif"/></a>
     <a class="banner-mobile" href="#"><img src="banner-mobile.gif"/></a>
</div>



มันแสดงมาพร้อมกันหมดเลยครับ

http://xn--b3c3acw1an2b3b4a4ira.com/


โค๊ด:
<style="text/css">
     .banner{margin:0 auto;}
     .banner-desktop{width:1000px; height:300px; display: block; background-color:blue; text-decoration:none;}
     .banner-tablet{width:640px; height:200px; display: none; background-color:purple; text-decoration:none;}
     .banner-mobile{width:320px; height:320px;display: none; background-color:green; text-decoration:none;}
     

     @media only screen and (max-width:980px){ /*แสดงผลบนหน้าจอ Tablet*/
          .banner-tablet{display:block;}
          .banner-desktop{display:none;}
          .banner-mobile{display:none;}
     }
     @media only screen and (max-width:480px){ /*แสดงผลบนหน้าจอ Mobile*/
          .banner-mobile{display:block;}
          .banner-desktop{display:none;}
          .banner-tablet{display:none;}
     }
</style>

ลอดูครับ
บันทึกการเข้า
kiraoji
หัวหน้าแก๊งเสียว
*

พลังน้ำใจ: 226
ออฟไลน์ ออฟไลน์

กระทู้: 1,681



ดูรายละเอียด
« ตอบ #25 เมื่อ: 04 พฤษภาคม 2015, 14:02:35 »

น่าจะได้เห็น Responsive ในหลากหลายรูปแบบในอนาคตนะครับ 
บันทึกการเข้า
MD.18
เจ้าพ่อบอร์ดเสียว
*

พลังน้ำใจ: 287
ออฟไลน์ ออฟไลน์

กระทู้: 3,010



ดูรายละเอียด เว็บไซต์
« ตอบ #26 เมื่อ: 04 พฤษภาคม 2015, 14:02:57 »

สมัยนี้ใช้ tag <picture></picture> กันแล้วครับ ง่าย สะดวก ถูกหลักโครงสร้างสมัยใหม่  wanwan017
บันทึกการเข้า

ติดต่อทางเมล์ service.md18@gmail.com by ทวีศักดิ์  line : 0862600055

คิวงานว่าง !!
ptteppawong
Verified Seller
เจ้าพ่อบอร์ดเสียว
*

พลังน้ำใจ: 316
ออฟไลน์ ออฟไลน์

กระทู้: 4,787



ดูรายละเอียด
« ตอบ #27 เมื่อ: 04 พฤษภาคม 2015, 14:50:58 »

ขอบคุณครับ  สำหรับทุกความเห็น ....

ถามต่อนะครับ ......

สมมุติผมออกแบบหัวเว็บ   เพื่อการแสดงผลบน Desktop ที่ขนาด   1000 x 200px  

และผมออกแบบขนาดต่าง ๆ   อีก  3  ขนาด  เพื่อการแสดงผลบน tablet  และบนมือถือด้วย  

ใช้โค้ดตัวไหนเช็คครับ  ว่าถ้าเป็นอุปกรณ์แบบนี้ ให้แสดงผลหัวเว็บขนาดนี้มาแสดง    

ที่ต้องถามว่าใช้โค้ดอะไร   เพราะผมไม่เก่งเรื่องโค้ดครับ  ยังไงรบกวนด้วยครับ




ตัวอย่างการเขียน CSS แบบ Media Query ลองเอาไปประยุกต์ดูครับ

<style="text/css">
     .banner{margin:0 auto;}
     .banner-desktop{width:1000px; height:300px; background-color:blue; text-decoration:none;}
     .banner-tablet{width:640px; height:200px; background-color:purple; text-decoration:none;}
     .banner-mobile{width:320px; height:320px; background-color:green; text-decoration:none;}
     @media only screen and (min-width:1000px]){ /*แสดงผลบนหน้าจอ Desktop*/
          .banner{width:1000px;}
          .banner-desktop{display:block;}
          .banner-tablet{display:none;}
          .banner-mobile{display:none;}
     }
     @media only screen and (max-width:999px) and (min-width:640px){ /*แสดงผลบนหน้าจอ Tablet*/
          .banner{width:640px;}
          .banner-desktop{display:none;}
          .banner-tablet{display:block;}
          .banner-mobile{display:none;}
     }
     @media only screen and (max-width:639px){ /*แสดงผลบนหน้าจอ Mobile*/
          .banner{width:320px;}
          .banner-desktop{display:none;}
          .banner-tablet{display:none;}
          .banner-mobile{display:block;}
     }
</style>

<div class="banner">
     <a class="banner-desktop" href="#"></a>
     <a class="banner-tablet" href="#"></a>
     <a class="banner-mobile" href="#"></a>
</div>



แล้วจะใส่ url ของภาพแทรกไว้ตรงโค้ดตำแหน่งไหนครับ.... wanwan017 wanwan017


เพิ่ม Tag Img ลงในส่วนของ HTML

<div class="banner">
     <a class="banner-desktop" href="#"><img src="banner-desktop.gif"/></a>
     <a class="banner-tablet" href="#"><img src="banner-tablet.gif"/></a>
     <a class="banner-mobile" href="#"><img src="banner-mobile.gif"/></a>
</div>



มันแสดงมาพร้อมกันหมดเลยครับ

http://xn--b3c3acw1an2b3b4a4ira.com/


โค๊ด:
<style="text/css">
     .banner{margin:0 auto;}
     .banner-desktop{width:1000px; height:300px; display: block; background-color:blue; text-decoration:none;}
     .banner-tablet{width:640px; height:200px; display: none; background-color:purple; text-decoration:none;}
     .banner-mobile{width:320px; height:320px;display: none; background-color:green; text-decoration:none;}
     

     @media only screen and (max-width:980px){ /*แสดงผลบนหน้าจอ Tablet*/
          .banner-tablet{display:block;}
          .banner-desktop{display:none;}
          .banner-mobile{display:none;}
     }
     @media only screen and (max-width:480px){ /*แสดงผลบนหน้าจอ Mobile*/
          .banner-mobile{display:block;}
          .banner-desktop{display:none;}
          .banner-tablet{display:none;}
     }
</style>

ลอดูครับ



ขอบคุณมากครับ   ได้แล้วครับ 

ขอรบกวนอีกหน่อยนะครับ   ถ้าให้แสดงผลบนมือถือแบบแนวนอนล่ะครับ  ต้องเพิ่มโค้ดยังไงบ้างครับ....
บันทึกการเข้า
BakKheab
สมุนแก๊งเสียว
*

พลังน้ำใจ: 65
ออฟไลน์ ออฟไลน์

กระทู้: 725



ดูรายละเอียด
« ตอบ #28 เมื่อ: 04 พฤษภาคม 2015, 15:20:33 »

สมัยนี้ใช้ tag <picture></picture> กันแล้วครับ ง่าย สะดวก ถูกหลักโครงสร้างสมัยใหม่  wanwan017

แต่ไม่รองรับใน Browser รุ่นเก่าๆ นะครับ เพราะยังมีบาง user ที่ใช้ browser รุ่นเก่าอยู่ เช่น IE รุ่นเก่าๆ ก็ยังมีคนใช้อยู่นะครับ
ถ้าจะให้แสดงผลไดใน Browser เก่าๆ ก็ต้องใช้ Tag ที่ browser เข้าใจตรงกัน
หรือจะ import พวก javascript เข้ามาช่วย ก็เป็นอีกทางเลือกหนึ่ง (แต่อันนี้จะทำให้เว็บประมวลผลช้าลงอีก)
บางคนหันไปใช้ Bootstrap แทน แต่ Bootstrap เอง ก็ยังไม่รองรับ IE รุ่นที่ต่ำกว่า IE9

หลากหลายวิธี แต่ยังไงก็คงต้องคำนึงถึง USER เป็นหลัก เช่นเคย  wanwan011
บันทึกการเข้า
หน้า: 1 [2]  ทั้งหมด   ขึ้นบน
พิมพ์