html

call function to highlight code

Hello. Please see the the following http://valogiannis.com/recent/ .I have a webpage and when user click XHTML code a div with id result loads the contents of a webpage (in this case codes/advocasys.html). In fact what I wish to do is to highlight the html code. I have link the necessary css/js. I use the SyntaxHighlighter 3.0.83. This ...

Is there a css or html attribute to center the contents of an input tag?

This is probably best explained with a visual. As shown below, I have two <input> elements for the user to enter dates. Is there a CSS or HTML attribute that will allow me to center the contents (in my case, the dates) horizontally in the displayed input areas instead of left-aligning them? Note: I am not trying to align the control...

How to center a textarea using CSS?

Forgive me for asking such a simple question, I'm new to both HTML and CSS. Is there an easy way to center a textarea? I figured I'd just try using textarea{ margin-left: auto; margin-right: auto; } but it (obviously?) didn't work. Help would be much appreciated :-) ...

HTML Interview Question

Well I got this question in an interview test.Give two reasons why the page might take longer to download than necessary with this image. < IMG src="somethin.gif" width=10 height=10 border=0 > Well I came up with 3 instead of 2 reasons Xhtml validation problems,image resizing and unnecessary border=0.So what is wrong in here? . ...

how to inject a string in an html fragment

I would like to insert a read more html bit at a certain position in an html fragment - say after the 10th word. I will then, via javacript, hide the text after the "read more" and only show it on click. The javascript part is ok. As to the php part... It seemed simple at first - but the problem is that tags mess up the word count and...

Easiest way to log visitor's ip

Hi, What is the easiest way to set up a page to log a visitors ip address. I just want to record when the visitor came and from what ip. Should I be looking at google analytics for this or is there some simple script I can throw on the page to do it. Any pointers much appreciated, ...

How to load another div while facebox pop up is still open?

Hi. I just figured out how to use Facebox. I can open hidden divs in Facebox but how do I get it to dump the current div and load another one without closing the pop-up? I want the Facebox pop-up to load another div (while dumping the previous one) if the user clicks on a link inside the pop-up. I already tried something like this: <scr...

associated folder when saving an html file

When you save an html file "completely"(as opposite to "just html"), the html file and an associated resource folder will be saved. The interesting thing is that when you delete the html file, the folder will be deleted automatically. The folder must not be some ordinary folder. What is it called and is it possible to do this programmat...

Which HTML tags have no content

Some HTML tags like br and hr have no content and cannot have a closing tag. What is the complete set of these tags? ...

How to make HTML form submit perform multiple actions?

Hi, I'm creating an HTML form for my company's website. This form will take in two text fields, a name and email address. When the user presses the "Submit" button, I'd like to have a file begin downloading. (The form is to collect user information before they download our newest beta.) How can I do this? I'm a complete novice to web de...

How to prevent CKEditor from stripping < and > (greater-than/less-than)

Every time I enter < or > in a CKEditor window, save, and then come back to it, CKEditor replaces them with whatever was typed within the brackets and the accompanying end tag. For example: if I type <configuration details>, CKEditor will assume it is an HTML tag and put <configuration details></configuration details> in the html source...

On browser close event

Need help on browser close event. I see a tutorial but not working on all browsers. Need a javascript code that works on all browsers. My purpose on that is to delete a php session on browser close. Thank you ...

What is the recommended strategy for input box hint text (such as "Search" overlayed on a search box)?

Many pages have a search box to them which will typically have the overlayed text "Search" which disappears when one focuses the element and reappears when focus is lost. I'm curious to know what people recommend as the best strategy for this. The strategy I've employed is to use the focus/blur events of the input element and test the c...

HTML Codes in CakePHP $html->link function

This code $html->link(" &raquo;", '/events/view/'.$event['Event']['id']), array('escape'=>false,'class'=>'more') ) Outputs <a href="/events/view/4"> &amp;raquo;</a> instead of >> Any idea? ...

Post Editor Like Stack Overflow

i am working on a site which has dynamic NEWS page... currently when ever i post some news its plain text... i want it to be formatted for various reasons... the thing is i want a post editor like Stackoverflow (the one we use to post our answers).... i don't want code sample but i want the following things in it text formatting... b...

Make IE behave like Firefox

i was wondering... when we design websites... there are cross-browser compatibility and browsers different behavior to HTML is an issue... designer has to check his design and work for cross-browser design consistency.... can we do somthing about it like add some libraries\scripts to the code so that one browser bahaves like other, so ...

How to fetch multiple return values from a JavaScript function

I have JavaScript function call to changeMapLocation function where in it I want to return the variables lat and long1. I have some problem in code to return those two variables and alert in function call. var sample = changeMapLocation(state); alert(sample.lat1); alert(sample.lat2); function changeMapLocation(state) { var address...

Disable Location Bar of Browsers in Pop-up Windows

I have the following HTML with Javascrpt : <A HREF="javascript:void(0)"onclick="window.open('http://www.msn.com/','New Windows','height=380, width=300,location=no')">Hide Address Bar</a> It's working fine with IE but not FireFox 3 and later. I want to disable the "Location" bar when pop-up windows shows up. ...

IE7 z-index problem

Hiya! I'm having problems with z-index in IE7. I have a table where the user is asked to enter address. The javascript validator box 'formStatusBoxContainer' for postalCode is appearing behind the select box and the icon 'formStatusIcon' on the next row. Any idea how to solve this? Besides moving the box. Everything looks fine in FF and ...

Handle HTML code block as an object ?

Hi ! I have a div that basically represents a book (so a nice div layout with an image of the book, title, price, red background if on sale etc.). So what i do is to get the properties of a book from the database, insert the values in kind of an html template and display it. Now, once it is displayed i hate how i have to handle the da...