xhtml

html5 vertical spacing issue with <img>

北城余情 提交于 2019-12-17 06:11:06
问题 I am trying to create a layout where the vertical spacing between divs is pixel perfect. So far I've ruled out almost all the big grid systems (960.gs, Blueprint), because they have no solution at all for the vertical spacings. With them, the only way to set vertical spacing between divs is to use body { line-height } attribute and manipulate the div spacing using that. I wouldn't call that a solution, as it ruins your template, depends on font-family, and doesn't let you use different

Remove outline from select box in FF

放肆的年华 提交于 2019-12-17 04:44:36
问题 Is it possible to remove the dotted line surrounding a selected item in a select element? I have tried to add the outline property in CSS but it did not work, at least not in FF. <style> select { outline:none; } </style> Update Before you go ahead and remove the outline, please read this. http://www.outlinenone.com/ 回答1: I found a solution, but it is mother of all hacks, hopefully it will serve as a starting point for other more robust solutions. The downside (too big in my opinion) is that

How to scale SVG image to fill browser window?

夙愿已清 提交于 2019-12-17 04:44:33
问题 This seems like it ought to be easy, but I'm just not getting something. I want to make an HTML page containing a single SVG image that automatically scales to fit the browser window, without any scrolling and while preserving its aspect ratio. For example, at the moment I have a 1024x768 SVG image; if the browser viewport is 1980x1000 then I want the image to display at 1333x1000 (fill vertically, centred horizontally). If the browser was 800x1000 then I want it to display at 800x600 (fill

How to convert unordered list into nicely styled <select> dropdown using jquery?

烈酒焚心 提交于 2019-12-17 03:57:41
问题 How do I convert an unordered list in this format <ul class="selectdropdown"> <li><a href="one.html" target="_blank">one</a></li> <li><a href="two.html" target="_blank">two</a></li> <li><a href="three.html" target="_blank">three</a></li> <li><a href="four.html" target="_blank">four</a></li> <li><a href="five.html" target="_blank">five</a></li> <li><a href="six.html" target="_blank">six</a></li> <li><a href="seven.html" target="_blank">seven</a></li> </ul> into a dropdown in this format

Is writing self closing tags for elements not traditionally empty bad practice?

风流意气都作罢 提交于 2019-12-17 03:01:18
问题 I have noticed jQuery (or is it Firefox) will turn some of my <span class="presentational"></span> into <span class="presentational" /> Now my question is, is this okay to write my markup like this? Will any browsers choke on it? Personally, I think it looks cleaner to do <span class="presentational" /> if it's going to be empty. 回答1: I'm assuming your question has to do with the red trailing slash on self-closing elements when you view source in Firefox. If so, you've stumbled into one of

So what if custom HTML attributes aren't valid XHTML?

徘徊边缘 提交于 2019-12-17 02:44:09
问题 I know that is the reason some people don't approve of them, but does it really matter? I think that the power that they provide, in interacting with JavaScript and storing and sending information from and to the server, outweighs the validation concern. Am I missing something? What are the ramifications of "invalid" HTML? And wouldn't a custom DTD resolve them anyway? 回答1: The ramification is that w3c comes along in 2, 5, 10 years and creates an attribute with the same name. Now your page is

100% Min Height CSS layout

孤者浪人 提交于 2019-12-17 02:33:29
问题 What's the best way to make an element of 100% minimum height across a wide range of browsers ? In particular if you have a layout with a header and footer of fixed height how do you make the middle content part fill 100% of the space in between with the footer fixed to the bottom ? 回答1: I am using the following one: CSS Layout - 100 % height Min-height The #container element of this page has a min-height of 100%. That way, if the content requires more height than the viewport provides, the

JavaServer Faces 2.2 and HTML5 support, why is XHTML still being used

半世苍凉 提交于 2019-12-17 02:31:54
问题 Having read about HTML5 support in JSF 2.2, I was surprised to find the same XHTML doctype as in previous Facelets versions in the template file created with a new web application in Netbeans. The only difference is that the HTML tag reads in JSF 2.2: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html"> , rather than as follows in older JSF versions: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"> It seems a bit wrong to keep

How to load an XHTML file into an XElement using a custom XmlUrlResolver?

人盡茶涼 提交于 2019-12-14 04:25:51
问题 I am trying to get an XHTML file loaded into an LINQ XElement. However, I am running into problems with the resolver. The problem has to do with the following definition: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> I have a custom XmlUrlResolver with an overridden GetEntity which converts links such as http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd to a local resource stream. This works fine for almost the

Save or Download Javascript String as a file

為{幸葍}努か 提交于 2019-12-14 03:55:42
问题 I have an HTML string in javascript variable. I have to save/Download the string as a file on link click. It should be cross browser compatible. I thought window.open with attachment Content-Disposition header, but not good solution because popup may be blocked. 回答1: As mentioned here, you could use downloadify: https://github.com/dcneiner/Downloadify. The client will need flash though. 来源: https://stackoverflow.com/questions/4439296/save-or-download-javascript-string-as-a-file