xhtml

How to achieve two different alignments inside a html option tag?

喜欢而已 提交于 2019-12-06 10:48:34
I have a select html tag with country calling codes. <select name="countryCallingCode" id="countryCallingCode"> <option value="1"><span class="name">Afghanistan</span><span class="code">+93</span></option> <option value="2"><span class="name">Albania</span><span class="code">+355</span></option> <option value="3"><span class="name">Algeria</span><span class="code">+213</span></option> </select> I want the name to be left aligned and the code to be right aligned. Presentation should look like: Afghanistan +93 Albania +355 Algeria +213 I have introduced the span elements to achieve this with CSS

Empty DIV height IE7

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 09:07:52
问题 UPDATE 1: I've found that when removing width:100% from the div, I get the results I want interms of it having 0 height if it contains no content. However, I need the div to have a width of 100%, which for some reason is forcing it to have a height without content. Here is a jsfiddle of the problem. You will only see the problem if you go to the following link with IE7, maybe on IE6 and below. http://jsfiddle.net/RQeeg/2/ ORIGINAL QUESTION: I have an empty div which has a height for some

Which MIME type should I use to serve XHTML5 to IE7 and IE8?

 ̄綄美尐妖づ 提交于 2019-12-06 08:31:50
问题 I want to use XHTML5 but apparently they two browsers don't accept the application/xhtml+xml MIME type. I read that they will accept text/xml (or application/xml not sure) but it is kind of hackish. So I was wondering if I should just serve HTML5 to IE7 and IE8? Please don't go on talking about XHTML vs HTML advantages. I know. 回答1: XHTML 5 is not a standard. XHTML 2 does prescribe a new doctype, though XHTML 2 is not supported by any modern browsers (as it is largely unfinished). HTML5Doctor

How do I get IE 7 to open XHTML files?

假如想象 提交于 2019-12-06 08:31:39
问题 An application I'm building is generating XHTML documents that are going to be distributed in a bunch of different ways, including email. I can open these documents in Firefox or Chrome (and by "open" I mean from Windows Explorer, not through a web server). With IE 7, though, I'm having two - possibly three - different problems. If the files are named with the extension ".xhtml", then IE launches and then closes. Sometimes it's still running in Task Manager and I have to kill it. Sometimes

How to markup scientific names in XHTML?

孤人 提交于 2019-12-06 07:28:36
问题 I would like to know the best way to markup scientific names in XHTML. This answer says I should use the <i> element, which I'm not too in favour of, unless of course, it is the right element to use. I could use <span class="scientific"> , but seeing as one of the first uses of HTML was to markup scientific documents, I'd imagine there'd be a better semantic hook for this sort of thing. Also, is there any element to markup the common name of a scientific name? Note: It looks like Wikipedia,

How Do I Remove An XML Declaration Using BeautifulSoup4

爷,独闯天下 提交于 2019-12-06 07:28:08
I have an XHTML file that is structured like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> ... </head> <body> ... </body> <html> I'm using BeautifulSoup and I want to remove the XML declaration from the document, so what I have looks like this: <!DOCTYPE html> <html lang="en"> <head> ... </head> <body> ... </body> <html> I can't find a way to get at the XML declaration to remove it. It doesn't appear to be a Doctype, Declaration, Tag, or NavigableString as far as I can tell. Is there a way I can find this to extract it? As a working example, I can remove

Why does ASP.Net add a “border” attribute to asp:Image

爷,独闯天下 提交于 2019-12-06 07:25:44
So I have an asp.net image tag: <asp:Image runat="server" ImageUrl="~/Images/img.jpg" width="350px" height="250px" AlternateText="My Image" /> but it's outputting this: <img src="Images/img.jpg" height="250" width="350" border="0" /> ...the XHTML validator reckons that the "border" element shouldn't be there...but it's ASP.Net that's adding it. I'm sure this question has been asked many times before, but why does asp.net think it needs to add it, especially because it's invalid?? How can this be avoided so that it does validate? ahsteele It's the way that the ASP.NET image web control works.

PHP: building (X)HTML output with DOM - pros and cons?

牧云@^-^@ 提交于 2019-12-06 07:03:29
问题 I just started out with a new site and I decided to use DOMImplementation for building the complete site. What do you think about this, is it fast enough? I expect it to be quite a bit slower than the basic print method. I prefer the DOM one because it allows greater flexibility when building the final output, not to mention the more error-free XHTML. Anyway, I would like to have some speed comparision at least. Could you recommend me any (perhaps completely obvious) ideas to keep the PHP

On load, jump to anchor within a div

烈酒焚心 提交于 2019-12-06 06:29:35
Let's say I have the following page: <html> <body> <div id='foo' style='scroll:auto;height:400px'> // content, content, content... <div id='bar'></div> // content, content, content... </div> </body> </html> What jQuery (or vanilla Javascript) can I use so that when the page loads, it jumps to #bar only within the div#foo (and not the entire page)? I don't need a fancy animation or scrolling, I just want #bar to be at the top of the div on page load. jQuery solution (assumes all elements are positioned somehow) $('#foo').scrollTop($('#bar').position().top); EDIT Side note: Make sure you set

Replacing style= attributes with tags in XHTML via XSLT

北战南征 提交于 2019-12-06 06:28:40
Say I have the following in an XHTML page: <span style="color:#555555; font-style:italic">some text</span> How would I go about transforming this to: <span style="color:#555555;"><em>some text</em></span> This is not as easy as it seems since XSLT is not the best tool for string parsing - but that's exactly what you need to get the contents of the style attribute right generically. However, depending on the complexity of your input, something like this might be enough (I tried to be as generic as possible, though): <!-- it's a good idea to build most XSLT around the identity template --> <xsl