html

Javascript - Applying class to an HTML tag given an attribute/value

I am trying to apply styles to HTML tags dynamically by reading in the value of certain HTML attributes and applying a class name based on their values. For instance, if I have: <p height="30"> I want to apply a class="h30" to that paragraph so that I can style it in my style sheet. I can't find any information on getting the value of ...

What is your preferred site for code snippets

Do you use any public websites for code-snippets? If so, can you let me know which ones you would recommend? Clarification I'm not looking for anything specific to a particular language, as suggested below - I work with a few different languages so I need something fairly general. I've just found www.snippler.com that seems like a good...

Dynamically inserting javascript into HTML that uses document.write

I am currently loading a lightbox style popup that loads it's HTML from an XHR call. This content is then displayed in a 'modal' popup using element.innerHTML = content This works like a charm. In another section of this website I use a Flickr 'badge' (http://www.elliotswan.com/2006/08/06/custom-flickr-badge-api-documentation/) to load ...

HTML to Image .tiff File

Is there a way to convert a HTML string into a Image .tiff file? I am using C# .NET 3.5. The requirement is to give the user an option to fact a confirmation. The confirmation is created with XML and a XSLT typically it is e-mailed. Is there a way I can take the HTML string generated by the transformation HTML string and convert th...

Using jQuery to beautify someone else's html

I have a third-party app that creates HTML-based reports that I need to display. I have some control over how they look, but in general it's pretty primitive. I can inject some javascript, though. I'd like to try to inject some jQuery goodness into it to tidy it up some. One specific thing I would like to do is to take a table (an ac...

What is the best HTML editor for Eclipse?

I was amazed to find out that apparently Eclipse doesn't come with a decent HTML editor by default (it opened my .html file in some kind of browser view and apparently tried to render it). And the basic text editor is not good enough (I need at least some syntax highlighting and automatic indenting). Any suggestions? ...

How do I implement a HTML cache for a PHP site?

What is the best way of implementing a cache for a PHP site? Obviously, there are some things that shouldn't be cached (for example search queries), but I want to find a good solution that will make sure that I avoid the 'digg effect'. I know there is WP-Cache for WordPress, but I'm writing a custom solution that isn't built on WP. I'm ...

What is the best way to parse html in C#?

I'm looking for a library/method to parse an html file with more html specific features than generic xml parsing libraries. ...

Export ASPX to HTML

We're building a CMS. The site will be built and managed by the users in aspx pages, but we would like to create a static site of HTML's. The way we're doing it now is with code I found here that overloads the Render method in the Aspx Page and writes the HTML string to a file. This works fine for a single page, but the thing with our C...

Will .NET MVC give me the HTML/CSS/JS separation I need?

I'm working with my ASP.NET development team to try and create "better" (i.e. cleaner) HTML when rendering pages. At the moment, .NET has a nasty tendency to do things like dump JavaScript into the page, making it a mandatory requirement on form controls and not allowing forms to work when JS isn't available. In some instances, we're s...

Does IE7 have a "developer mode" or plugin like Firefox/Chrome/Safari?

Firefox has Web Developer plugin and Firebug for troubleshooting html/css/javascript issues. Google Chrome and Safari have a very similar console and right-click options for "Inspect Element". Does IE7 have anything similar for troubleshooting layout/html/css issues? ...

How do I specify in HTML or CSS the absolute minimum width of a table cell.

Summary What's the best way to ensure a table cell cannot be less than a certain minimum width. Example I want to ensure that all cells in a table are at least 100px wide regards of the width of the tables container. If there is more available space the table cells should fill that space. Browser compatibility I possible I would li...

How to position a DIV to fill all available space between a header DIV and a footer DIV?

Let's say I have a parent DIV. Inside, there are three child DIVs: header, content and footer. Header is attached to the top of the parent and fills it horizontally. Footer is attached to the bottom of the parent and fills it horizontally too. Content is supposed to fill all the space between header and footer. The parent has to have...

Convert XML/HTML Entities into Unicode String in Python

I'm doing some web scraping and sites frequently use HTML entities to represent non ascii characters. Does Python have a utility that takes a string with HTML entities and returns a unicode type? For example: I get back: & #x01ce; (There is no space. I put that so Markdown won't interpret it) which represents an "a" with a tone mark...

How can I display just a portion of an image in HTML/CSS?

Let's say I want a way to display just the the center 50x50px of an image that's 250x250px in HTML. How can I do that. Also, is there a way to do this for css:url() references? I'm aware of clip in CSS, but that seems to only work when used with absolute positioning. ...

<iframe> - How to show the whole height of referenced page?

I have an application that I would like to embed inside our companies CMS. The only way to do that (I am told), is to load it in an <iframe>. Easy: just set height and width to 100%! Except, it doesn't work. I did find out about setting frameborder to 0, so it at least looks like part of the site, but I'd prefer not to have an ugly scr...

"Quoted-printable line longer than 76 chars" warning when sending HTML E-Mail

Hi, I have written some code in my VB.NET application to send an HTML e-mail (in this case, a lost password reminder). When I test the e-mail, it gets eaten by my spam filter. One of the things that it's scoring badly on is because of the following problem: MIME_QP_LONG_LINE RAW: Quoted-printable line longer than 76 chars I've been...

How can I display simple tooltips on icons in html?

I am using ActiveScaffold in a Ruby on Rails app, and to save space in the table I have replaced the default "actions" text in the table (ie. "edit", "delete", "show") with icons using CSS. I have also added a couple of custom actions with action_link.add ("move" and "copy"). For clarity, I would like to have a tooltip pop up with the r...

HTML.Button in ASP.NET MVC

Starting from ASP.NET MVC Preview 3, HTML.Button ( and other related HTML controls) are no longer supported. The question is, what is the equivalent for them? I've an app that was built using Preview 2, now I have to make it compatible with the latest CTP releases. ...

Can I change the appearance of an html image during hover without a second image?

Is there a way to change the appearance of an icon (ie. contrast / luminosity) when I hover the cursor, without requiring a second image file (or without requiring a hidden portion of the image)? ...