100% Min Height CSS layout

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 height of #content forces #container to become longer as well. Possible columns in #content can then be visualised … Read more

Can the tag not be self closed?

In HTML, there are tags which are always self-closed. For example, <hr>Some content here</hr> does not make any sense. In the same way, there are tags which cannot be self-closed. <script> tag is one of them. I am not sure about the reason of no self-closed <script> tags, but the reason might come from the … Read more

CSS: Hover one element, effect for multiple elements?

You don’t need JavaScript for this. Some CSS would do it. Here is an example: <html> <style type=”text/css”> .section { background:#ccc; } .layer { background:#ddd; } .section:hover img { border:2px solid #333; } .section:hover .layer { border:2px solid #F90; } </style> </head> <body> <div class=”section”> <img src=”https://stackoverflow.com/questions/1462360/myImage.jpg” /> <div class=”layer”>Lorem Ipsum</div> </div> </body> </html>

HTML: Is it possible to have a FORM tag in each TABLE ROW in a XHTML valid way?

It’s worth mentioning that this is possible in HTML5, using the “form” attribute for input elements: <table> <tr> <td>Id</td> <td>Name</td> <td>Description</td> <td>&nbsp;</td> </tr> <tr> <td><form id=”form1″><input type=”hidden” name=”id” value=”1″ /></form></td> <td><input form=”form1″ type=”text” name=”name” value=”Name” /></td> <td><input form=”form1″ type=”text” name=”description” value=”Description” /></td> <td><input form=”form1″ type=”submit” value=”Save” /></td> </tr> <tr> <td><form id=”form2″><input type=”hidden” name=”id” value=”1″ /></form></td> … Read more

When should one use HTML entities?

Based on the comments I have received, I looked into this a little further. It seems that currently the best practice is to forgo using HTML entities and use the actual UTF-8 character instead. The reasons listed are as follows: UTF-8 encodings are easier to read and edit for those who understand what the character … Read more

Should I avoid using !important in CSS?

Use !important very, VERY sparingly — it overrides just about everything, even inline styles, and messes in a less-than-obvious way with the “cascade” of style rules that gives CSS its name. It’s easy to use badly, and tends to multiply, particularly when misused. You can easily end up with a element with !important rules that … Read more

The entity name must immediately follow the ‘&’ in the entity reference

All answers posted so far are giving the right solutions, however no one answer was able to properly explain the underlying cause of the concrete problem. 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 … Read more

White space at bottom of anchor tag

The image is display: inline so it is treated like a character and sits on the baseline. The gap is caused by the space provided for the descender (which you find on letters like j, g, y and p). Adjust the vertical-align with CSS: img{vertical-align: bottom}