html

Apache mod_rewrite redirect to internal server

Hi I am not sure if this is the write thing but that's the reason i am asking here for help. I have server one (Apache) and server 2 (IIS). Server one has external access but server 2 does not. I need to host http content on both of them on port 80. Without changing ports on the firewall etc., is it possible for me to redirect a call f...

Can you provide an example of parsing HTML with your favorite parser?

This question is a lazy way of collecting examples of parsing HTML with a variety of languages and parsing libraries. Individual comments will be linked to in answers to questions about how to parse HTML with regexes as a way of showing the right way to do things (similar to how I use Can you provide some examples of why it is hard to p...

Style input element to fill remaining width of its container

Let's say I have an html snippet like this: <div style="width:300px;"> <label for="MyInput">label text</label> <input type="text" id="MyInput" /> </div> This isn't my exact code, but the important thing is there's a label and a text input on the same line in a fixed-width container. How can I style the input to fill the remai...

How can I simulate an anchor click via jquery?

I have a problem with faking an anchor click via jQuery: Why does my thickbox appear the first time I click on the input button, but not the second or third time? Here is my code: <input onclick="$('#thickboxId').click();" type="button" value="Click me"> <a id="thickboxId" href="myScript.php" class="thickbox" title="">Link</a> It...

Page-specific css rules - where to put them?

Often when I'm designing a site, I have a need for a specific style to apply to a specific element on a page and I'm absolutely certain it will only ever apply to that element on that page (such as an absolutely positioned button or something). I don't want to resort to inline styles, as I tend to agree with the philosophy that styles be...

CSS & Overriding Styles on Nested Elements

This came up from another question that was asked here but I figure it's something that probably has a "Best Practice" Approach. When designing a website, the designer will most likely put together a set of generic styles for all elements within a website. (Standard Fonts for Text in Divs/Spans/H1/H2s) In the case of tables, they may b...

Stop browser from jumping to #name when page loads

I have a form in a jQuery dialog box named "login". In JavaScript, I detect if "#login" is in the URL -- if so, it displays the login dialog box. In FF/Safari/Chrome it works fine, but in IE6/7 the browser page jumps down to the top of the form when the dialog box is displayed. I would like to prevent this from happening. I found what l...

Should I put input tag inside label tag?

I was just wondering if there is a best practice concerning label and input tag : classic way: <label for="myinput">My Text</label> <input type="text" id="myinput" /> or <label for="myinput">My Text <input type="text" id="myinput" /> </label> ...

What are some good HTML beginner tutorials?

My friend is interested in getting into web design. Unfortunately, I cant seem to find a cool hands on HTML tutorial for him to try out. I am running out of practical examples for him, and I don't have the time to sit around and teach him. Do you have any suggestions? EDIT: I have already introduced him to W3 Schools, it does not show ...

Links on top of elements with onclick-handlers

Hey. I've got a dumb, but nasty problem. If I've got this (simplified) situation: <div onclick="doSomething(); return false;"> lorem ipsum <a href="somewhere.html">dolor sit</a> amet </div> ...is there any (convenient) way to prevent the onclick-handler of the parent div from being triggered when the link is clicked. In my scena...

Flash (as3) printing .. data ? html ?

I need to add a print button to my page that should print a certain page the best way should be that i add an html and that it would print from out flash or is it possible to open a html page and automatically open the print dialog box? it's in AS3 ...

Div Width Problem

What keeps a div from extending horizontally past the edge of the screen when there are horizontal scroll bars? The DIV's content will overflow out to the left but not the DIV itself. What can make the div go all the way to the right? Thanks ...

Keep an Animated GIF Going After Form Submits

The following works for me in ie6,ie7,chrome but not ff3 document.getElementById("form-name").submit(); var image = document.getElementById("loader-img"); setTimeout(function() { image.src = image.src; },50); What can I do for more consistency? ...

Convert plain text input to HTML

For our company intranet, built in PHP and MySQL, I want to add an area where employees can post a short profile of themselves - a couple of paragraphs of text and an image. What's the best way to convert this kind of plain text input to HTML paragraphs, bulleted lists, links, etc? Clarification: This content will be displayed in a mod...

IE display transparency bug on height > 4096px?

I was working on a JavaScript dialog with a transparent background overlay when I ran into a problem on large pages. If the page was large, the transparent overlay would be a solid colour (i.e. no longer transparent). I did some testing and found this only happened in the overlay was greater than 4096 pixels high (hmmm, suspicious, that...

how to hide the content of the div in css

I have this html code <div id="mybox"> aaaaaaa </div> and this is my css #mybox{ background-color:green; } #mybox:hover{ background-color:red; } the question is how to hide the content of the div (aaaaaaa) when the mouse hover event by using css only and without changing the structure of the code I think I should put some c...

Math equations on the web

What is the best way for me to render math equations on the web? I am familiar with LaTeX's math mode. ...

Long Line in HTML Table tanting the layout of other lines

I have a html table serving as layout for a page (Bad practice I know). This table goes something like this: Label1 Value1 Label2 Value2 Label3 Value3 Label4 Value4a Value4b Value4c Value4d I just added a validation error message that can be quite big to line one, so now it is: Label1 Value1 ErrorMessage Labe...

Why does my form value not appear in $_REQUEST?

I have this code from an HTML form: <select name="history12"> <option value="Gov/Econ">Government &amp; Economics</option> <option value="AP Gov/Econ">AP Government &amp; Economics</option> </select> ...and this code, in a mailer form: $history12 = $_REQUEST['history12'] ; However, when I try to echo() $history12, it always...

FireFox stuck on "waiting for" or "transferring data from"

I have a website that includes a button which is CSS-styled to show a distinct image on hover. I wait for the page to load completely, then move my mouse over that button. Firefox will show the new image, but the status bar becomes stuck showing either "transferring data from www.server.com" or "waiting for www.server.com" and this neve...