Skip to main content

Questions tagged [html]

HTML (HyperText Markup Language) is the markup language for creating web pages and other information to be displayed in a web browser. Questions regarding HTML should include a minimal reproducible example and some idea of what you're trying to achieve. This tag is rarely used alone and is often paired with CSS and JavaScript.

2273 votes
37 answers
3.8m views

RegEx match open tags except XHTML self-contained tags

I need to match all of these opening tags: <p> <a href="foo"> But not self-closing tags: <br /> <hr class="foo" /> I came up with this and wanted to make ...
568 votes
30 answers
542k views

PHP mail function doesn't complete sending of e-mail

<?php $name = $_POST['name']; $email = $_POST['email']; $message = $_POST['message']; $from = 'From: yoursite.com'; $to = '[email protected]'; $subject = 'Customer ...
user3818620's user avatar
  • 5,723
2316 votes
32 answers
478k views

How do you parse and process HTML/XML in PHP?

How can one parse HTML/XML and extract information from it?
1291 votes
41 answers
497k views

How to remove the space between inline/inline-block elements?

There will be a 4 pixel wide space between these span elements: span { display: inline-block; width: 100px; background-color: palevioletred; } <p> <span> Foo </span> &...
Šime Vidas's user avatar
980 votes
14 answers
1.8m views

Flexbox: center horizontally and vertically

How to center div horizontally, and vertically within the container using flexbox. In below example, I want each number below each other (in rows), which are centered horizontally. .flex-container ...
bsr's user avatar
  • 58.3k
5105 votes
128 answers
4.9m views

How can I horizontally center an element?

How can I horizontally center a <div> within another <div> using CSS? <div id="outer"> <div id="inner">Foo foo</div> </div>
575 votes
7 answers
187k views

Why don't flex items shrink past content size?

I have 4 flexbox columns and everything works fine, but when I add some text to a column and set it to a big font size, it is making the column wider than it should be due to the flex property. I ...
tomas657's user avatar
  • 5,859
1667 votes
50 answers
1.9m views

How can I vertically center a div element for all browsers using CSS?

I want to center a div vertically with CSS. I don't want tables or JavaScript, but only pure CSS. I found some solutions, but all of them are missing Internet Explorer 6 support. <body> <...
Burak Erdem's user avatar
  • 19.8k
246 votes
5 answers
79k views

CSS-only masonry layout

I need to implement a masonry layout. However, for a number of reasons I don't want to use JavaScript to do it. Parameters: All elements have the same width Elements have a height that cannot be ...
Pekka's user avatar
  • 447k
2296 votes
27 answers
558k views

HTML: Valid id attribute values?

When creating the id attributes for HTML elements, what rules are there for the value?
Mr Shark's user avatar
  • 26.3k
741 votes
10 answers
236k views

Image inside div has extra space below the image

Why in the following code the height of the div is bigger than the height of the img ? There is a gap below the image, but it doesn't seems to be a padding/margin. What is the gap or extra space ...
Misha Moroshko's user avatar
5471 votes
79 answers
4.8m views

How can I validate an email address in JavaScript?

I'd like to check if the user input is an email address in JavaScript, before sending it to a server or attempting to send an email to it, to prevent the most basic mistyping. How could I achieve this?...
1079 votes
30 answers
2.0m views

How can I vertically align elements in a div?

I have a div with two images and an h1. All of them need to be vertically aligned within the div, next to each other. One of the images needs to be absolute positioned within the div. What is the CSS ...
Abdu's user avatar
  • 16.4k
1214 votes
30 answers
2.6m views

How can I center text (horizontally and vertically) inside a div block?

I have a div set to display:block (90px height and width), and I have some text inside. I need the text to be aligned in the center both vertically and horizontally. I have tried text-align:center, ...
Satch3000's user avatar
  • 48.8k
1081 votes
10 answers
710k views

What is a clearfix?

Recently I was looking through some website's code, and saw that every <div> had a class clearfix. After a quick Google search, I learned that it is for IE6 sometimes, but what actually is a ...
H Bellamy's user avatar
  • 22.6k

15 30 50 per page
1
2 3 4 5
5291