html

Why is there a gap between my image and its containing box?

When my browser renders the following test case, there's a gap below the image. From my understanding of CSS, the bottom of the blue box should touch the bottom of the red box. But that's not the case. Why? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html xml...

How do I keep a DIV from expanding to take up all available width?

In the following HTML, I'd like the frame around the image to be snug -- not to stretch out and take up all the available width in the parent container. I know there are a couple of ways to do this (including horrible things like manually setting its width to a particular number of pixels), but what is the right way? Edit: One answer su...

IE6 issues with transparent PNGs

I've gotten used to the idea that if I want/need to use alpha-trans PNGs in a cross-browser manner, that I use a background image on a div and then, in IE6-only CSS, mark the background as "none" and include the proper "filter" argument. Is there another way? A better way? Is there a way to do this with the img tag and not with backgrou...

I need my html table's body to scroll and its head to stay put

I am writing a page where I need an html table to maintain a set size. I need the headers at the top of the table to stay there at all times but I also need the body of the table to scroll no matter how many rows are added to the table. Think a mini version of excel. This seems like a simple task but almost every solution I have found on...

How can one close html tags in vim quickly

It's been a while since I've had to do any html-like code in vim, but recently I came across this again. Say I'm doing a simple bit of a html page: <html><head><title>This is a title</title></head></html> How do I write those closing tags for title, head and html down quickly? I feel like I'm missing some really simple way here that d...

How do I embed an "a:hover{...}" rule into a style attribute in the middle of a document?

I know that embedding CSS styles directly into the HTML tags they affect defeats much of the purpose of CSS, but sometimes it's useful for debugging purposes, as in: <p style="font-size: 24px">asdf</p> What's the syntax for embedding a rule like: a:hover {text-decoration: underline;} into the style attribute of an A tag? It's obvio...

IE6 displaying components in a hidden div (when they should be hidden!)

Does anyone know if IE6 ever misrenders pages with hidden divs? We currently have several divs which we display in the same space on the page, only showing one at a time and hiding all others. The problem is that the hidden divs' components (specifically option menus) sometimes show through. If the page is scrolled, removing the compone...

How to convert multiple <br/> tag to a single <br/> tag in php

Wanted to convert <br/> <br/> <br/> <br/> <br/> into <br/> ...

How do you create an HTML table with adjustable columns?

I want to know how to create a table where you can adjust the column widths. I have not figured out how to do this. If you know the secret sauce to this technique please let me know. ...

positioning three divs with css

Who likes riddles? ;) I have three divs: <div id="login" /> <div id="content" /> <div id="menu" /> How would I define the CSS styles (without touching the html) to have the menu-div as the left column, the login-div in the right column and the content-div also in the right column but below the login-div. The width of every div is f...

Can you add html tags to the author/user profile text field on wordpress?

I have added author pages to my company blog recently. Although I've no trouble pulling through relevant fields to populate the page - e.g. Author Name, User-profile, etc, I would really like to be able to add a small amount of html to the user-profile. Currently the whole thing is just dumped onto the author profile page - you can view ...

How to make Html rendering fast.

I am working on a web application developed on c#/asp.net. We are using third party controls for displaying Grids, Tabs, Trees and other complex controls in our pages. The problem is that these controls render a huge amount of Html. Due to this size of pages have grown heavily and browser takes a while to load a page. I want to find out ...

Why do small spaces keep showing up in my web pages?

This might be a stupid question but if there's a better or proper way to do this, I'd love to learn it. I have run across this a few times, including recently, where small spaces show up in the rendered version of my HTML page. Intuitively I think these should not be there because outside of text or entities the formatting of a page's H...

What's the key difference between HTML 4 and HTML 5?

What are the key differences between HTML4 and HTML5 draft? Please keep the answers related to changed syntax and added/removed html elements. ...

Href for Javascript links: "#" or "javascript:void(0)"?

When building a link that has the sole purpose to run javascript, is it better to: <a href="#" onclick="myJsFunc();">Link</a> Or <a href="javascript:void(0)" onclick="myJsFunc();">Link</a> ...

VBScript: Using a variable within a DOM element

Hello all, I'm looking to use a VBScript variable within a reference to a DOM element for a web-app I'm building. Here's a brief exerpt of the affected area of code: dim num num = CInt(document.myform.i.value) dim x x = 0 dim orders(num) For x = 0 To num orders(x) = document.getElementById("order" & x).value objFile.writeLine(o...

Why do Chrome, Firefox and IE all render fixed-width SELECT controls differently?

I am losing hair on this one ... it seems that when I fix width an HTML SELECT control it renders its width differently depending on the browser. Any idea how to to standardize this without having to turn to multiple style sheets? Here is what I am working with: .combo { padding: 2px; width: 200px; } .text { padding: 2p...

For tabular data, what renders faster, CSS or <TABLE>?

I am looking for some stats on current browsers for how long it takes to render a table using plain HTML versus a hacked-up CSS puritan method that avoids using actual TABLE, TR, TD, etc. tags. I am not looking for what's proper, only for what's faster, particularly on Firefox 3, although I am also interested in the stats for other brow...

Zooming an element and its contents-- an alternative to CSS3's zoom property?

Is there a cross-browser method to emulate CSS3's zoom property? I know how to zoom images and text separately, but cannot seem to keep everything aligned. One solution might be to read the computed styles of the element and its children, convert all measures to px, multiply them by some factor, and then generate HTML/CSS with these ne...

Why doesn't IE7 copy <pre><code> blocks to the clipboard correctly?

We've noticed that IE7 has an odd behavor with code blocks posted on Stack Overflow. For example, this little code block: public PageSizer(string href, int index) { HRef = href; PageIndex = index; } Copy and pasted from IE7, ends up like this: public PageSizer(string href, int index){ HRef = href; PageIndex = index; ...