xhtml

Should we put <input> inside <label>? [duplicate]

白昼怎懂夜的黑 提交于 2019-12-18 13:19:40
问题 This question already has answers here : Should I put input elements inside a label element? (12 answers) Closed 5 years ago . I saw 2 different method on same form example: on http://www.alistapart.com/articles/prettyaccessibleforms/ why they are using 2 method in first fieldset they are keeping input after label and in 2nd fieldset they are keeping input after label . Why? <fieldset> <legend>Delivery Details</legend> <ol> <li> <label for="name">Name<em>*</em></label> <input id="name" /> <

Create Extension Method to Produce Open & Closing Tags like Html.BeginForm()

戏子无情 提交于 2019-12-18 12:29:11
问题 I wonder if it's possible to create an extension method which has functionality & behaviour similar to Html.BeginForm(), in that it would generate a complete Html tag, and I could specificy its contents inside <% { & } %> tags. For example, I could have a view like: <% using(Html.BeginDiv("divId")) %> <% { %> <!-- Form content goes here --> <% } %> This capability would be very useful in the context of the functionality I'm trying to produce with the example in this question This would give

How to not use <div class=“clear”> in markup

北城以北 提交于 2019-12-18 12:14:30
问题 All the time my code is riddled with <div> 's that are used to clear/expand a div to look correct. Whenever it doesn't look correct, I add a <div style="clear:both;"> and it fixes the problem in IE7. How do I avoid doing this? I mess with the overflow:auto , overflow:hidden and I get nothing. Thanks in advance 回答1: One common method is the clearfix class. Instead of needing extraneous <div style="clear:both;"> elements (as you have been doing) after the floating element, you simply add this

why <br /> and not <br/>?

我只是一个虾纸丫 提交于 2019-12-18 11:50:56
问题 This is one of those things that you read once, say "aha!" and then forget. Exactly my case. Why is the line-break tag in xhtml preferentially written with a space <br /> and not in the also ok format <br/> ? I remember the reason was interesting, and as you can imagine it's not easy to find with google. For sure it's not an issue of xml well-formedness. From W3C [44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>' Empty-element tags may be used for any element which has no content, whether

What are the problems associated with serving pages with Content: application/xhtml+xml

蓝咒 提交于 2019-12-18 11:34:31
问题 Starting recently, some of my new web pages (XHTML 1.1) are setup to do a regex of the request header Accept and send the right HTTP response headers if the user agent accepts XML (Firefox and Safari do). IE (or any other browser that doesn't accept it) will just get the plain text/html content type. Will Google bot (or any other search bot) have any problems with this? Is there any negatives to my approach I have looked over? Would you think this header sniffer would have much effect on

Extending XHTML

 ̄綄美尐妖づ 提交于 2019-12-18 11:33:28
问题 I'm playing around with writing a jQuery plugin that uses an attribute to define form validation behavior (yes, I'm aware there's already a validation plugin; this is as much a learning exercise as something I'll be using). Ideally, I'd like to have something like this: Example 1 - input: <input id="name" type="text" v:onvalidate="return this.value.length > 0;" /> Example 2 - wrapper: <div v:onvalidate="return $(this).find('[value]').length > 0;"> <input id="field1" type="text" /> <input id=

Make glowing effect around the text box while active

ⅰ亾dé卋堺 提交于 2019-12-18 11:29:07
问题 Make glowing effect around the text box while placing the cursor inside the textbox. For example : just place the cursor inside the search textbox in our stackoverflow.com. Its because of css, but i dont know how to achieve it.. Please help me. 回答1: While the effect you observe on the stackoverflow search box is probably browser specific (e.g. Google Chrome) there is a way to achieve what you want using the CSS :focus pseudo class: #foo:focus { border: 2px solid red; } <input id="foo" type=

Div collapse after float css

隐身守侯 提交于 2019-12-18 10:41:58
问题 I have a div called NAV and inside of NAV I have an UL with 5 li which I float to the left, the li's that is but when I do that the NAV collapses. I know this because I put a border around NAV to see if it collapses and it does. Here is the example. collapsed http://img401.imageshack.us/img401/8867/collapsedze4.png no collapsed http://img71.imageshack.us/img71/879/nocollapsedkx7.png as you can see in the first image, the links in the NAV div are floated left and that black border ontop is the

window.location not working correctly in IE7/8

流过昼夜 提交于 2019-12-18 08:54:56
问题 I have a div which has an a inside it. I want to click on the div and follow the same url as the a. This is the HTML: <div class="overview white getchildurl"> <p class="w70"> 05-02-2011 </p> <a class="button" href="details/">Details</a> <span class="clear"></span> </div> and I have this script: $('.getchildurl').each(function() { $(this).click(function() { var href = $(this).children('a').first().attr('href'); window.location = href; }); }); This works in Firefox 3.6, Chrome, Safari, but not

Getting div to occupy full cell height

↘锁芯ラ 提交于 2019-12-18 08:27:22
问题 How do I get divs within table cells to occupy the full height of the cell? Setting div height=100% won't work unless the table cell has a fixed height on it, but I can't do this because the cells must have a liquid height depending on variable content. I am trying to get all divs in each row to be the same full height of the row. The code is below, see live example at http://www.songtricks.com/CellDivBug.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org