xhtml

What is the difference between HTML and XHTML?

十年热恋 提交于 2019-12-04 07:09:41
问题 Note: this is supposed to be the canonical post for this question. A number of answers exist already, but descriptions of the various differences are scattered all over the place, and more often than not, they also offer opinions to "which one should I use", which I will refrain from in here. If you have more questions to ask, or you know of more differences, feel free to edit. What is the difference between XHTML and HTML? Isn't XHTML merely a more strict version of HTML? And why are there

Semantic HTML Practice

懵懂的女人 提交于 2019-12-04 07:07:45
I read about semantic HTML online... Semantic HTML means using HTML tags for their implied meaning, rather than just using (meaningless) div and span tags for absolutely everything. If you use <h1> instead of <div class="header"> , and <h2> instead of , et cetera, Google and other search engines will interpret your headers as being important titles in your page. This way, when people search on the words in your headers and sub-headers, your page will be considered more relevant (and rank higher). Plus, it's much shorter and cleaner. So, below is semantic, <h1>My Website Name</h1> <h2>My

How to show a required message next to input with Javascript? [duplicate]

烈酒焚心 提交于 2019-12-04 06:54:56
问题 This question already has an answer here : This doesn't seem right? Javascript isn't working (1 answer) Closed 5 years ago . I'm trying to make fields required but I want the error to show up next to the field it self not be alert? 回答1: You can put validation messages near input s you wanna validate like <span class="reqMsg">* First name is required</span> Of course you need to hide them at first with css .reqMsg { color:red; display:none; } Then in your form submit function you can change

XHTML 1.0 Transitional vs XHTML 1.0 Strict?

∥☆過路亽.° 提交于 2019-12-04 05:52:42
In terms of SEO, for client point of view, should I use XHTML 1.0 Transitional or XHTML 1.0 Strict? Why some people still use Transitional? Will we lose something if We use Transitional over Strict? XHTML Strict forces you to use semantic markup, where as Transitional is a bit more flexible and still allows you to use legacy presentational elements like <font> and <center> . People still use Transitional to maintain support older markup, but it doesn't make any difference to SEO. Strict is considered better for encouraging more accessible XHTML and better separation of content and presentation

Multiple select options in one row

大憨熊 提交于 2019-12-04 05:22:33
问题 I have a select field, with the multiple tag. Right now, the field has many options, so I don't like the idea that all options are below each other. What I am trying to achieve, is to have more options in each row, to make the select field much smaller, and easier to navigate in. This is what the select field looks like now: [option] [option] [option] [option] I would like it to look like this: [option] [option] [option] [option] Thanks. 回答1: This is a (relatively) simple solution that

What's the easiest way of converting an xhtml string to PDF using Flying Saucer?

爱⌒轻易说出口 提交于 2019-12-04 05:20:43
I've been using Flying Saucer for a while now with awesome results. I can set a document via uri like so ITextRenderer renderer = new ITextRenderer(); renderer.setDocument(xhtmlUri); Which is nice, as it will resolve all relative css resources etc relative to the given URI. However, I'm now generating the xhtml, and want to render it directly to a PDF (without saving a file). The appropriate methods in ITextRenderer seem to be: private Document loadDocument(final String uri) { return _sharedContext.getUac().getXMLResource(uri).getDocument(); } public void setDocument(String uri) { setDocument

Jenkins + SonarQube 4.0 ClassNotFoundException occurs durng XHTML validation check using XML profile

自闭症网瘾萝莉.ら 提交于 2019-12-04 04:57:19
问题 I am getting a ClassNotFoundException while attempting to run a SonarQube 4.0 analysis from Jenkins on a Maven project using Sonar's XML language profile . Within the SonarQube analysis, the exception is occurring while attempting to perform the XML Schema Validation check. What might be wrong? This is the exception from the Jenkins build job: 0.0.0.0 ERROR - Could not analyze the file D:\Jenkins_home\.jenkins\jobs\XXX with Sonar Runner\workspace\XXX\WebContent\Login.xhtml org.sonar.api.utils

Prevent iframe “This webpage is not available.” error from displaying on website

我们两清 提交于 2019-12-04 04:52:13
问题 Is there a way to prevent the error "This webpage is not available." from displaying within an iframe that displayed on another site? For example, if I have a website and I want to display my Facebook fans in a box, one way to display it is with an iframe (typically Facebook supplied code). However, if for some reason Facebook is down or slow to respond (like it is right now), I get the following displayed on my website where the iframe should be displayed: This webpage is not available. The

innerHTML removing closing slash from image tag

丶灬走出姿态 提交于 2019-12-04 04:48:00
问题 This is very odd. Here is a quick test function: function test_function(){ code = '<img src="http://www.myimage.com/img.jpg" alt="image" />'; alert(code); document.getElementById('test').innerHTML = code; alert(document.getElementById('test').innerHTML); } Running the code above will show /> in the first alert, but the second alert doesn't, it shows just > . So it looks like applying to .innerHTML strips out the forward slash. Any ideas how to stop this from happening? I need the forward

Is this the correct way of putting HTML in PHP?

丶灬走出姿态 提交于 2019-12-04 04:35:18
问题 I'm new to PHP, and most of the time I have been 'echo'ing my HTML. Today, I found this way of doing it, which makes things 1000 times easier: <?php if(get_field('field_name')){ ?> <p>HTML can go here without echo'ing it</p> <?php } ?> But is it an accepted way? It seems to work every time. Thanks. 回答1: It's mostly about how you like to read your code. With IDE that has autocomplete/code suggestions it is best to use <?php if (...) { ?> so that autocompletion/suggestion features know when to