xhtml

Do I need to declare XML on a page using the XHTML doctype?

六月ゝ 毕业季﹏ 提交于 2019-12-03 13:08:32
问题 I've been seeing some conflicting information that an XHTML document must also declare itself as XML. <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> However, in other places I'm seeing (including w3.org) that the DOCTYPE must be the first tag declaration. Since W3 says it, it must be true. However, I probably have some pages/apps lying about that are following the first method.

What is semantic markup, and why would I want to use that?

社会主义新天地 提交于 2019-12-03 13:04:55
Like it says. Using semantic markup means that the (X)HTML code you use in a page contains metadata describing its purpose -- for example, an <h2> that contains an employee's name might be marked class="employee-name" . Originally there were some people that hoped search engines would use this information, but as the web has evolved semantic markup has been mostly used for providing hooks for CSS. With CSS and semantic markup, you can keep the visual design of the page separate from the markup. This results in bandwidth savings, because the design only has to be downloaded once, and easier

Google Map not working with XHTML Doctype (Document Type)

强颜欢笑 提交于 2019-12-03 12:49:44
问题 Why on the earth there is always a chance that if we use "Doctype" with Google Maps, there will be a problem in showing the Google Map correctly? In a recent case, this "Doctype" just took my 2 days without any productivity. What a disgusting case? This time I got a help from one of my colleague (Subhankar Bannerjee), and many thanks to him due to his timely & efficient help. He also mentioned about this same problem, which he had faced many a times. Can anyone please tell me why this Doctype

IE9 strange table issue

怎甘沉沦 提交于 2019-12-03 12:49:43
问题 Hi all i'm wondering if someone can help as i've come up blank! I have a table which has been styled up using css. It renders fine in all browsers apart from IE9 (even other ie versions), i have no idea why! I've even tried removing all css and it still happens. Any thoughts? Example html: <tr class="altRow"> <td style="text-align: center;"><img style="vertical-align: middle; margin: 3px 0px -3px -3px;" alt="outgoing" src="/Images/outgoing.png"></td> <td>+441279342352</td> <td>+441279342352<

In HTML which way round should <a/> and <h1/> be nested?

丶灬走出姿态 提交于 2019-12-03 12:24:45
Is there a more correct order for nesting a <a> and <h1> elements in HTML? e.g.: <a href="www.example.com"><h1>Example!</h1></a> or <h1><a href="www.example.com">Example!</a></h1> In HTML 4.01 and XHTML 1.1 and older: An h1 may contain an a An a may not contain an h1 So <h1><a>…</a></h1> In the HTML 5 draft: An h1 may contain an a An a may contain an h1 (but only if the a is somewhere an h1 is allowed — see the comments on this answer) So either, but browser support may vary (such is life on the bleeding edge). this is the right answer: <h1><a href="www.example.com">Example!</a></h1> HTML4,

Magento - How to get cart items total in header.phtml

孤街浪徒 提交于 2019-12-03 12:18:45
问题 I am using Magento eCommerce and I have modified my header.phtml via the Blank template. Code, this is my code but it shows blank. <?php $cartQty = $this->getSummaryCount() ?> <?php if ($cartQty>0): ?> <?php if ($cartQty==1): ?> <?php echo $this->__('<a class="cartgo" href="%s">(1 ITEM)</a>', $this->getUrl('checkout/cart')) ?> <?php else: ?> <?php echo $this->__('<a class="cartgo" href="%s">(%s ITEMS)</a>', $this->getUrl('checkout/cart')) ?> <?php endif ?> <?php endif ?> 回答1: There was an

IE8's rendering of transparent pngs is FUBARed on my site

一笑奈何 提交于 2019-12-03 11:52:46
问题 I just downloaded the IE8 full release so I could test a site I just created. [Example Deleted] Focus on the left sidebar background image. It is suppose to be a 1x1 semi-transparent .png image that repeats. IE8 renders it as a gradient!!! It get's even wonkier when you try to scroll your window or mouse-over the sidebar. I had already tested this site in the normal browsers (IE7, Firefox, and Chrome). It looks exactly as I designed it in these. IE8 is FUBARed though. I tried to set IE8 to

Please explain rowspan and colspan, col and colgroup

眉间皱痕 提交于 2019-12-03 11:35:21
Can anyone explain rowspan and colspan , col and colgroup ? And are these W3C valid and semantically correct? Under which circumstances are these useful? colspan <table border="1"> <tr> <th colspan="2">people are...</th> </tr> <tr> <td>monkeys</td> <td>donkeys</td> </tr> </table> rowspan <table border="1"> <tr> <th rowspan="2">monkeys are...</th> <td>... real monkeys</td> </tr> <tr> <td>... 'unreal' monkeys (people...)</td> </tr> </table> w3c as you see, this is for connecting table-cells - and because this is sometimes neccessary, it's valid (RegDwights links will give more information...).

If I keep JavaScript at bottom or keep JavaScript in <head> inside document.ready, are both same thing?

扶醉桌前 提交于 2019-12-03 10:49:59
问题 If I keep JavaScript code at bottom or keep JavaScript code in <head> inside document.ready , are both same thing? I'm confused between these two methodologies, http://api.jquery.com/ready/ and http://developer.yahoo.com/performance/rules.html#js_bottom. Is there any benefit to putting JavaScript code at bottom (just before </body> ) even if I keep the code inside. $(document).ready(function() { // code here }); As JavaScript is attached in <head> <script type="text/javascript" src="example

What are the pros for using extension-less URLs?

安稳与你 提交于 2019-12-03 10:47:34
What are the pros for using extension-less URLs? For example, why should I change... http://yoursite.com/mypage.html http://yoursite.com/mypage.php http://yoursite.com/mypage.aspx to... http://yoursite.com/mypage And is it possible to have extension-less URLs for every page? Update: Are extension-less URLs better for site security? JKG The reason for extension-less URLs is that it is technology independent. If you want to change how your content is rendered you do not have to change the URL. W3: Cool URIs don't change File name extension This is a very common one. "cgi", even ".html" is