The reference to entity “foo” must end with the ‘;’ delimiter

The ampersand & is a special character in HTML and XML. If you want to use it as a normal character, you have to encode it correctly. Write &amp; instead of &: src=”https://stackoverflow.com/questions/6483807/…9623&amp;w=180&amp;h=46&amp;style=white&amp;variant=text&amp;loc=en_US” & denotes the start of an encoded entity, such as &lt; for <, or &amp; for &. In your case the parser … Read more

IE 8: background-size fix [duplicate]

As posted by ‘Dan’ in a similar thread, there is a possible fix if you’re not using a sprite: How do I make background-size work in IE? filter: progid:DXImageTransform.Microsoft.AlphaImageLoader( src=”https://stackoverflow.com/questions/4885145/images/logo.gif”, sizingMethod=’scale’); -ms-filter: “progid:DXImageTransform.Microsoft.AlphaImageLoader( src=”https://stackoverflow.com/questions/4885145/images/logo.gif”, sizingMethod=’scale’)”; However, this scales the entire image to fit in the allocated area. So if your using a sprite, this may … Read more

How do I center align horizontal menu?

From http://pmob.co.uk/pob/centred-float.htm: The premise is simple and basically just involves a widthless float wrapper that is floated to the left and then shifted off screen to the left width position:relative; left:-50%. Next the nested inner element is reversed and a relative position of +50% is applied. This has the effect of placing the element dead … Read more

Error parsing XHTML: The content of elements must consist of well-formed character data or markup

Facelets is a XML based view technology which uses XHTML+XML to generate HTML output. XML has five special characters which has special treatment by the XML parser: < the start of a tag. > the end of a tag. ” the start and end of an attribute value. ‘ the alternative start and end of … Read more

How do I properly escape quotes inside HTML attributes?

&quot; is the correct way, the third of your tests: <option value=”&quot;asd”>test</option> You can see this working below, or on jsFiddle. alert($(“option”)[0].value); <script src=”https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js”></script> <select> <option value=”&quot;asd”>Test</option> </select> Alternatively, you can delimit the attribute value with single quotes: <option value=””asd”>test</option>

How to make PDF file downloadable in HTML link?

This is a common issue but few people know there’s a simple HTML 5 solution: <a href=”https://stackoverflow.com/questions/364946/./directory/yourfile.pdf” download=”newfilename”>Download the pdf</a> Where newfilename is the suggested filename for the user to save the file. Or it will default to the filename on the serverside if you leave it empty, like this: <a href=”https://stackoverflow.com/questions/364946/./directory/yourfile.pdf” download>Download the pdf</a> … Read more

How to do fade-in and fade-out with JavaScript and CSS

Here is a more efficient way of fading out an element: function fade(element) { var op = 1; // initial opacity var timer = setInterval(function () { if (op <= 0.1){ clearInterval(timer); element.style.display = ‘none’; } element.style.opacity = op; element.style.filter=”alpha(opacity=” + op * 100 + “)”; op -= op * 0.1; }, 50); } you … Read more

What is DOCTYPE?

Basically, the DOCTYPE describes the HTML that will be used in your page. Browsers also use the DOCTYPE to determine how to render a page. Not including a DOCTYPE or including an incorrect one can trigger quirks mode. The kicker here is, that quirks mode in Internet Explorer is quite different from quirks mode in … Read more

display: inline-block extra margin [duplicate]

White space affects inline elements. This should not come as a surprise. We see it every day with span, strong and other inline elements. Set the font size to zero to remove the extra margin. .container { font-size: 0px; letter-spacing: 0px; word-spacing: 0px; } .container > div { display: inline-block; margin: 0px; padding: 0px; font-size: … Read more