closing tag in HTML I'm trying jquery now. When I included the jquery.js as follows <script type="text/javascript" src="jquery.js" /> the code doesn't worked properly. Actually it is just a simple hello world program. I just called a jQuery specific function. But that was not working if I include the file as above. But when I changed the closing like this <script type="text/javascript" src="jquery.js"></script> the code worked well. What is the difference? Answer: <script /> is valid XML, but invalid HTML. If you serve your
undefined
Adding HTML entities using CSS content How do you use the CSS content property to add html entities? I have a number of links which I make into a breadcrumb style list by adding an arrow before each. <div class="breadcrumbs"> <a>One</a> <a>Two</a> <a>Three</a> </div> Which has the following style applied to it: .breadcrumbs a:before { content: '> '; } The problem is that when the breadcrumb list gets long and wraps to the next line, the arrow is left on the preceding line. The obvious
undefined
Make body have 100% of the browser height I want to make body have 100% of the browser height. Can I do that using CSS? I tried setting height: 100%, but it doesn't work. I want to set a background color for a page to fill the entire browser window, but if the page has little content I get a ugly white bar at the bottom. Answer: Try setting the height of the html element to 100% as well. html, body { height: 100%; }
undefined
What characters can be used for up/down triangle (arrow without stem) for display in HTML? I'm looking for a HTML or ASCII character which is a triangle pointing up or down so that I can use it as a toggle switch. I found ↑ (↑), and ↓ (↓) - but those have a narrow stem. I'm looking just for the HTML arrow "head". Answer: Unicode arrows heads: ▲ - U+25B2 BLACK UP-POINTING TRIANGLE ▼ - U+25BC BLACK DOWN-POINTING TRIANGLE ▴ - U+25B4 SMALL BLACK UP-POINTING TRIANGLE ▾ -
undefined
Why don't self-closing script tags work? What is the reason browsers do not correctly recognize: <script src="foobar.js" /> <!-- self-closing script tag --> Only this is recognized: <script src="foobar.js"></script> Does this break the concept of XHTML support? Note: This statement is correct at least for all IE (6-8 beta 2). Solution: XHTML 1 specification says: С.3. Element Minimization and Empty Element Content Given an empty instance of an element whose content model is not EMPTY (for example, an empty title or paragraph)
undefined
Make a div fill the height of the remaining screen space I am currently working on a web application, where I want the content to fill the height of the entire screen. The page has a header, which contains a logo, and account information. This could be an arbitrary height. I want the content div to fill the rest of the page to the bottom. I have a header div and a content div. At the moment I am using a table for the layout like
undefined
jQuery document.createElement equivalent? I'm refactoring some old JavaScript code and there's a lot of DOM manipulation going on. var d = document; var odv = d.createElement("div"); odv.style.display = "none"; this.OuterDiv = odv; var t = d.createElement("table"); t.cellSpacing = 0; t.className = "text"; odv.appendChild(t); I would like to know if there is a better way to do this using jQuery. I've been experimenting with: var odv = $.create("div"); $.append(odv); // And many more But I'm not sure if this is any better. Answer: here's your example