Tag: html

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
61 votes
26 answers
512 views
What are valid values for the id attribute in HTML?

When creating the id attributes for HTML elements, what rules are there for the value?

avatar
Karolyn
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
794 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
57 votes
30 answers
2.3K views
How do you disable browser autocomplete on web form field / input tags?

How do you disable autocomplete in the major browsers for a specific input (or form field)?

avatar
Mikki
0 1 0 9
asked 07 September, 2021
60 votes
30 answers
675 views
Set cellpadding and cellspacing in CSS?

In an HTML table, the cellpadding and cellspacing can be set like this: <table cellspacing="1" cellpadding

avatar
Patsy
0 1 0 9
asked 07 September, 2021
57 votes
30 answers
2.6K views
Change a HTML5 input&apos;s placeholder color with CSS

Chrome supports the placeholder attribute on input[type=text] elements (others probably do too). But the follo

avatar
Lashawna
0 1 0 9
asked 07 September, 2021
65 votes
30 answers
1.9K views
How to horizontally center an element

How can I horizontally center a <div> within another <div> using CSS? <div id="outer"> <

avatar
Sachiko
0 1 0 9
asked 07 September, 2021
56 votes
10 answers
840 views
Why does HTML think “chucknorris” is a color?

Why do certain random strings produce colors when entered as background colors in HTML? For example: <b

avatar
Majorie
0 1 0 9
asked 07 September, 2021
66 votes
11 answers
973 views
how to get the base url in javascript

I am building a website with CodeIgniter, I have various resources that I load with the base_url helper functi

avatar
Hildegard
0 1 0 9
asked 07 September, 2021
59 votes
11 answers
707 views
DataTables: Cannot read property &apos;length&apos; of undefined

I understand this a popular issue, and I have read all the similar questions here on Stack Overflow and other

avatar
Freida
0 1 0 9
asked 07 September, 2021
59 votes
30 answers
2.7K views
jQuery Get Selected Option From Dropdown

Usually I use $("#id").val() to return the value of the selected option, but this time it doesn't work. T

avatar
Suzan
0 1 0 9
asked 07 September, 2021