Tag Info

Hot answers tagged

91

Because saving HTTP requests is of little use when you achieve it by breaking caching. If the stylesheets and scripts are served separately, they can be cached very well and amortized over many, many requests to wildly different pages. If they're mushed in the same HTML page, they have to be re-transmitted with every. Single. Request. This page's HTML, for ...


89

Free Functionality Properly using <label>s means you can click the label to enter the text field. Many browsers will add logical default functionality to many tags per the official specification, meaning you can use less JavaScript plugins and write less code than a site made entirely out of <div>s and <span>s. Accessibility Related to ...


73

HTML and CSS are difficult to interview for a few reasons: They are too basic, compared, for example, to a programming language, They depend very much on the context of the job. Examples: If you create Google scale, hugely fast and optimized websites, the people you interview for the job cannot ignore what CSS sprites are. If you create XHTML W3C valid ...


72

Specification says UNIQUE HTML 4.01 specification says ID must be document-wide unique. HTML 5 specification says the same thing but in other words. It says that ID must be unique in its home subtree which is basically the document if we read the definition of it. Avoid duplication But since HTML renderers are very forgiving when it comes to HTML ...


71

I believe you are looking at the problem the wrong way - you are missing a great opportunity of teaching the juniors how to write better code. If you habitually re-write their code, you might give your juniors the impression that you don't value their work, which will lower their morale, and not help them code better the next time. A better approach, I ...


68

You should build a house first, then paint it. An HTML document can stand on its own, even though it may look dull. A CSS style sheet cannot; it is nothing displayable (except as code) but instructions for display. It’s a different issue that during painting, you may wish to do changes to the house. With real houses that’s usually not feasible, but in ...


51

HTML5 is not a single integrated thing. It's a collection of extensions to HTML, some of which are widely-implemented and can be used safely, some of which no-one implements yet, and a whole lot in-between. If you try to treat HTML5 as a coherent single development platform and ‘learn it all’ you will have a really difficult time. Instead what you need to ...


42

If I were to start a new HTML5 project from scratch right now I would probably do something like this: Download and use the HTML5 Boilerplate. This will give you a fresh page with most of the important things initialized and ready for testing. Also includes some nice debugging features you should be using along with firebug Look over Dive in to HTML5 to ...


32

You don't have to learn JavaScript and HTML to create web applications. But you will. If you really want to write webapps in mostly Java, have a look at the Google Web Toolkit, which does vast amounts of Java to JS, and can satisfy a good chunk of the code needed for a webapp. Django is a similar framework for Python. And if you really want to avoid ...


30

Not anytime soon. The era of WYSIWYG editors is long over (like the dinosaurs) but companies continue to pump it out. I remember the days of using Dreamweaver and having dozens of spacer.gif images to put the layout in the same way. Software like this is fool's gold - it's meant to appeal to people who want something quick and dirty (tomorrow as opposed ...


29

I have said this before and will say it again "working code is more valuable than pretty code". If you change code the chances are high that you will change its behavior, if this is tested code then you have just invalidated all the testing effort, and will need to repeat the tests. By all means encourage your juniors to write clean understandable code, ...


29

There is no way to avoid that. They are coupled because they interact with each other. If your javascript intends on doing any kind of DOM manipulation, then it needs a way to reference the DOM. There are various conventions for it. The Level 2 DOM API provides the getElementById, getElementByTagName, and getElementsByName methods. To this day these are ...


28

Former Designer here, turned Dev, and I used to piss and moan about Web Controls too. Honestly, its MUCH cheaper for a designer to adjust their practices than for a .NET Developer to delve into a custom impelmentation of a GridView because the designer INSISTED that each TD have a 'rel' tag (or whatever). As MainMa very wisely pointed out, the decision to ...


28

Because making best guesses is the right thing to do, from a browser-maker's perspective. Consider the situation: ideally, the HTML you receive is completely correct and to spec. That's great. But the interesting part is what happens when the HTML is not correct; since we're dealing with input from a source that we have no influence on, really, we have to be ...


27

The reason is simple: At the time of the first graphical browsers, NCSA Mosiac and later Netscape Navigator, almost all HTML was written by hand. The browser authors (Netscape was built by ex-Mosaic folks) recognized quickly that refusing to render incorrect HTML would be held against them by the users, and voila!


25

This is a fascinating question. The other answers here are all speculative, and in some cases flat-out incorrect. Instead of writing my opinion here, I actually did some research and found original sources that discuss why delete and put are not part of the HTML5 form standard. As it turns out, these methods were included in several, early HTML5 drafts (!), ...


25

Today, in our work as in our life, it is more important know how to find information rather than know the information itself. I mean that a good developer is a person able to find documentation, network, and that share with an open mind. I am an experienced .NET developer and, believe me, for every project I work on I have to learn new things about the ...


24

Nope, sorry. Even if you could, users could just submit the form to your site using some other tool. The golden rule here is: Never trust user input. Be sure to validate everything on the server side (in php) and look up any important values from your database instead of trusting whatever came from the user.


22

I would recommend reading How Did We Get Here?. Mark Pilgrim gives an excellent and brief history of HTML up to HTML5. Essentially though, my understanding is that many webpages don't even take advantage of the "X" of XHTML because they don't specify the proper MIME type for it.


21

Adobe already did it with Adobe Air, and Mozilla too with Prism . Google also tried to bridge the gap between desktop and web with Google Gears. But in general, web technologies are not suited for many types of desktop applications, here some reasons why: No immediately available full hardware access. No low level system access. No easily available ...


21

I think the problem is that you are comparing cleanly written server side templating to badly written ad-hoc client side HTML generation. Of course the cleanly written code is easier to read, maintain, and trace. You call the client side code "mounds of HTML", but of course it's the same HTML wherever it's generated. The "mound" is really the big lump ...


21

The W3C HTML standard on the title attribute: This attribute offers advisory information about the element for which it is set... Values of the title attribute may be rendered by user agents in a variety of ways. For instance, visual browsers frequently display the title as a "tool tip" (a short message that appears when the pointing device pauses ...


20

This is a changing space, every tool has its place in a professional's toolbox, it takes a true professional to know when each tool is appropriate to use. That said, not all tools are made the same, Dreamweaver was cutting edge a decade ago, there are better tools today. Tools like Flux and even Coda are invaluable for rapidly developing high quality code ...


20

To directly answer your question: Never echo static text or HTML. Leave that outside of your PHP. <?php echo "<p>Hello World</p>"; // Alway wrong. ?> <p>Hello World</p> <!-- Does the same thing, faster, and is more readable. --> Escaping to PHP is a waste if all you are going to do is pass in static text or static ...


19

I have used this technique exclusively for a web application we're working on. My backend is hosted on Google App Engine using the Java SDK, and my frontend uses HTML, CSS, and JavaScript (with jQuery). The project is a smaller one with just myself and a Web designer, and we both feel that this method has helped us work a lot faster and get something to ...


18

Look at XSLT - its main use it to transform one XML dialect to another (in this case, you would output to HTML/XHTML). Update: Since the OP believes this is not a popular option, here is a link to the standard on the W3 consortium website.


18

Here are some questions I would ask about CSS: CSS box model. Margins, padding, etc. IE model vs. W3C model. How can one switch between the two? What are their benefits and drawbacks? CSS positioning. What does it mean for an element to be "in the flow" and "out of the flow" inline-block and other display values. Difference between display: none; and ...


17

Web designers should not usually have to touch the PHP code much, if at all. Usually designers develop the visuals in some graphics package (where needed), usually Photoshop. Build the HTML/CSS for a static version of the content, with alternate content for dynamics also built. Then the programmer tends to take this and make it dynamic. Failing that, ...


16

LESS CSS dynamic stylesheet language designed by Alexis Sellier. It is influenced by Sass and has influenced the newer "SCSS" syntax of Sass, which adapted its CSS-like block formatting syntax. LESS is open-source. Its first version was written in Ruby, however in the later versions, use of Ruby has been deprecated and replaced by JavaScript. The ...



Only top voted, non community-wiki answers of a minimum length are eligible