html

How to set element (DIV/TABLE/other) height to 100% of its container?

I am trying to accomplish a simple 'liquid layout' with two width=50% boxes on the left and one width=50% box on the right, where the height of the rightmost box follows the leftmost boxes and vice versa. I want a spacing between the boxes of 10px, a nice 3d feel for the boxes and no border or margin on the outside. I have tried to impl...

How do you stretch an image to fill a <div> while keeping the image's aspect-ratio?

I need to make this image stretch to the maximum size possible without overflowing it's <div> or skewing the image. I can't predict the aspect-ratio of the image, so there's no way to know whether to use: <img src="url" style="width: 100%;"> vs <img src="url" style="height: 100%;"> I can't use both (i.e. style="width: 100%; height: 1...

Validating html with php

Something is wrong with my print "<option value..."; line of php code. It keeps generating error messages: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified <option value = Addition>Addition</option> <and so on...> Okay, so how do i fix this line of code: //foreach loop to cycle t...

Are dynamically inserted <script> tags meant to work?

I have some code where a <script type="text/javascript"> block is dynamically inserted. This block contains a function, which has an <input type="button"> element above it (also dynamically inserted) call it with the onclick attribute. However, it is not working, and Firebug says that the function is not defined when I attempt to click...

How do I do the CSS for this?

Here is the wireframe: http://img46.imageshack.us/img46/9323/85329195.gif #header needs a background image of /header.png which is 750px wide. I'm just not sure how to do the CSS for this design. #footer is 100% at the bottom, (not absolute) ...

jquery - add values from one listbox to another, but do not include blank lines?

I have some jQuery code that copies the selected values from one listbox to another: $(adPerson + " option:selected").each(function(){ $(toNames).append($(this).clone()); }); I'm trying to make sure no blank lines are added to the destination listbox, so I tried this: $(adPerson + " option:selected").each(function(){ if...

How do I find the DIV in which my cursor is placed at any moment

How do I find the DIV in which my cursor is placed at any moment, so I can change the formatting of that area. ...

What is wrong with my CSS menu?

The result is: http://img198.imageshack.us/img198/746/93502273.jpg You can see the obvious "whitespace" on the side. I have: <div id="nav"> <ul> <li id="n-home"><a href="/">Home</a></li> <li id="n-search"><a href="/search/">Search</a></li> <li id="n-advertisers"><a href="/advertisers/">Advertisers</a></li> ...

Need For Uniform Browser Engine

Hello There, Of course, we have been witnessing a lot of browsers differences in rendering elements, in displaying those, the support for CSS, the support for html/xhtml standards and more importantly different layout engines such as Trident, Tasman, Gecko, KHTML, WebKit and Presto which is mainly why there are differences. I just wond...

Why doesn't the javascript output anything?

Why doesn't the javascript output anything? It should output some html code. <html> <head> <script type="text/javascript"><!--` var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; function d64(input) { var output = new StringMaker(); var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i ...

Remove HTML tags from string saved in database - ASP.NET

I am using ASP.NET 2.0 and SQL Server 2005. I am saving a value/string in the database such as............ <P>Test 1</P><P>Test2</P> Now i want to decode/remove the html tags and display it properly to the user such as.... Test 1 Test 2 I have tried this but it does not work! txtDesc.Text = VALUE FROM DATABASE What am i...

2 <div>s in <div>

the best way center 2 divs inner div. Like this 1 2 3 4 5 6 7 8 9 10 11 12 1 --------------------------- 2 - main div - 3 - ------ ------ - 4 - -div1- -div2- - 5 - ------ ------ - 6 - - 7 --------------------------- Width and Height of main div is fixed. thanks ...

Why does this DIV move HTML content down ?

I have a DIV which I want to insert into my HTML content. Whenever I do, the content moves down from where the DIV WOULD have appeared in the content. It moves down the height of the div. I sat 'WOULD have appeared' because its position is set to relative. Here is some code: (THE DIV I MEAN IS THE ONE WITH ID="pop" <table border="0" al...

Uploading file using HTML

Can anyone show me how to create an HTML page that allows to upload files? It will be really appreciated. ...

Getting the parent element of the text near the cursor-Caret.

For example: page has some paragraphs with text: <p>some text1</p> <p>some text2</p> <p>some text3</p> so the browser will render: some text1 some text2 some text3 Now, if user places the Caret, lets say on text2 (between 't' and 'e' ,document is in designmode=on), the function should return ref to the second p object. I think...

What real problems does using tables instead of divs present to the end user?

Forgetting about things that pertain exclusively to the developer like code maintainability and religion wars about semantics and what-not, my question is: what real world problems does using tables present to the user? Are there device that cannot understand a tabled layout properly? Does it decrease the page's relevance on search engin...

Div overlapping in Firefox

Hi, Please see the html below it works fine in IE, but in Firefox it overlaps..please try and give me solution. When the position of the div inside the td was given static, it's working properly.But i need absolute there since i need to use the left and top attributes.Any help is appreciated.Thanks <table style="height:auto; positi...

Runtime creation of tables in Javascript?

Hi, I my application "When a button is clicked it should create a new text field in the table". So i have done like this and its not working as well. So what could be the problem in the following snippet. <html> <script type="text/javascript" language="javascript"> var newtr=document.createElement("tr"); var newtd=document.crea...

Validate DOM manipulation when using Selenium

I'm using Selenium to test my application. A nice test would be that after every DOM manipulation I would validate the DOM. Is there a nice way to do this? Obvious ways are: use some builtin Selenium function. Is there one? get the HTML of the DOM after the manipulation and use a local validator. However, I can't see how to get the HT...

HTML: table of forms?

I frequently find myself wanting to make a table of forms -- a bunch of rows, each row being a separate form with its own fields and submit button. For instance, here's an example pet shop application -- imagine this is a checkout screen which gives you the option to update the quantities and attributes of the pets you've selected and sa...