Hot answers tagged

53

@toomanyairmiles is partially correct - the purpose of this technique is to allow parallel connections from the web-browser to the server. Web browsers should allow a minimum of two simultaneous connections to a single host, but many new browsers can manage up to 60. Regardless, concurrent simultaneous connections between browser and web-server(s) is a major ...


23

Google have very recently updated their guidelines to officially state that you should not block access to CSS or JS files in robots.txt. This ensures that when Google crawls the site, it can render it exactly as a browser would. If you block CSS or JS files, it could harm how well your website performs in the rankings. More info here: Updating our ...


17

Yes. You can use an app that auto-compiles LESS files to CSS on your development machine as you code. Then simply upload the generated CSS file to your server when you're done developing. Crunch! for Windows & Mac WinLess for Windows CodeKit for Mac


17

http://unused-css.com/ Does some of what you ask, and they have this to say:- Latish Sehgal has written a windows application to find and remove unused CSS classes. I haven't tested it but from the description, you have to provide the path of your html files and one CSS file. The program will then list the unused CSS selectors. From the screenshot, it looks ...


17

As the text is part of the logo, I would keep it in the image (saves on trying to match any non-standard fonts and having to position it exactly like it is in the logo) - you can always put it in the alt attribute or use microdata to to enhance your seo: <div id="main-logo-holder" itemscope itemtype="http://schema.org/Organization"> <meta ...


16

I think it really depends on what you find easiest for development and what helps you keep a tidy stylesheet. The only real downside I can think of in splitting would be that should an element's attribute appear in all your stylesheets, you would have to update 5 separate files to change it (rather than it appearing side-by-side in one place). According ...


14

CSS files linked from HTML documents are added to the parallel download queue as the HTML is parsed; the key thing is that non-asynchronous JavaScript links block the HTML parser, preventing later tags from being added to the download queue until that JavaScript is downloaded, parsed and executed.[1] Here's an example that forces the browser to download ...


13

For Helvetica I would just specify the font-family with CSS like so: body{ font-family: Helvetica, Arial, sans-serif; } This says, "use Helvetica if it's available, Arial if it's not, and the system's default sans-serif font if neither are installed". Helvetica is installed on 100% of Mac and iOS devices [source]. The other two cover the rest, and Arial ...


13

In the past, Web browsers were only able to download two items at once (now 6 or more), so downloading resources from various domains is faster than a single domain. This applies to everything from images to javascripts. Many companies also use a CDN, a tool which ensures the end user gets their data from a server that is geographically close to them, ...


13

Sure. Obviously, it would be better to use CSS alone but if you can't, use what you have. Do as much as you can with CSS and use JS as needed. Not sure why you can't change the existing CSS but you can add a style sheet with JS. (function() { //create a new element var newStyle = document.createElement("link"); //set the required attribute for a ...


12

I don't know of a compressed version out there but you might want to create a saved Google search to keep yourself updated. You could submit it to http://www.cdnjs.com and it has a shot being hosted by them for free. Also, it looks like you could get an uncompressed version from here, http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css. Finally, ...


11

I use SimpLESS - drag, drop, done.


11

Google says nothing about that. The more important things are page structure (correct tags, H1 for headers, sections, etc..), metatags and urls. The google prefers sites that loads fast, that have good structure and descriptive urls. You should focus on that. More info here: http://support.google.com/webmasters/bin/answer.py?hl=en&answer=35291


11

Search engines index pages by URL, and duplicate content is content that's found at more than one URL - see this for more: What is Duplicate Content? Search engines would only penalize content appearing more than once on the same page if it appears to be spammy or an attempt at keyword stuffing. Incorporating different menus and layout structures would not ...


10

LESS comes with a binary (lessc) that lets you precompile your .less files. You use it as such: $ lessc styles.less > styles.css But I think most people just use the lessc -w or lessc --watch command to recompile the CSS stylesheet automatically whenever the LESS file is updated. You can also have lessc minify the CSS, e.g. lessc -w -x. Edit: Just to ...


10

This is happening because Telex doesn't actually provide a bold weight, which means the browsers synthesize it, and that doesn't always come out so great. (Note as @toscho points out below, this is a general problem, not limited to Google Webfonts or even just font embedding.) WebKit/Safari seems to especially suck at this and in the mobile version you'll ...


10

Google penalizes for text that is not visible to the users. White text on a white background can be used for keyword stuffing. In that case the keywords are put in the page source where Googlebot indexes them, but the font color makes it so that users don't see it. Shadow text is not cloaking because the user can see it clearly. There is no risk of ...


9

The short answer is that email client developers don't have a strong business case to support web standards in their products. Their products are designed and sold as plain text or rich text person-to-person communication tools, not as mass-marketed HTML intrays. The original web standards movement The longer answer is that it took a huge effort from some ...


9

I always create a lib directory for third party components, you really don't want to be changing third party libraries unless it is strictly necessary. Go with the 3rd option.


9

View the source code using a tool like Firebug or Chrome Developer Tools will make that easier to do. You can inspect an element, in this case the background, and see the CSS rules that applies to it. Use a browser extension like Colorzilla to click and tell you what the color is.


9

Right click with your mouse on the web page and then click "Inspect Element". Then look to the right under the "Styles" tab (assuming you're using Chrome), and then under where it says: .site { background-color: #f8f3ef; This is the color (#f8f3ef). For future reference, you may have to do some looking around in the Inspect Element next time and just look ...


9

Google likes company alt attribute Both Google and Bing understand that a logo will often be repeated throughout in PNG, GIF and JPEG. Simply markup the logo using the alt description to inform search engines that it is LOGO for your business. A basic example: <img src="logo.png" alt="Company Name Logo"> A Schema example: <div itemscope ...


8

"As a web developer I find it inconvenient to use HTML & CSS" That's crazy, hasn't HTML and CSS come a long way in the last 10+ years? From javascript we got jQuery and AJAX, an improvement on javascript. HTML5 CSS3 improvements on HTML and design methods. With CSS improvements we've moved away from tables, have fluid designs. Now with mobile phones we ...


8

No. This will not make your site faster and is unnecessary. Multiple HTTP calls slow down your website, not speed it up. To make your CSS load as fast as possible: Minify it Compress it using gzip (mod_deflate) Serve it from a CDN Once the browser has the file it will cache it and no more requests will need to be made which is as fast as it gets.


8

That whole article is about making code readable for humans and has nothing to do with SEO. Google does not care about formatting. Google only cares about content. Anything that helps outline that content, such as proper headings to show them where a new section begins and lists, will help them figure out what your content is about and where it begins and ...


7

I think the Twitter website has quite a few hits each day, so if it's good enough for them then I think it's ready for "prime time".


7

Justin Dorfman manages http://www.bootstrapcdn.com/ which has version 2.3.1 (at the time of editing) Complete CSS (Responsive, With Icons): //netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css Complete JavaScript //netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js GitHub Repo https://github.com/netdna/...


7

Large sites move their static content (images, JS & CSS files) to a Content Delivery Network or CDN as deploying your content across multiple, geographically dispersed servers will make your pages load faster from the user's perspective. As the CDN has a different domain name, it also provides domain sharding benefits.


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