html

XHTML empty tags not treated as empty tags by any browser

So I've tried this XHTML 1.1 code (validated at validator.w3.org) in Chrome 6, IE 8, and Firefox 3.5. The <p> following the <a/> gets hyperlinked, and the <p> following the <div/> turns red: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&g...

toggle div fills up remaining space in IE but not google chrome or firefox

I use the toggle function for jQuery to toggle 4 blocks of content. Screencast of how it works properly in Google Chrome: http://screenr.com/w8l Screencast of how it does not work, in IE 7: http://screenr.com/I8l See page for yourself: http://www.herkimer.edu/impact For each header (h2) you click on, it starts the section on a new li...

Jquery selected options in conditional statements

I'm trying to display some text in a div named "msg_box" for each selected option. It works but not live. I have to refresh to see the result. The js is.. $(function() { switch ($('#my_options :selected').val()) { case '1': $('.msg_box').html('You selected option one'); break; case '2': $('.msg_box').html('You selected option t...

Decrease the vertical height between text and horizontal rule

I need to show a text with horizontal rule almost touching the text. that is the vertical height between the text and hr should be very less. This should be displayable in mobile safari browser. http://pastie.org/1206301 ...

CSS page-break-after and float not playing nicely?

If I have the following HTML code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <title>Test</title> </head> <body> <div style=...

Why is this JavaScript advertisement cropped only when it's loaded inside of an <iframe>?

As part of a project I'm working on, I need to load an AdMeld ad (a major ad network) inside of an <iframe>. I can't call the add directly due to complicated cross-browser limitations. Here is a very simple page that loads one of our ad slot, with rotating ad creatives: http://troy.onespot.com/static/stack_overflow/4949/iframe.html I ...

<a name="whatever"></a> deprecated Batch convert to id

I have a lot of old html files that I need to update. Hopefully, not manually. I can use a find/replace app to go through a directory and find all with <a name= and replace it <span id= since "name" is deprecated. How would I then find all of the correct endtags and convert </a> to </span> without ruining all hyperlinks? TIA, Linda ...

inserting html with php on submit, but how to use jquery to fade out that html?

I'm inserting an h3 tag when a form is submitted. How do i fade that h3 tag out in 5 seconds using jquery? I tried this but it didn't work. Do i have to use .live? $(document).ready(function() { $('h3').delay(5000).fadeout(300); }); EDIT: I'm submitting the form to itself in case that matters. ...

Good way to navigate the DOM

Can I please get some C# code samples on the best way to navigate the DOM? My target data could be buried any where in the node. I am talking about HTML DOM. Please do not close this question. Its a serious inquiry. Thanks ...

carry some extra information in an HTML select/option dropdown list

I want to carry some extra hidden information (eg: postal code) in an HTML select/option dropdown list and make it available to a javascript function when user changes option box selection. This is the type of thing I would like to do (but alas it does not work). Can someone fix it or suggest reasonable alternative? <select id="s...

How do I use PHP to populate a second select-tag with options based on the option selected in the first select-tag?

I will draw the options for the second select-tag from a database. Thanks. ...

once you select an item on a multiselect html listbox, is there anyway to deselect all

My users can't seem to deselect all on a select in html. I have a basic multiselect listbox in html: <select class="longDropdown" id="SelectedCalendars" multiple="multiple" name="SelectedCalendars"> <option value="13">ER</option> <option selected="selected" value="26">Billy 123</option> <option selected="select...

Define <OL> start value

Building on the post I found at http://stackoverflow.com/questions/487528/ordered-lists-ol-starting-index-with-xhtml-strict, I was wondering if there is a way to define the start value of a list without using CSS and still be compliant conforming to the strict DTD specification? I am also looking for a solution of the "value" attribute a...

Link to activate form field

How can I make a form label activate (focus) the form field it coincides with? ...

Are there any way to use custom font file in my site ?

I can use @font-face but it does not work in all browsers. Are there any way to use custom font file in my site ? ...

HTML Custom JUnit Report Uneven Table Alignment

I am coding a java class that generates HTML table reports for JUnit tests and use CSS for visual formatting. I am having an issue aligning the cells since the number of colummns generated is unforseeable since some of these columns represent parameters passed into a variadic function. Therefore there is inherent misalignment in the colu...

Xpath to select commented code

Hi I have this xpath query: descendant-or-self::link and this html code: <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" type="text/css" href="css/style.css"> <link rel="stylesheet" type="text/css" href="css/elements.css"> <title>Page</ti...

Select element by and classname in javascript

I have an onChange event that needs to dynamically select an ID and then add a preset classname to pass to a function. onChange = "show(document.getElementById(this.value). {select a class here? } );" The equivalent in jquery $('#'+this.value+'.myclassname').function(); So how do I select an ID+classname in javascript? I know I'm ...

Should I use DomDocument for parsing html code.

I have tried my best to answer this question myself through research but I am still a little bit worried about whether I am using the right thing. Basically I am using the DomDocument Library to build a jQuery like theme parser for my framework. Now with the web as it is today HTML is coming in different shapes and sizes e.g HTML 4, HTML...

How to show required field with jqtouch in iphone view?

I've just started designing pages particularly for iphone browser (safari). I don't know if jqtouch is best or not, but I started working on it. Till now I learned initialization of jqtouch, and also implemented some touch events (tap, swipe). Now I am planning to create user interface and forms. For that I take a look on demo (Best vi...