All Questions

1325
votes
35answers
2149922 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 these: <br /> <hr class="foo" /> I came up with this and wanted to make sure I've got it right. I am...
1079
votes
11answers
96448 views

Why don't self-closing script tags work?

What is the reason browsers do not correctly recognize: <script src="foobar.js" /> <!-- self-closing script tag --> Only this is recognized: <script src="foobar.js"></script&g...
190
votes
2answers
225979 views

How to include another XHTML in XHTML using JSF 2.0 Facelets?

What is the most correct way to include another XHTML page in an XHTML page? I have been trying different ways, none of them are working.
804
votes
15answers
301686 views

When is a CDATA section necessary within a script tag?

Are CDATA tags ever necessary in script tags and if so when? In other words, when and where is this: <script type="text/javascript"> //<![CDATA[ ...code... //]]> </script> prefer...
1247
votes
22answers
2709973 views

Redirect from an HTML page

Is it possible to set up a basic HTML page to redirect to another page on load?
128
votes
5answers
54986 views

Why <p> tag can't contain <div> tag inside it?

As far as I know, this is right: <div> <p>some words</p> </div> But this is wrong: <p> <div>some words</div> </p> The first one can pass the...
293
votes
13answers
116261 views

Margin on child element moves parent element

I have a div (parent) that contains another div (child). Parent is the first element in body with no particular CSS style. When I set .child { margin-top: 10px; } The end result is that top of ...
242
votes
14answers
53174 views

Custom attributes - Yea or nay?

Recently I have been reading more and more about people using custom attributes in their HTML tags, mainly for the purpose of embedding some extra bits of data for use in javascript code. I was hopin...
479
votes
24answers
521520 views

Make a div into a link

I have a <div> block with some fancy visual content that I don't want to change. I want to make it a clickable link. I'm looking for something like <a href="…"><div> … </div&...
175
votes
13answers
86520 views

What are all the valid self-closing elements in XHTML (as implemented by the major browsers)?

What are all the valid self-closing elements (e.g. <br/>) in XHTML (as implemented by the major browsers)? I know that XHTML technically allows any element to be self-closed, but I'm looking fo...

Previous Next