tagged [html]

How do I capture a key press (or keydown) event on a div element?

How do I capture a key press (or keydown) event on a div element? How do you trap the keypress or key down event on a DIV element (using jQuery)? What is required to give the DIV element focus?

Is there a valid way to disable autocomplete in a HTML form?

Is there a valid way to disable autocomplete in a HTML form? When using the `xhtml1-transitional.dtd` doctype, collecting a credit card number with the following HTML will flag a warning on the W3C va...

31 Dec at 19:53

Prevent scroll-bar from adding-up to the Width of page on Chrome

Prevent scroll-bar from adding-up to the Width of page on Chrome I have a small issue trying to keep my .html pages at a consistent width on Chrome. For example, I have a page (1) with lots of content...

28 Dec at 03:21

Why does this CSS margin-top style not work?

Why does this CSS margin-top style not work? I try to add `margin` values on a `div` inside another `div`. All works fine except the top value, it seems to be ignored. But why? ![What I expected with ...

26 Dec at 11:21

Is there a way to word-wrap long words in a div?

Is there a way to word-wrap long words in a div? I know Internet Explorer has a word-wrap style, but I'd like to know if there is a cross-browser method of doing so to text in a div. Preferably CSS bu...

24 Dec at 09:9

Section vs Article HTML5

Section vs Article HTML5 I have a page made up of various "sections" like videos, a newsfeed etc.. I am a bit confused how to represent these with HTML5. Currently I have them as HTML5 ``s, but on fur...

24 Dec at 08:59

adding onclick event to dynamically added button?

adding onclick event to dynamically added button? I am adding a button dynamically in html like below: On click of that button I want to call a Javascript function: ``` var but = document.createElemen...

22 Dec at 01:12

How to style SVG <g> element?

How to style SVG element? I have some SVG elements grouped together in a `` element. I just want to style that `` element to show grouping of elements. Like I want to give some background-color and a ...

22 Dec at 01:11

How to modify STYLE attribute of element with known ID using JQuery

How to modify STYLE attribute of element with known ID using JQuery I got 3 buttons-links triggering some javascript code, with indication if certain button is selected, selected button got style attr...

21 Dec at 23:14

Change image size via parent div

Change image size via parent div I tried to do so but it didn't change the size: What will re-size it (I can't edit/access the img element itself)?

21 Dec at 22:51

Fixed header table with horizontal scrollbar and vertical scrollbar on

Fixed header table with horizontal scrollbar and vertical scrollbar on I have a problem with html/css sticky header + scrollbars. I am creating a program that requires scrollbars to show up once the c...

21 Dec at 22:20

CSS ''background-color" attribute not working on checkbox inside <div>

CSS ''background-color" attribute not working on checkbox inside The heading pretty much explains it. I have a couple of checkboxes inside a scrollable div. But for some reasons the 'background-color'...

21 Dec at 22:15

Set height 100% on absolute div

Set height 100% on absolute div I am facing a problem with . I could use position fixed to solve the cover, but that's not really what I want because you should be able to scroll down on the 'cover' >...

21 Dec at 22:12

Links not going back a directory?

Links not going back a directory? I have a website, let's call it `example.com`. Within this site, I have some FAQs but the person that built the site saved the FAQ pages under a directory on the site...

21 Dec at 21:42

Creating watermark using html and css

Creating watermark using html and css What I need is to create cross website transparent watermark like this using only html and css. Have no idea how to keep that always in one place for ex: right bo...

21 Dec at 10:4

jquery <a> tag click event

jquery tag click event I am building a code which displays user information on search. User information, is then displayed in a `fieldset`, and a image, first name, last name and few profile info. is ...

21 Dec at 04:58

MVC Razor Hidden input and passing values

MVC Razor Hidden input and passing values I am pretty sure I am doing something wrong here. I have been developing a web app using MVC and Razor and I never thought of using the form element. Now so m...

How do I make a field required in HTML?

How do I make a field required in HTML? I can't figure out why the new `required` attribute of HTML seems to not be working, and I know my simple code seems to be okay. What should I do to make this w...

20 Dec at 19:43

Make Div Draggable using CSS

Make Div Draggable using CSS I want to make my div tag with id "drag_me" to be draggable up to the length of 300px from left and 460px from top, only using CSS. I also want to make it resizable. Again...

20 Dec at 00:55

How to Auto resize HTML table cell to fit the text size

How to Auto resize HTML table cell to fit the text size I have a table with 2 rows and variable columns. I tried width = 100% for the column. So the first content in the view will fit. But suppose if ...

20 Dec at 00:53

Adding images to an HTML document with JavaScript

Adding images to an HTML document with JavaScript I've tried some HTML DOM code from several sites, but it isn't working. It isn't adding anything. Does anyone have a working example on this? But it i...

19 Dec at 21:38

Auto-click button element on page load using jQuery

Auto-click button element on page load using jQuery If I wanted to auto-click a button element on page load, how would I go about this using jQuery? The button html is

how to call a onclick function in <a> tag?

how to call a onclick function in tag? I want to open a new window on click of 1 It is not showing me error. Is there any other way to open new window? Here is the fiddle [http://jsfiddle.net/ankurdha...

19 Dec at 21:10

Horizontal scroll on overflow of table

Horizontal scroll on overflow of table I have a basic table in a container. The table will have about 25 columns. I am trying to add a horizontal scroll bar on overflow of the table and am having a re...

18 Dec at 23:4

How do I stretch a background image to cover the entire HTML element?

How do I stretch a background image to cover the entire HTML element? I'm trying to get a background image of a HTML element (body, div, etc.) to stretch its entire width and height. Not having much l...

18 Dec at 23:4