Skip to main content
Filter by
Sorted by
Tagged with
2355 votes
36 answers
4.0m views

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 ...
2325 votes
32 answers
482k views

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

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
596 votes
8 answers
206k views

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
  • 6,079
1688 votes
50 answers
1.9m views

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
  • 20.1k
762 votes
11 answers
242k views

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
1096 votes
31 answers
2.1m views

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.7k
1090 votes
10 answers
719k views

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.8k
2853 votes
43 answers
2.0m views

I am working on a web application where I want the content to fill the height of the entire screen. The page has a header, which contains a logo, and account information. This could be an arbitrary ...
Vincent McNabb's user avatar
247 votes
18 answers
84k views

It seems like every question on stackoverflow where the asker is using regex to grab some information from HTML will inevitably have an "answer" that says not to use regex to parse HTML. Why not? I'm ...
ntownsend's user avatar
  • 7,680
3080 votes
22 answers
2.2m views

Is there a way I can modify the URL of the current page without reloading the page? I would like to access the portion before the # hash if possible. I only need to change the portion after the domain,...
Robin Rodricks's user avatar
12 votes
4 answers
11k views

I have a fairly simple page with a sidebar nav and an iFrame in which to load content. I want to change the content of the of the iFrame by clicking on links in the sidebar nav. I'm using the ...
Sean McIntyre's user avatar
110 votes
4 answers
49k views

I'm trying to figure out how flexbox works (supposed to work?…) for cases like below: .holder { width: 500px; background: lightgray; display: flex; flex-direction: row; justify-content: ...
Mikhail Kornienko's user avatar
746 votes
8 answers
907k views

What I want to do is when a certain div is hovered, it'd affect the properties of another div. For example, in this JSFiddle demo, when you hover over #cube it changes the background-color but what I ...
Trufa's user avatar
  • 40.9k
356 votes
34 answers
258k views

I have a simple 2-column layout with a footer that clears both the right and left div in my markup. My problem is that I can't get the footer to stay at the bottom of the page in all browsers. It ...
Bill the Lizard's user avatar
571 votes
30 answers
560k views

I am trying to center my tabs content vertically, but when I add the CSS style display:inline-flex, the horizontal text-align disappears. How can I make both text alignments x and y for each of my ...
shuji's user avatar
  • 7,566
2551 votes
30 answers
1.6m views

Is it possible, using CSS only, to make the background of an element semi-transparent but have the content (text & images) of the element opaque? I'd like to accomplish this without having the ...
Stijn Sanders's user avatar
2706 votes
44 answers
2.8m views

I have a layout with two columns - a left div and a right div. The right div has a grey background-color, and I need it to expand vertically depending on the height of the user's browser window. Right ...
mike's user avatar
  • 27.1k
1305 votes
32 answers
890k views

Is there an efficient way to tell if a DOM element (in an HTML document) is currently visible (appears in the viewport)? (The question refers to Firefox.)
benzaita's user avatar
  • 13.5k
308 votes
25 answers
304k views

I tried to load some scripts into a page using innerHTML on a <div>. It appears that the script loads into the DOM, but it is never executed (at least in Firefox and Chrome). Is there a way to ...
Craig's user avatar
  • 7,731
91 votes
2 answers
127k views

I have two divs with a height of 90%, but the display is different. I have tried to put an outer div around them, but that has not helped. Also, it's the same on Firefox, Chrome, Opera, & Safari....
victor's user avatar
  • 1,303
1610 votes
36 answers
2.4m views

I am trying to find the most effective way to align text with a div. I have tried a few things and none seem to work. .testimonialText { position: absolute; left: 15px; top: 15px; ...
shinjuo's user avatar
  • 21.1k
29 votes
3 answers
9k views

Is inline event handlers considered a bad practice? For example: <button onclick=someFunction()>Click me!</button> If so, what are the disadvantages of using inline event handlers?
haxxerz's user avatar
  • 963
435 votes
14 answers
388k views

I tried to add margin values on a div inside another div. All works fine except the top value, it seems to be ignored. But why? What I expected: What I get: Code: #outer { width: 500px; ...
lejahmie's user avatar
  • 18.3k
48 votes
4 answers
53k views

I'd like to understand how CSS selectors work with property collisions. How is one property selected over another one? div { background-color: red; } div.my_class { background-color: ...
vitto's user avatar
  • 19.6k

1
2 3 4 5
1621