843
votes
9answers
257k views
Change an input's HTML5 placeholder color with CSS
Chrome supports the placeholder attribute on input[type=text] elements (others probably do too).
But the following CSS doesn't do diddly squat to the placeholder's value:
CSS:
input[placeholder], ...
355
votes
10answers
226k views
HTML 5: Is it <br> <br/> or <br />?
I've tried checking other answers, but I'm still confused--especially after seeing W3schools HTML 5 reference.
I thought HTML 4.01 was supposed to "allow" single-tags to just be <img> and ...
220
votes
12answers
117k views
HTML Anchors with 'name' or 'id'?
When I want to refer to some part of a webpage with the "http://example.com/#foo"-method, which one is The One to use:
<h1><a name="foo"/>Foo Title</h1>
or
<h1 id="foo">Foo ...
118
votes
7answers
35k views
Are self-closing tags valid in HTML5?
The W3C validator doesn't like self-closing tags (those that end with "\>"). Are they still valid in HTML5?
Some examples would be:
<br \>
<img src="" \>
<input type="text" ...
114
votes
11answers
20k views
Would you recommend starting from HTML5 & CSS3 for beginners? [closed]
I am a middle school student trying to dive into the world of web designing and developing.
I have been interested in (using) the web since I was little, but now I want to be in the "creating" side. ...
110
votes
8answers
42k views
how to store an Array in localStorage? [duplicate]
If i didn't need localStorage, my code would look like this:
var names=new Array();
names[0]=prompt("New member name?");
This works, however I need to store this variable in localStorage and its ...
104
votes
11answers
21k views
Choosing Mobile Web HTML5 Framework [closed]
For the new project, I have been searching for a framework with support of HTML5 and runs on mobile, that is IPhone, IPads. I found out these:
Sencha Touch
M-Project
jQuery Mobile
jQTouch
Titanium
...
63
votes
1answer
24k views
Select elements by data attribute in CSS
Is it possible to select elements in CSS by their HTML5 data attributes (for example, data-role)?
50
votes
7answers
75k views
IE8 support for CSS Media Query
Does IE8 not support the following CSS media query ;
@import url("desktop.css") screen and (min-width: 768px);
If not, what is the alternate way of writing ?
The same works fine in Firefox.
Any ...
20
votes
8answers
18k views
How to add maxlength for HTML5 input type=“number” element?
For input type="number" element, maxlength is not working. How can I restrict the maxlength for that number element?
9
votes
7answers
37k views
Simple two column html layout without using tables
I'm looking for a super easy method to create a two column format to display some data on a webpage. How can i achieve the same format as:
<table>
<tr>
...
2
votes
1answer
35 views
+50
Listen to specific changes on contenteditable?
Warning: not duplicate with existing questions, read through
I know I can have an event listen on changes on an contenteditable element.
What I would like is to be able to know what the changes are.
...
1
vote
1answer
83 views
Remove label when image is clicked?
I am using HTML. I have added a label and image as below:
on click of red cross mark the corresponding label needs to be removed. How can I do this?
I have below the code but it is not working.
...
0
votes
0answers
30 views
MYSQL Get a particullary page content from old_text column of a database
What I am trying to do is to get a telephone contact list from a page content.
All my pages are stored in a database, which I have successfully accessed using CodeIgniter.
I want to output a ...
0
votes
2answers
35 views
How do I simulate placeholder functionality on input date field?
It's impossible to use placeholder on date fields but it really need.
So maybe there are other ways?
I mean cross-browser and valid ways.