CSTT - Trong khi R.I.P template để blog đạt chuẩn W3C (HTML5) thì mình có đúc rút được một số kinh nghiệm cũng như tham khảo trên mạng những lỗi cơ bản trong template cũng như lúc đăng bài cho blogspot.
Hôm nay mình chia sẻ những kinh nghiệm này để các bạn khắc phục để tối ưu SEO tốt hơn.
1. Lỗi Line xxx, Column xxx: Attribute imageanchor not allowed on element a at this point.- Với lỗi này khi bạn đăng ảnh thì chuyển qua chế độ HTML và xóa các mã: imageanchor="1" và border="0" đi.
2. Lỗi Line xxx, Column xxx: An img element must have an alt attribute, except under certain conditions. For details, consult guidance on providing text alternatives for images.
- Nếu gặp lỗi này là do bạn chưa thêm thẻ art (mô tả) cho ảnh. Bạn thêm thẻ art sẽ sửa được lỗi này.
3. Lỗi Line xxx, Column xxx: & did not start a character reference. (& probably should have been escaped as &.)
- Nếu gặp lỗi này thì các bạn vào template và đổi hết các kí tự & hoặc & thành & là xong.
4. Lỗi Line xxx, Column xxx: Duplicate ID xxx.
- Nếu gặp lỗi này các bạn nên thay thuộc tính css và chuyển id thành class.
Ví dụ:
Code CSS:
#chiase {Code HTML:
border-top: 5px solid #5279fa;
background: white;
-webkit-box-shadow: 2px 2px 3px rgba(0,0,0,0.05);
-moz-box-shadow: 2px 2px 3px rgba(0,0,0,0.05);
box-shadow: 2px 2px 3px rgba(0,0,0,0.05);
padding: 10px;
border-left: 1px solid #5279fa;
border-right: 1px solid #5279fa;
border-radius: 4px;
-webkit-border-radius: 4px;
margin-bottom: 20px;
border-bottom: 5px solid #5279fa;
}
<div id='chiase'>Thì các bạn đổi #chiase thành .chiase và id='chiase' thành class='chiase'
...........
</div>
5. Lỗi Line xxx, column xx: Bad value 'xx'px; for attribute height on element img: Expected a digit but saw p instead. Khi thay title trang bằng image.
- Nếu gặp lỗi này các bạn hãy xóa cặp thẻ: expr:height='data:height' và expr:width='data:width' đi.
6. Lỗi Line xxx, column xx: Bad value 100px; for attribute height on element img: Expected a digit but saw p instead.
- Nếu gặp lỗi này các bạn hãy xóa thuộc tính height và width đi.
7. Lỗi Line xxx, column xx: Element style is missing required attribute scoped.
<style type='text/css'>
- Nếu gặp lỗi này các bạn hãy xóa thuộc đoạn code css này đi và coppy style css lên trên thẻ /b:skinThe allowtransparency attribute on the iframe element is obsolete. Use CSS instead.
- Nếu gặp lỗi này thì xóa allowtransparency='true' đi.
Lỗi :
Line 25, Column 128: & did not start a character reference. (& probably should have been escaped as &.)
<style type="text/css"><!-- /*
P/s: Các lỗi sẽ được cập nhật tiếp theo sau.
Lỗi :
…n.css?targetBlogID=5874993363568069362&zx=16eab200-06e3-4ccb-892c-5e099637e95b…
- Nếu gặp lỗi này thì thêm code sau trên thẻ <b:skin>:<style type="text/css"><!-- /*
P/s: Các lỗi sẽ được cập nhật tiếp theo sau.
