html

Padding-background/text filler in CSS?

I'd like to create a table that looks like this: lolvalue---------|lol date|some other column data 1 lolvalue12345|lol date 2|some other column data2 in CSS/HTML. Basically, there is "data" and there is a filler that goes to the right, but doesn't count as data, so it doesn't stretch the column, filling the space stretched by the ...

HTML/CSS: what's a better option for layout of a tree of nested elements than nested tables?

Ok, I have a set of checkboxes for selecting criteria. For argument's sake, we'll say the data looks like this: [] Vehicles [] Unpowered [] Bicycle [] Skateboard [] Powered [] Two-wheeled [] Motorcycle [] Scooter [] Four-wheeled etc The []s represent checkboxes. Ignoring the obviously ...

CSS 100% height with padding/margin

This has been driving me crazy for a couple of days now, but in reality it's a problem that I've hit off and on for the last few years: With HTML/CSS how can I make an element that has a width and/or height that is 100% of it's parent element and still has proper padding or margins? By "proper" I mean that if my parent element is 200px ...

Any way to prevent "deselection" of highlighted text?

Highlight some text on this webpage, then click basically anywhere on the document. Your selection will disappear. Is there a way to prevent this behavior when the user clicks on a specific element, either by CSS or Javascript? E.g.: var element = document.getElementById("foo"); foo.onclick = function(e){ //some magic here that pr...

What is the best practice for CSS-styled menu markup?

So, I've been 'collecting' CSS menus for a while now (another term would be 'borrowing', yet another would be 'blatantly ripping off'), to learn from them and to potentially reuse some of the leetness in my own projects. Being an oldschool HTML purist, I love the idea of styled <ul>s and <ol>s, and the better menus and tab interfaces te...

Overflow:hidden dots at the end

Let's say I have a string "I like big butts and I cannot lie" and I cut it with overflow:hidden, so it displays something like this: "I like big butts and I cann" cutting off the text. Is it possible to display this like this: "I like big butts and I cann..." using CSS? Thanks. ...

Align a <div> to the top, and one to the bottom of a table

I'm having trouble with some vertical CSS positioning. I would like to create a page with the following layout: B AAA AAA AAA C AAA A is a grid (table) of data B is aligned to the top of the grid C is aligned to the bottom of the grid How do I get B and C to align correctly? EDIT: Sorry for the confusion about Div/Table tags! I...

Ordered Lists <OL>, Starting index with XHTML Strict?

Is there a way to start an ordered list from a specific index while following XHTML Strict? Using start=n works well, but has been deprecated… The intended purpose is to resume the index with paging. I saw a few references to a CSS solution, but the starting index cannot be used like the attribute in the deprecated case of start. ...

Writing a replacement asp/html form for a legacy system

Quick question. There is a legacy website (that is not under my control and cannot be modified), that gives users a form to fill in data and then the user 'submits' the form for processing. There is virtually no error checking on this form, and very little help for the user (i.e. it was very poorly designed about 12 years ago and hasn't...

How does IE7's "View Source" button interact with javascript?

I'm debugging someone else's code for a web page that is made with ASP.NET with some javascript effects. It's a form that we are pre-populating with edit-able data, and one of the text boxes is getting populated with an incorrect value. I know that the text box is getting filled with the correct value in the code behind, but somewhere ...

noscript tag, I need to present alternative html if not enabled.

Is it possible to replace javascript w/ HTML if JavaScript is not enabled on the user's browser? I know I can use <noscript>this displays in place of javascript</noscript> That works fine, but it still runs the javascript. In theory I would want this: if javascript is enabled   run javascript if javascript is not enabled   don't r...

<ol> with numbers another color

<ol> <li>test</li> <li>test</li> </ol> will show as: test test I want to have numbers coloured and text black! I can edit the css, but I do not have access to the HTML. ...

How do I convert a HTML table to a fixed font textual table?

I have an application in Perl that reads in HTML based mark up and converts it to a textual output. One of the things I have encountered is the need to easily convert a HTML table to a fixed font output. <table border="1"> <tr><td>Hello</td> <td>World</td> <tr> <td>foo</td> <td>bar</td> </tr></table> I am looking f...

Good or bad practice, using regular html in view

Being comfortable with using html, I find it easier to just use regular html in my views, for example, creating a textbox with <input type="text" maxlength="30" name="firstname"> instead of <%= html.textbox("firstname") %>. Or <form method="post" name="myform"> instead of <% html.beginform() { %>. Is this considered bad practise ? Shoul...

Set Focus to a textbox after data validation in .ASP page

I am working on an asp page that verifies information in a text box after the user types it in. A “product number” is manually entered (free form). Using the after update event, I have the page post the data and lookup the product number to determine if it is valid. If not valid an error message is posted in the box, otherwise the produ...

IE | How to prevent input-focus missing on scrolling page?

I have HTML form with a lot of inputs. I'm interesting in situation when I have focused input, after that I scroll page and focus is messed. ...

Javascript onchange event preventing onsubmit event in HTML form?

Consider an HTML form: <form action="" method="POST" onsubmit="return checkValidArray()"> <input type="text" name="data" onchange="return validate(this);"> </form> It appears (in both IE 6 and Firefox 3) that when you type some text into the input field and click submit that the onchange event fires for the input field, but the on...

Setting the height of a SELECT in IE

IE seems to ignore the height set in CSS when rendering a HTML SELECT. Are there any work around's for this or do we have to just accept IE will not look as good as other browsers? ...

id and name attributes of HTML elements manipulated by ASP.NET

I have a problem in my C# ASP.NET application, where the id and name tags are modified at runtime with a prefix "MainView_" and "MainView$" respectively. So my code: <asp:Button ID="OKToContinueCheckInButton" runat="server" CausesValidation="False" Visibility="false" Style="display: none" OnClick="btnOKToContinueCheckIn" /> <script ty...

CSS alignment of text of HTML INPUT radio element.

I have an input[type="radio"] element inside a block container of fixed width. The supporting text for the input element does not fit in a single line, and falls over to two or more lines. For example: <div class="leftBlock"> <input type="radio" name="foo" value="bar" id="option" /> This is a rather long supporting text that doe...