# ใครเก่งช่วยทีคับ มีวิธีใส่ CSS เปลี่ยนรูปแบบ font ของเว็บอื่นที่เราดึงมาเป็น iframe ได้ไหมคับ

เริ่มโดย น้องบิ้ว, 12 สิงหาคม 2013, 01:52:45

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

น้องบิ้ว

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

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

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

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

:wanwan017:

kiraoji

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

ไม่ชัวลองดูครับ

969

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

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

max30012540

ทำได้ครับ แต่จะทำไม่ได้กับ 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/questions/217776/how-to-apply-css-to-iframe

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

น้องบิ้ว

อ้างถึงจาก: max30012540 ใน 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/questions/217776/how-to-apply-css-to-iframe

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

ขอบคุณมากคับ เด๋วขอลองก่อนคับ  แต่ว่าของผมคือ คนละโดเมนนะคับ ไม่รุจะได้ไหม  :P