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

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

ThaiSEOBoard.comพัฒนาเว็บไซต์Programming# ใครเก่งช่วยทีคับ มีวิธีใส่ CSS เปลี่ยนรูปแบบ font ของเว็บอื่นที่เราดึงมาเป็น iframe ได้ไหมคับ
หน้า: [1]   ลงล่าง
พิมพ์
ผู้เขียน หัวข้อ: # ใครเก่งช่วยทีคับ มีวิธีใส่ CSS เปลี่ยนรูปแบบ font ของเว็บอื่นที่เราดึงมาเป็น iframe ได้ไหมคับ  (อ่าน 1581 ครั้ง)
0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้
น้องบิ้ว
Verified Seller
เจ้าพ่อบอร์ดเสียว
*

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

กระทู้: 3,628



ดูรายละเอียด
« เมื่อ: 12 สิงหาคม 2013, 01:52:45 »

ดีครับ ตามหัวข้อเลยคับ ผมกำลังหาวิธีใส่ css คือเปลี่ยนรูปแบบ font ของเว็บอื่น ที่เราดึงมาเป็น iframe มาแปะเว็บเราได้ไหมคับ เข้าใจง่ายๆคือผมไม่ชอบรูปแบบของเว็บนั้นอยากจะเปลี่ยนสี

อย่างผมจะดึง หน้านี้ http://www.welovethailand.com/...w_iframe_ssi_recentTopics3.php  รูปแบบต้นฉบับเป็นฟอนสีน้ำเงิน

แล้วมาแปะที่เว็บผม mydomain.com  ผมก็วางโค้ดด้านล่างนี้  แต่ผมอยากเปลี่ยนรูปแบบฟอนส์ สี และขนาดตัวอักษร เราสามารถใส่ css คลุม iframe ได้ไหมคับ ผมลองทำแล้วมันไม่เป็นผลไม่รู้ใช้วิธีอะไรนะคับ มันเป็นเว็บของคนอื่นนะคับ แต่เราอยากเปลี่ยน style มันมีวิธีไหมคับ ถ้ามีรบกวนช่วยแนะนำทีคับ ขอบคุณล่วงหน้าคับ

<iframe src="http://www.welovethailand.com/...w_iframe_ssi_recentTopics3.php "  width="100%" marginwidth="0" height="500" marginheight="0" scrolling="No" frameborder="0"></iframe>

 wanwan017
« แก้ไขครั้งสุดท้าย: 12 สิงหาคม 2013, 01:54:10 โดย น้องบิ้ว » บันทึกการเข้า
kiraoji
หัวหน้าแก๊งเสียว
*

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

กระทู้: 1,681



ดูรายละเอียด
« ตอบ #1 เมื่อ: 12 สิงหาคม 2013, 08:37:43 »

1 ไม่ลองใส่ Css Class ใน iframe และ ใส่ style
2  ใส่ css style ใน head  ของเว็บเรา

ไม่ชัวลองดูครับ
บันทึกการเข้า
969
เจ้าพ่อบอร์ดเสียว
*

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

กระทู้: 3,589



ดูรายละเอียด
« ตอบ #2 เมื่อ: 12 สิงหาคม 2013, 09:30:01 »

ทำได้เหรอครับ ถ้าทำได้แจ่มเลย
 wanwan004
บันทึกการเข้า

articlebuilder โปรแกรมส้รางบทความภาษาอังกฤษ มีใครสนใจจะใช้ไม่ครับเปิดแชร์ให้ ใช้ได้ 1 ปี รับแค่ 2 คน จ่ายเพียงคนละ 3000 บาทใช้ได้ 1 ปีครับ จากราคาเต็มปีละ $297 สนใจ PM

เนื่องจาก Mail โดนให้ยืนยันตน ecommerce94@ฮอตเมล.com แต่ผมทิ้งเบอร์โทรที่ใช้กับเมลนี้ไปแล้วตอนนี้เลยใช้ไม่ได้ให้ติดต่อที่เมลใหม่ mybsiz@เอ้าลุค.com (outlook) นะครับ ไม่ได้ค่อยตอบ pm ให้ติดต่อผมที่ Mail ที่แจ้งเลยครับ
max30012540
หัวหน้าแก๊งเสียว
*

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

กระทู้: 1,307



ดูรายละเอียด
« ตอบ #3 เมื่อ: 12 สิงหาคม 2013, 10:40:56 »

ทำได้ครับ แต่จะทำไม่ได้กับ Cross domain
อ้างถึง
Edit: This does not work cross domain.

There are two different things here: the style of the iframe block and the style of the page embedded in the iframe. You can set the style of the iframe block the usual way:

โค๊ด:
<iframe name='iframe1' id="iframe1" src="empty.htm" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
The style of the page embedded in the iframe must be either set by including it in the child page:

โค๊ด:
<link type="text/css" rel="Stylesheet" href="Style/simple.css" />
Or it can be loaded from the parent page with Javascript:

โค๊ด:
var cssLink = document.createElement("link") 
cssLink.href = "style.css";
cssLink .rel = "stylesheet";
cssLink .type = "text/css";
frames['frame1'].document.body.appendChild(cssLink);

http://stackoverflow.com/quest...776/how-to-apply-css-to-iframe

ต้องใช้ Php ดึงมา แล้วตัดเอาส่วนที่ต้องการออกมาครับ  Embarrassed
บันทึกการเข้า
น้องบิ้ว
Verified Seller
เจ้าพ่อบอร์ดเสียว
*

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

กระทู้: 3,628



ดูรายละเอียด
« ตอบ #4 เมื่อ: 12 สิงหาคม 2013, 23:09:12 »

ทำได้ครับ แต่จะทำไม่ได้กับ Cross domain
อ้างถึง
Edit: This does not work cross domain.

There are two different things here: the style of the iframe block and the style of the page embedded in the iframe. You can set the style of the iframe block the usual way:

โค๊ด:
<iframe name='iframe1' id="iframe1" src="empty.htm" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
The style of the page embedded in the iframe must be either set by including it in the child page:

โค๊ด:
<link type="text/css" rel="Stylesheet" href="Style/simple.css" />
Or it can be loaded from the parent page with Javascript:

โค๊ด:
var cssLink = document.createElement("link") 
cssLink.href = "style.css";
cssLink .rel = "stylesheet";
cssLink .type = "text/css";
frames['frame1'].document.body.appendChild(cssLink);

http://stackoverflow.com/quest...776/how-to-apply-css-to-iframe

ต้องใช้ Php ดึงมา แล้วตัดเอาส่วนที่ต้องการออกมาครับ  Embarrassed


ขอบคุณมากคับ เด๋วขอลองก่อนคับ  แต่ว่าของผมคือ คนละโดเมนนะคับ ไม่รุจะได้ไหม  Tongue
บันทึกการเข้า
หน้า: [1]   ขึ้นบน
พิมพ์