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">
<html xml...
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...
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 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...
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...
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...
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...
Wanted to convert
<br/>
<br/>
<br/>
<br/>
<br/>
into
<br/>
...
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.
...
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...
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 ...
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 ...
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 are the key differences between HTML4 and HTML5 draft?
Please keep the answers related to changed syntax and added/removed html elements.
...
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>
...
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...
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...
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...
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...
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; ...