Make a div into a link

Came here in the hope of finding a better solution that mine, but I don’t like any of the ones on offer here. I think some of you have misunderstood the question. The OP wants to make a div full of content behave like a link. One example of this would be facebook ads – … Read more

Custom attributes – Yea or nay?

I know people are against it, but I came up with a super short solution for this. If you want to use a custom attribute like “mine” so for example: <a href=”https://stackoverflow.com/questions/992115/test.html” mine-one=”great” mine-two=”awesome”>Test</a> Then you can run this code to get an object back just like jquery.data() does. var custom_props = {} ; $.each($(“.selector”)[0].attributes, … Read more

How to parse XML in Bash?

This is really just an explaination of Yuzem’s answer, but I didn’t feel like this much editing should be done to someone else, and comments don’t allow formatting, so… rdom () { local IFS=\> ; read -d \< E C ;} Let’s call that “read_dom” instead of “rdom”, space it out a bit and use … Read more

Margin on child element moves parent element

Found an alternative at Child elements with margins within DIVs You can also add: .parent { overflow: auto; } or: .parent { overflow: hidden; } This prevents the margins to collapse. Border and padding do the same. Hence, you can also use the following to prevent a top-margin collapse: .parent { padding-top: 1px; margin-top: -1px; … Read more

Why can’t the tag contain a tag inside it?

According to HTML5, the content model of div elements is flow content Most elements that are used in the body of documents and applications are categorized as flow content. That includes p elements, which can only be used where flow content is expected. Therefore, div elements can contain p elements. However, the content model of … Read more

Redirect from an HTML page

Try using: <meta http-equiv=”refresh” content=”0; url=http://example.com/” /> Note: Place it in the <head> section. Additionally for older browsers if you add a quick link in case it doesn’t refresh correctly: <p><a href=”http://example.com/”>Redirect</a></p> Will appear as Redirect This will still allow you to get to where you’re going with an additional click.

How to include another XHTML in XHTML using JSF 2.0 Facelets?

<ui:include> Most basic way is <ui:include>. The included content must be placed inside <ui:composition>. Kickoff example of the master page /page.xhtml: <!DOCTYPE html> <html lang=”en” xmlns=”http://www.w3.org/1999/xhtml” xmlns:f=”http://xmlns.jcp.org/jsf/core” xmlns:h=”http://xmlns.jcp.org/jsf/html” xmlns:ui=”http://xmlns.jcp.org/jsf/facelets”> <h:head> <title>Include demo</title> </h:head> <h:body> <h1>Master page</h1> <p>Master page blah blah lorem ipsum</p> <ui:include src=”/WEB-INF/include.xhtml” /> </h:body> </html> The include page /WEB-INF/include.xhtml (yes, this is the … Read more

Why don’t self-closing script elements work?

Others have answered “how” and quoted spec. Here is the real story of “why no <script/>“, after many hours digging into bug reports and mailing lists. HTML 4 HTML 4 is based on SGML. SGML has some shorttags, such as <BR//, <B>text</>, <B/text/, or <OL<LI>item</LI</OL>. XML takes the first form, redefines the ending as “>” … Read more