html

aligning columns in two separate (but related) html tables

I'm implementing a table with a fixed header using this kind of setup: <div style="padding-right:18px"><!-- to account for the scrollbar on the other div --> <table id="head"> <tr> <th>Col 1</th> <th>Col 2</th> </tr> </table> </div> <div style="height:400px; overflow-y:scroll"> <table id="body"> <tr> ...

Should <br /> and <hr /> be avoided at all costs in web design?

I continuously find places where I need to use the <br /> tag because CSS can't do what I need. Isn't the <br /> considered part of the "design" and not part of document structure? What is the acceptable usage for it? Should the same rules also apply to the <hr />? Here is an example of where I feel forced to use the <br /> tag: I want...

Space Before Closing Slash?

I've frequently seen a space preceding the closing slash in XML and HTML tags. The XHTML line break is probably the canonical example: <br /> instead of: <br/> The space seems superfluous. In fact, I think that it is superfluous. What is the reason for writing this space? I've read that the space solves some "backwards compatibil...

Why is <td> shrinking when I set child element to "width:80%" ?

I have a table where one of the left column shrinks when I set the nested element's style to width:80%. The column shrinks and truncates the input elements right edge. You can see what I'm talking about by removing the style from the input element. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/...

Table cell height in terms of font size with CSS

I have a table (a calendar, notably). I want to make the calendar not look ugly when nothing is written in for any of the dates, so I want the minimum size of a cell to be equal to four times the font height. (That is, if I have a calendar row with nothing in it, and a calendar row with four lines of text, I want them to be the same size...

Using JavaScript to manipulate HTML input (checkbox) elements via type instead of name.

I am implementing an HTML form with some checkbox input elements, and I want to have a Select All or DeSelect All button. However, I do not want to rely on the name of the input element (like this example) but rather the type because I have multiple checkbox groups with different names. Is there a way to check and uncheck all checkbox in...

How to eliminate post-render "flicker"?

I've tried my best to be a purist with my usage of Javascript/Ajax techniques, ensuring that all Ajax-y behavior is an enhancement of base functionality, while the site is also fully functional when Javascript is disabled. However, this causes some problems. In some cases, a DOM node should only be visible when Javascript is enabled in...

Place Radio Button Label Above Using CSS

I need the ability to place the labels for radio buttons above the selections, and not to the left or the right. Is there a way to use CSS that would give this effect? THanks! ...

Simulators/emulators for mobile browser testing?

I'm doing development of a web application aimed at mobile devices. What software can I use to simulate/emulate mobile browser environments? I'm specifically looking for a way to test on Mobile Safari, the Android browser, mobile Opera, Mobile IE, the Blackberry Browser and any other common platform I'm missing. Note: I am using Windo...

How to embed HTML created by Dreamweaver into an ASP.NET applicaton

I've been asked by a friend, who created a very visually appealing website mostly in Dreamweaver, to add some database backed functionality that I really only know how to do in ASP.NET. The problem is when I load his generated HTML into an ASPX page it renders it quite horribly. I've tried adding a basic .html page to an ASP.NET project ...

Minimizing use of explicit padding style attributes

I am finding I'm writing a lot of code that looks like this: <div id="leftCol"> <div style="padding-top:10px"> <asp:Image ID="imgRazor1" ImageUrl="http://www.example.com/dynimg.aspx?imageKey=XXX" runat="server" /> </div> <div style="padding-top:10px"> ...

"Access is denied" by executing .hta file with JScript on Windows XP x64

I have a simple HTML (as HTA) application that shows strange behavior on Windows XP x64 machine. I getting periodically (not every time) error message "Access is denied." when i start the application. The same application on Windows XP 32bit runs just fine... Does somebody has any idea or explanation? Error message: Line: 18 Char: 6 Er...

Regex to match attributes in HTML?

Hi, I have a txt file which actually is a html source of some webpage. Inside that txt file there are various strings preceded by a "title=" tag. e.g. <div id='UWTDivDomains_5_6_2_2' title='Connectivity Framework'> I am interested in getting the text Connectivity Framework to be extraced and written to a separate file. Like this...

image not rendering in ie6

I have a small riddle here: one html page has a comment before img declaration, like this: <!----> <img src='shar.gif' alt='' class='center'/> and another has not: <img src='shar.gif' alt='' class='center'/> Former image is rendered in ie6, while latter is not. Both pages are declared as XHTML 1.0 Transitional, and w3c validator sa...

[VB.NET] What is the best way to display HTML content on a Windows Form?

I want to display an HTML formatted content in my application preferably inside a Web Browser control. I could create an HTML document first and then load it in the Web Browser control, but that is just too clumsy. Is there any way I can load a string that contains HTML code directly into the Web Browser? String = "<b>Hello</b> World" ...

Finding the FORM that an element belongs to in JavaScript

How can I find out which FORM an HTML element is contained within, using a simple/small bit of JavaScript? In the example below, if I have already got hold of the SPAN called 'message', how can I easily get to the FORM element? <form name="whatever"> <div> <span id="message"></span> </div> </form> The SPAN might be nes...

Can I force an HTML document to be one page long?

I am generating a document from HTML. Is there any way to force the HTML page to be one rendered as one printed page long? I've done most of the page with <table> and <div> tags. ...

Line numbering and copy/paste (HTML/CSS)

What JS/CSS trick can I use to prevent copy&paste of numbers in an ordered list? <OL> <LI>A <LI>B <LI>C </OL> A B C If it's not doable, what alternative are available? thanks ...

Determining which submit button was used?

Is it possible to determine which submit button was used? I have a confirmation form with 2 submit buttons. The first would confirm the order, do some DB tasks, then redirect. The second, which is a Cancel button, will just redirect to the same page, without doing any DB tasks. Is it possible in the servlet, preferably via the reques...

HTML / CSS - DIV Element hidden when it shouldn't be?

(clickable) Mainad has a valid height and width, however it isn't shown like subad1/subad2. Which are in essence exactly the same! (just a different background image). Firebug shows my div as greyed out for some weird reason. Replacing the contents of mainad with just some text doesn't solve the problem (problem isn't related to inner...