Tag: html

59 votes
25 answers
460 views
How to write a:hover in inline CSS?

I have a case where I must write inline CSS code, and I want to apply a hover style on an anchor. How can I u

avatar
Elicia
0 1 0 9
asked 07 September, 2021
49 votes
30 answers
1.7K views
How do I remove the space between inline/inline-block elements?

Given this HTML and CSS: span { display:inline-block; width:100px; background-color:palevi

avatar
Vi
0 1 0 9
asked 07 September, 2021
61 votes
30 answers
615 views
Maintain the aspect ratio of a div with CSS

I want to create a div that can change its width/height as the window's width changes. Are there any CSS

avatar
Lorenzo
0 1 0 9
asked 07 September, 2021
54 votes
27 answers
2.4K views
How to align content of a div to the bottom

Say I have the following CSS and HTML code: #header { height: 150px; } <div id="header"> &l

avatar
Wei
0 1 0 9
asked 07 September, 2021
52 votes
19 answers
2.7K views
What characters can be used for up/down triangle (arrow without stem) for display in HTML?

I'm looking for a HTML or ASCII character which is a triangle pointing up or down so that I can use it as

avatar
Kristopher
0 1 0 9
asked 07 September, 2021
62 votes
16 answers
1.6K views
How do I reformat HTML code using Sublime Text 2?

I've got some poorly-formatted HTML code that I'd like to reformat. Is there a command that will aut

avatar
Sena
0 1 0 9
asked 07 September, 2021
55 votes
30 answers
822 views
How do I vertically align text in a div?

I am trying to find the most effective way to align text with a div. I have tried a few things and none seem t

avatar
Percy
0 1 0 9
asked 07 September, 2021
56 votes
30 answers
1.3K views
Hide scroll bar, but while still being able to scroll

I want to be able to scroll through the whole page, but without the scrollbar being shown. In Google Chrome i

avatar
Arline
0 1 0 9
asked 07 September, 2021
55 votes
12 answers
775 views
Why don&apos;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
65 votes
9 answers
1.7K views
What does enctype=&apos;multipart/form-data&apos; mean?

What does enctype='multipart/form-data' mean in an HTML form and when should we use it?

avatar
Stacia
0 1 0 9
asked 07 September, 2021
57 votes
25 answers
2.3K 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
60 votes
15 answers
1.6K views
<button> vs. <input type="button" />. Which to use?

When looking at most sites (including SO), most of them use: <input type="button" /> instead of: <

avatar
Sena
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
60 votes
30 answers
684 views