Tag: c

55 votes
12 answers
776 views
Why don't self-closing script elements work?

What is the reason browsers do not correctly recognize: <script src="foobar.js" /> <!-- self-closing

avatar
Xavier
0 1 0 9
asked 07 September, 2021
50 votes
24 answers
2.7K views
How do I style a <select> dropdown with only CSS?

Is there a CSS-only way to style a <select> dropdown? I need to style a <select> form as much as

avatar
Shanita
0 1 0 9
asked 07 September, 2021
61 votes
12 answers
2.6K views
What does <meta http-equiv="X-UA-Compatible" content="IE=edge"> do?

What's the difference if one web page starts with <!DOCTYPE html> <html> <head>

avatar
Don
0 1 0 9
asked 07 September, 2021
61 votes
8 answers
2K views
<meta charset="utf-8"> vs <meta http-equiv="Content-Type">

In order to define charset for HTML5 Doctype, which notation should I use? Short: <meta charset="utf-8" /

avatar
Royal
0 1 0 9
asked 07 September, 2021
57 votes
25 answers
2.4K views
Redirect from an HTML page

Is it possible to set up a basic HTML page to redirect to another page on load?

avatar
Rufus
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
1.2K views
How can I set the default value for an HTML <select> element?

I thought that adding a "value" attribute set on the <select> element below would cause the <option&g

avatar
Adolfo
0 1 0 9
asked 07 September, 2021
53 votes
30 answers
617 views
How do I make a placeholder for a &apos;select&apos; box?

I'm using placeholders for text inputs which is working out just fine. But I'd like to use a placeho

avatar
Thurman
0 1 0 9
asked 07 September, 2021
56 votes
30 answers
2.3K views
How do I auto-resize an image to fit a &apos;div&apos; container?

How do you auto-resize a large image so that it will fit into a smaller width div container whilst maintaining

avatar
Tuan
0 1 0 9
asked 07 September, 2021
56 votes
30 answers
1.6K views
How to align checkboxes and their labels consistently cross-browsers

This is one of the minor CSS problems that plague me constantly. How do folks around Stack Overflow vertically

avatar
Renaldo
0 1 0 9
asked 07 September, 2021
51 votes
29 answers
2.2K views
Retrieve the position (X,Y) of an HTML element relative to the browser window

I want to know how to get the X and Y position of HTML elements such as img and div in JavaScript relative to

avatar
Carmelina
0 1 0 9
asked 07 September, 2021
55 votes
24 answers
2.6K views
Vertically align text next to an image?

Why won't vertical-align: middle work? And yet, vertical-align: top does work. span{ vertical-alig

avatar
Kurtis
0 1 0 9
asked 07 September, 2021
53 votes
30 answers
690 views
How to create an HTML button that acts like a link

I would like to create an HTML button that acts like a link. So, when you click the button, it redirects to a

avatar
Mikki
0 1 0 9
asked 07 September, 2021
50 votes
30 answers
3K views
How can I make a div not larger than its contents?

I have a layout similar to: <div> <table> </table> </div> I would like for

avatar
Frederick
0 1 0 9
asked 07 September, 2021
54 votes
30 answers
2.1K views
Make a div fill the height of the remaining screen space

I am working on a web application where I want the content to fill the height of the entire screen. The page

avatar
Vi
0 1 0 9
asked 07 September, 2021
61 votes
30 answers
1.4K views
How to make a div 100% height of the browser window

I have a layout with two columns - a left div and a right div. The right div has a grey background-color, and

avatar
Royal
0 1 0 9
asked 07 September, 2021
63 votes
30 answers
2.5K views
How do I give text or an image a transparent background using CSS?

Is it possible, using CSS only, to make the background of an element semi-transparent but have the content (te

avatar
Hilario
0 1 0 9
asked 07 September, 2021
55 votes
20 answers
1.5K views
How do I modify the URL without reloading the page?

Is there a way I can modify the URL of the current page without reloading the page? I would like to access th

avatar
Sydney
0 1 0 9
asked 07 September, 2021
53 votes
17 answers
1.8K views
I need an unordered list without any bullets

I have created an unordered list. I feel the bullets in the unordered list are bothersome, so I want to remove

avatar
Fabian
0 1 0 9
asked 07 September, 2021
56 votes
23 answers
2K views
Storing Objects in HTML5 localStorage

I'd like to store a JavaScript object in HTML5 localStorage, but my object is apparently being converted

avatar
Santiago
0 1 0 9
asked 07 September, 2021
47 votes
18 answers
793 views
How do I disable the resizable property of a textarea?

I want to disable the resizable property of a textarea. Currently, I can resize a textarea by clicking on the

avatar
Bryan
0 1 0 9
asked 07 September, 2021