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

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

ThaiSEOBoard.comความรู้ทั่วไปSearch Engine Optimizationเช็ค css validation แล้ว error อย่างนี้ แก้ยังไงถึงหายอะคับ
หน้า: [1]   ลงล่าง
พิมพ์
ผู้เขียน หัวข้อ: เช็ค css validation แล้ว error อย่างนี้ แก้ยังไงถึงหายอะคับ  (อ่าน 1648 ครั้ง)
0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้
004275
หัวหน้าแก๊งเสียว
*

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

กระทู้: 2,158



ดูรายละเอียด
« เมื่อ: 17 เมษายน 2009, 22:13:15 »

มันเปนอย่างนี้อะคับ

คือลองแก้ดูแล้ว แต่ไม่รู้มันผิดหลักอะไรอะคับ ไม่หายเหมือนเดิม

โค๊ด:
11  	 *  	 Parse Error  *html body #nich-wrapper{display:block;width:1000px;margin:0 auto;}

16 *:first-child + html #nich-wrapper Property text-position doesn't exist : left

31 * Parse Error *html body #nich-content { width : 960px; clear: both; float: left; margin-top: -5px; margin-right: auto; margin-bottom: 0; margin-left: 10px; background: #ffffff; border-left: 0px solid #bbbbbb; border-right: 0px solid #bbbbbb; }

35 * Parse Error *html body #nich-content a{ font-size: 12px; }

51 * Parse Error *html body #nich-header { clear: both; background-position: center top; float: left; width: 960px; height: 136px; padding: 0; margin-left: 10px; border-left: 0px solid #bbbbbb; border-right: 0px solid #bbbbbb; }

102 .logotext strong Value Error : font Renaissance is not a font-size value : Renaissance

113 * Parse Error *html body #nich-right tr td tr td { text-align: left; }

161 * Parse Error *html body #nich-left { float: right; width: 225px; margin-left: 0px; margin-right: 6px; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom: 1px solid #cccccc; border-style: shape; margin-top:30px; margin-bottom:20px; }

165 #nich-right Value Error : position left is not a position value : left

182 #nich-right .postinfo Value Error : position left is not a position value : left

243 * Parse Error *html body #nich-left h2 { font: 1.00em Times New Roman, Helvetica, sans-serif; font-size:13px; text-transform: none; color: #000000; font-weight:bold; padding-top: 9px; padding-bottom: 12px; padding-left: 14px; margin-left:-30px; margin-right:0px; margin-bottom:20px; margin-top:-32px; background: #cacccf; background-repeat: repeat-x; background-position: left bottom; border-bottom: 1px solid #cccccc; border-top: 1px solid #cccccc; }

325 * Parse Error *html body #nich-footer { clear: both; display: block; width: 960px; background: #6a9ed2; border-bottom: 10px solid #6a9ed2; text-align: left; float: left; background-repeat: repeat-x; padding-top: 0px; color: #fefefe; font-size: 12px; }
บันทึกการเข้า
Sarbuy
ก๊วนเสียว
*

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

กระทู้: 425



ดูรายละเอียด เว็บไซต์
« ตอบ #1 เมื่อ: 17 เมษายน 2009, 22:22:42 »

ต้องลองดู css ตัวจริงจะได้ลองเทียบดู

เพราะบางทีการใช้ชื่อ id ซ้ำมันก็จะขึ้น error แบบไม่มีสาเหตุเหมือนกันอ่ะครับ
ถ้าดูแบบนี้ผมก็ค่อยข้างสับสน เหอ เหอ
บันทึกการเข้า
g-ji
เจ้าพ่อบอร์ดเสียว
*

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

กระทู้: 3,254



ดูรายละเอียด เว็บไซต์
« ตอบ #2 เมื่อ: 17 เมษายน 2009, 22:34:15 »

* = universal selector = ทุกอย่างในหน้านั้นๆ
html = เฉพาะส่วนของ html (จริงๆ มันก็อันเดียวกับ * อ่ะ)

ดังนั้น 2 อัน ข้างบน ถ้าไม่จำเป็น ไม่ต้องใส่ใน css

ถ้าจะใส่ ใส่ได้แบบเดียวคือ reset css
*{
margin:0;
padding:0;
}

จากโค้ดที่ให้มา ใส่ id (#) กับ class (.) พอแล้ว

ข้างล่างนี้ hack ie ต้องใส่ /*IE*/ เอาไว้ด้วย
โค๊ด:
*:first-child + html #nich-wrapper 	Property text-position doesn't exist : left

shot code for
font:color size family << สลับกันไม่ไ่ด้

ตัวอย่าง

div p{font:#ff0 2.5em Tahoma;}

และถ้า กำหนด font แล้ว ห้ามใส่ font-size,font-family,font-color ตามหลังอีกเด็ดขาด เพราะมันจะ error อย่างที่เห็น  Tongue


ส่วน position อันนี้ ไม่แน่ใจว่ามันตรงไหน แต่ถ้า ต้องการจะสั่งให้ div class="left" มันลอยอยู่ทางซ้ายให้ใช้ float:left

หรือ กำหนด div ตัวนอกเป็น relative แล้ว div ตัวใน ตั้งเป็น absolute ถึงจะกำหนด position ได้

- -*


การกำหนด ตำแหน่งของ ข้อความใช้คำสั่ง

text-align:left/center/right/justify(ชิดขอบซ้ายขวา) ใช้กำหนด ตำแหน่งของ ทุก text  ได้ด้วย

เช่น
โค๊ด:
<style type=text/css>
#xxx{text-align:center;}
</style>

<div id="xxx">
<h2>xxx</h2>
<p>xxx</p>
</div>

ทุก Text ที่อยู่ใน id xxx จะอยู่ตรงกลางหมด จนกว่าเราจะไปกำหนดค่าเพิ่มเติม
« แก้ไขครั้งสุดท้าย: 17 เมษายน 2009, 22:39:03 โดย g-ji » บันทึกการเข้า

004275
หัวหน้าแก๊งเสียว
*

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

กระทู้: 2,158



ดูรายละเอียด
« ตอบ #3 เมื่อ: 17 เมษายน 2009, 22:56:23 »

ขอบคุณคับ ตอนนี้ทำได้แล้ว ไม่ error แต่มีปัญหา คือ

ถ้าผมใส่อันนี้ลงไป มันจะ error 2 จุดนี้อะคับ

แต่ถ้าไม่ใส่ มันจะไม่ error แต่ใน ie6 มันจะโชว์ สะเปะสะปะ อะคับ

โค๊ด:
*html body #nich-content  {
width: 960px;
margin-top : -5px;
margin-right : auto;
margin-bottom : 0;
margin-left : 10px;
background : #ffffff;
}

*html body #nich-header  {
width : 960px;
height : 136px;
padding : 0;
margin-left : 10px;
}
บันทึกการเข้า
g-ji
เจ้าพ่อบอร์ดเสียว
*

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

กระทู้: 3,254



ดูรายละเอียด เว็บไซต์
« ตอบ #4 เมื่อ: 18 เมษายน 2009, 00:11:19 »

งงๆ ใช้ hack ทำไมหว่า  Tongue

พอดีไม่เห็นหน้าเว็บอ่ะว่าเป็นแบบไหน

ทำเป็น css แยกออกมาเลยดีกว่านะ

สร้าง css ใหม่เลย ตั้งชื่อว่า ie6.css

เวลา เรียก ก็ใส่แบบนี้
โค๊ด:
<!--[if lte IE 7]>
<link rel="stylesheet" href="url/to/ie6.css" type="text/css" media="screen" />
<![endif]-->

lte IE 7 คือ IE 7 และ ต่ำกว่า ให้ใช้ ข้อมูลตามที่เรียก

ถ้าเฉพาะ IE6 ก็ แก้เป็น IE 6 (ลบ lte ทิ้ง)

ใส่แค่ 2 อันที่มีปัญหาก็พอ

--------------

แต่เว็บเราไม่ต้อง hack เลยนะ  Tongue

เปิดด้วย เบราเซอร์ไหนก็แสดงผล เหมือนกัน อาจจะมีบางจุดเพี้ยนๆ แต่ไม่มากแบบเห็นได้ชัด

แต่เดี๋ยวเราต้องลบ css ที่ไม่ได้ใช้ทิ้ง เพราะว่าไฟล์มันใหญ่ไปหน่อย
บันทึกการเข้า

smapan
Global Moderator
เจ้าพ่อบอร์ดเสียว
*****

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

กระทู้: 8,272



ดูรายละเอียด เว็บไซต์
« ตอบ #5 เมื่อ: 18 เมษายน 2009, 11:21:50 »

 Cry เทพ  css สักวันผมต้องฝึกให้คล่องเท่านี้
บันทึกการเข้า

จูมล่าโฮส สยามโฮสเว็บ modty.com
รวมที่พัก เช่ารายวัน ที่พักเช่ารายเดือนมากที่สุดแจ่มจริง
***Tel 083-757-1515 ติดปัญหา Joomla ตรงไหนรับปรึกษาฟรี โทรมาเถอะครับ ถ้าตอบได้ช่วยแน่นอน ไม่มีกั้ก. ***
หน้า: [1]   ขึ้นบน
พิมพ์