html

why does website change based on use of www?

been working on my website for last couple of days- and for some reason everything scales differently based on wheather or not i use the www prefix on my webpage. What is causing this and how is it even possible if its the same file? this never happened with my old page setup ...

Highlight Select tag option from keyboard inout

Well, Its one of those common feature you have in all website with Select tags. I have a list of countries in a select tag. Now, I want that, if I press 'I' from keyboard, the first Country names that start with 'I' will get selected.. I tried some java script fount in internet. but they didn't work.. A snippet will be of immense help...

Passing the name of the link when clicked

I have the following code <a href="process.html">cholera</a> I want to pass cholera to process.html onClick. Is there any way to do that in HTML? If no, PHP scripts are also most welcome. ...

universal javascript for set homepage functionality

Is there any javascript that works on almost all browsers for setting a webpage as homepage? I am using below one. But it only works for i.e. and mozilla var flag = false; function setHomepage(web) { if (document.all) { document.body.style.behavior='url(#default#homepage)'; document.b...

Putting a floating image in the bottom-right corner for example

Basically I want to put a transparent image in the bottom-right corner. I read the questions about top-right, right, and so on. However, I can only apply margin-top: 100%; which will put it where I want BUT it shows the scroll bar then and the picture will be really at the bottom, I can't even see it. Any ideas are welcome. To se...

how can I get href links from html code

Hello, import urllib2 website = "WEBSITE" openwebsite = urllib2.urlopen(website) html = getwebsite.read() print html so far so good. But i want only href links from the plain text html. How can i solve this problem? ...

Best practice for trapping certain keyCodes in onkeypress in Javascript

I'm somewhat curious about the "best practices" when it comes to trapping the ENTER key in an html input tag. In IE, it's easy. window.event.keyCode will be 13 when enter is pressed and it's pretty straight forward. In all other browsers, an arguments object is passed into the function. However, this seems to basically force you to l...

Free open source software for protecting HTML from "select all", "copy" and "save as"

Hi, Is there a free open source software for protecting HTML from "select all", "copy" and "save as". Thanks, Ahmed. ...

Call ActionScript function inside the HTML page inside HTML Control

How to Call ActionScript function inside the HTML page inside HTML Control ...

Facebook, Omegle, Major Chat Applications Title Change on New Message

My question is, how does Facebook, Omegle, and major chat applications code the title change on new message system. I want to, on change of a div, to change the <title> tag to something else than it already is set as. This is most likely accomplished in Javascript, but I'm not an expert in Javascript, so how is this written? ...

Keeping the format of pasted text in a textarea without visible mark-up info.

I had a case where i copied bold text from a web page into a textarea of another page. On paste, the text area kept the text's bold format. When i pasted the same text into a text file i could see no mark ups or formatting info along with the text. How is the textarea keeping the format of the text? Thanks in advance. EDIT: How i...

Regular expression for nested tags (innermost to make it easier)

I researched this quite a bit, but couldn't find a working example how to match nested html tags with attributes. I know it is possible to match balanced/nested innermost tags without attributes (for example a regex for and would be #<div\b[^>]*>(?:(?> [^<]+ ) |<(?!div\b[^>]*>))*?</div>#x). However, I would like to see a regex patte...

Negative padding-top, fixed height, overflow hidden

Hello, how can I show only 200px (height) of my div, and skip the first 30px (top) ? <div style="height:200px; overflow:hidden; padding-top:-30px"> A<br>B<br>C<br>D<br>E<br>F<br>G<br> H<br>I<br>J<br>K<br>L<br>M<br>N<br> O<br>P<br>Q<br>R<br>S<br>T<br>U<br> V<br>W<br>X<br>Y<br>Z </div> ...

What are practical pros to have Doctype DTD as a first element in our (X)HTML file?

What are benefits to have Doctype DTD as a first element in our (X)HTML file? What is their role in web development and browser (Desktop and Mobile both) compatibility? What are cons to not to use any Doctype? Are all browser does affected from Doctype? ...

How can I create two buttons in a row for an HTML form?

I would like to create an HTML form with one field for user name, a second under it for password, and then below that a row containing two buttons, one to login and another to register. I want the 'Log In' button to submit the form. I don't want the register button to submit the form, but rather take the user to a different page. How ca...

Can we have multiple <tbody> in same <table>?

Can we have multiple <tbody> in same <table>? If yes then in what scenarios we should use multiple <tbody> ...

remove whitespace from html document using ruby

So I have a string in ruby that is something like str = "<html>\n<head>\n\n <title>My Page</title>\n\n\n</head>\n\n<body>" + " <h1>My Page</h1>\n\n<div id=\"pageContent\">\n <p>Here is a para" + "graph. It can contain spaces that should not be removed.\n\nBut\n" + "line breaks that should be removed.</p></body></ht...

Give title to background image in HTML

Hello All: I have one multiple div which have one image in right top corner as background. I want to give some information (like title). Can any body tell how this can be achieved in case of background image. Thanks, Ashwani ...

Placing data within an HTML template using ASP.NET

I have an ASP.NET web app that retrieves a JSON collection and outputs the content of the collection, via LINQ to a StringBuilder that has a lot of table and other tags in HTML, with my data pieces interspersed. This is what I mean: sb.AppendFormat(@" <table cellpadding=""0"" class=""TableStyle"" style=""width: 70%; height: 100%;"" ce...

How do I use the ASP.NET grid view to instert new records?

Using the ASP.NET grid view. It displays 3 columns with 1 row for each, displaying an integer saved in the database. I would like to have a text input one for each column, so the user can add a new row of integers to the database. (The table only displays the last row updated, that part seems to be working OK) Here is the code I have th...