xhtml

Vertical alignment in IE7

房东的猫 提交于 2019-12-07 12:35:39
问题 I have used CSS to create a tableless layout. While this renders properly in IE8, FireFox and Chrome, it does not on IE7, which I expected. But I was wondering if there was any solution for vertical-align: middle; . This seems to be the core of my problem in IE7. #main { margin: 0 auto; height: 500px; display: table; position: relative; } #main ul { display: table-cell; vertical-align: middle; text-align:center; } #main ul li { display: inline-block; margin: 10px; border: 1px solid #d0dad2;

autocomplete attribute is not passing XHTML 1.0 Transitional validation, why?

和自甴很熟 提交于 2019-12-07 12:16:39
问题 I'm trying to cleanup my xhtml validation -- I'm running my pages through the W3C validator. For some puzzling reason it's not passing on input fields with the autocomplete="off" attribute: <input name="kwsearch" id="sli_search_1" type="text" autocomplete="off" onfocus="if(this.defaultValue==this.value) this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;" class="searchbox" value="Search" /> I'm using this doctype: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional/

Returning an HTML/XHTML file from servlet

心已入冬 提交于 2019-12-07 12:06:35
问题 I've seen servlets examples, they're something like this: public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"); ... } My question is, instead of the code, can I return an HTML page? I mean, something like this: public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,

Is it necessary to use H2 after h1

六眼飞鱼酱① 提交于 2019-12-07 11:26:01
问题 Is it mandatory to use H2 after h1 if text is too small then can we use h4 after h1 . and is it accessible ? 回答1: Technically you can use any combination of those. Semantically, it's wise to use the common order. And if the font size is too small, use CSS to change that. With the tags h1 - h6 you give a semantic meaning to a title. Where h1 is for the top level, h2 for a subdivision of h1 , h3 for a subdivision of h2 etc. You can change the appearance by setting CSS rules, which is great

XHTML: Placing DIVs in A tags

梦想与她 提交于 2019-12-07 09:14:46
问题 Is it alright to place div tags inside anchor tags? Will contents of the div redirect the page to the href of the anchor tag? 回答1: Is it alright to place div tags inside anchor tags? Yes, if: You are using HTML5/XHTML5; and The anchor tag is not in an inline context. i.e. a descendant of an element that only allows phrasing content. Otherwise no. In HTML5/XHTML5 the <a> element in not simply an inline element as it is in HTML4/XHTML1. Instead it has a transparent content model, which means

JTidy Node.findBody() — How to use?

僤鯓⒐⒋嵵緔 提交于 2019-12-07 07:31:15
问题 I'm trying to do XHTML DOM parsing with JTidy, and it seems to be rather counterintuitive task. In particular, there's a method to parse HTML: Node Tidy.parse(Reader, Writer) And to get the <body /> of that Node, I assume, I should use Node Node.findBody(TagTable) Where should I get an instance of that TagTable? (Constructor is protected, and I haven't found a factory to produce it.) I use JTidy 8.0-SNAPSHOT. 回答1: I found there's much simpler method to extract the body: tidy = new Tidy();

UTF8 encoded XHTML content in JSP

醉酒当歌 提交于 2019-12-07 07:21:21
I am trying to display XHTML content in a JSP page. The encoding is UTF8. The jsp page calls a method in a java class and the method returns the xhtml content. Basically this is what I have in my jsp page <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd"> <% response.setContentType("application/xhtml+xml"); %> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> </head> <body> <% response.setContentType("application

How to make href will work on button in IE8

送分小仙女□ 提交于 2019-12-07 06:01:07
问题 I want href will work on type="button" in IE8. <a href="submit.php"><input type="button" value="Submit" class="button" /></a> Other browser working fine but on IE8 the code above not working. How to fix it? Update <form action="submit.php" method="post""> <input type="submit" value="Submit" class="button" /> </form> I know this way can be done. But I want to know other ways how to make it work on IE8 without to have the <form></form> 回答1: onclick="window.location=this.parentNode.href;"/> this

PHP htmlentities() without converting html tags

痴心易碎 提交于 2019-12-07 05:40:53
问题 I've found a few posts which refer to the problem, but none of them fully resolve it. I need the function which will output the content converting all special characters in the way the htmlentities() would, but preserving all html tags. I've tried many different approaches, but as I've mentioned above - none of them works as expected. I was wondering whether there would be a way of doing it using PHP class DomDocument. I've tried to do it using the following: $objDom = new DOMDocument('1.0',

Reduce Gap between HTML <UL> and <LI> elements

扶醉桌前 提交于 2019-12-07 04:56:12
问题 I have below HTML in my web page: Forum <ul> <li> Stack</li> <li> OverFlow</li> </ul> And as you could see below, I get the items listed perfectly, but there is a fixed gap between <UL> and <LI> elements. Is there a way, I can reduce this gap? i.e. gap between "Forum" and "Stack" text in attached screen? 回答1: The gap does not exist between UL and LI elements, but between the Forum text and the UL element. Most browsers define a default margin around certain elements, like the UL . You get rid