简体   繁体   English

我应该在我的博客项目中使用 XHTML/CSS2 还是 HTML5/CSS3?

[英]Should I use XHTML/CSS2 or HTML5/CSS3 on my blog project?

I'm going to develop a theme for a WordPress blog but I'm not sure if I should do it using XHTML/CSS2 or if I already can do it using HTML5/CSS3.我将为 WordPress 博客开发一个主题,但我不确定是否应该使用 XHTML/CSS2 或者我是否已经可以使用 HTML5/CSS3 来实现。

Usually, I use 960.gs framework but it isn't available with HTML5/CSS3.通常,我使用 960.gs 框架,但它不适用于 HTML5/CSS3。 I've heard that the 52framework works fine as well and I'm thinking about adopt it for my project, but I'm really insecure about HTML5's early adoption (?).我听说 52framework 也可以正常工作,我正在考虑在我的项目中采用它,但我对 HTML5 的早期采用真的很不安全(?)。

Someone, please, can help me to decide which technology adopt on my project.请有人可以帮助我决定在我的项目中采用哪种技术。

Thanks a lot.非常感谢。

HTML5 and CSS3 are "ready to use" - you need to learn a little about the concept of "Polyfilling", but you can make the user experience very similar in all browsers, even if you lose a few transition effects and rounded corners along the way. HTML5 和 CSS3 是“即用型”——你需要了解一点“Polyfilling”的概念,但是你可以让所有浏览器的用户体验非常相似,即使你失去了一些过渡效果和圆角方法。

My website has been HTML5 since 2009 and I tested it across many, many browsers.自 2009 年以来,我的网站一直是 HTML5,我在许多浏览器上对其进行了测试。

So the bottom line is, HTML5 is designed to be highly backwards compatible with HTML4.01 and there are lots of techniques for making content available to older browsers that don't support the more funky elements in HTML5.所以底线是,HTML5 被设计为与 HTML4.01 高度向后兼容,并且有许多技术可以使不支持 HTML5 中更时髦元素的旧浏览器可以使用内容。

The 960 grid system will work with HTML5 and CSS3 because it's just a list of classes. 960 网格系统将与 HTML5 和 CSS3 一起使用,因为它只是一个类列表。 CSS3 doesn't really give you any grid layout features yet that are widely adopted enough to be helpful. CSS3 并没有真正为您提供任何网格布局功能,但这些功能已被广泛采用以提供帮助。

I would use CSS3 and HTML5 as much as you can but don't forget about progressive enhancement.我会尽可能多地使用 CSS3 和 HTML5 但不要忘记渐进增强。 Don't blindly ignore a browser because it doesn't support CSS3.不要盲目地忽略浏览器,因为它不支持 CSS3。 You should use HTML5 and CSS3 appropriately and not because it's cool.您应该适当地使用 HTML5 和 CSS3 ,而不是因为它很酷。

What audience are you designing it for?你是为什么样的观众设计的? Do you need to be bleeding edge?你需要流血吗?

I would say use XHTML/CSS2 as that will be supported for years unless you need the functionality in the others.我会说使用 XHTML/CSS2,因为它会被支持多年,除非你需要其他的功能。

Being an early adopter can be quite painful, so only do that if you have good reasons to.作为早期采用者可能会很痛苦,所以只有在你有充分理由的情况下才这样做。

Html5 and css3 for sure! Html5 和 css3 肯定!

The only thing you might want to ask yourself is wether or not you want to use the new elements (article, aside, nav etc.) Because if you do, you need to depend on Javascript in order for IE to render your page correctly.您可能想问自己的唯一一件事是您是否要使用新元素(文章、旁白、导航等),因为如果您这样做,您需要依赖 Javascript 以使 IE 正确呈现您的页面。

Every new page should be written with the new doctype imo:每个新页面都应该使用新的文档类型 imo 编写:

<!DOCTYPE html> 

If you want a starting template that works well in all major browsers you might want to check this out: http://html5boilerplate.com/如果您想要一个在所有主要浏览器中都能正常工作的起始模板,您可能需要查看: http://html5boilerplate.com/

Whole-heartedly agree with Bravax.完全同意 Bravax。

It's all really based on who your audience is.这一切都取决于你的观众是谁。 If you want your site to be on the bleeding edge, regardless of audience, go for it.如果您希望您的网站处于最前沿,无论受众如何,go 都可以。

I have heard great things about 52framework .我听说过关于52framework的好消息。 I am about to implement it into a full-on 100+ page site redesign, The good thing about it.我即将将它实施到一个完整的 100 多页网站重新设计中,这是一件好事。 is that it plays nice with IE (even 6!).是它与 IE 配合得很好(甚至 6 个!)。

It is entirely related to the markets you are aiming at.它与您瞄准的市场完全相关。 You will be able to have more interactive content and easier to maintain styles with CSS3. styles 与 CSS3 将能够让您拥有更多的交互内容和更容易维护。 This said, many of the html5 and css3 elements are not yet standardized.这就是说,许多 html5 和 css3 元素尚未标准化。 Even among the modern, cutting-edge, browsers there can be major differences.即使在现代、尖端的浏览器中,也可能存在重大差异。

If you are making a theme for experimental purposes or to play around with, I would go with the newer technologies.如果您正在为实验目的或玩弄一个主题,我会使用更新的技术 go。

If you are making this for consumption on a wide sale, and potential sale, you really should avoid technologies not supported by older browers, IE 7 and 8 especially.如果您将其用于广泛销售和潜在销售,您真的应该避免旧浏览器不支持的技术,尤其是 IE 7 和 8。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM