background preloader

CSS3 Media Queries

CSS3 Media Queries
CSS2 allows you to specify stylesheet for specific media type such as screen or print. Now CSS3 makes it even more efficient by adding media queries. You can add expressions to media type to check for certain conditions and apply different stylesheets. For example, you can have one stylesheet for large displays and a different stylesheet specifically for mobile devices. CSS3 Media Queries (demo) Check my demo and resize your browser window to see it in action. Max Width The following CSS will apply if the viewing area is smaller than 600px. If you want to link to a separate stylesheet, put the following line of code in between the <head> tag. Min Width The following CSS will apply if the viewing area is greater than 900px. Multiple Media Queries You can combine multiple media queries. Device Width The following code will apply if the max-device-width is 480px (eg. iPhone display). For iPhone 4 The following stylesheet is specifically for iPhone 4 (credits: Thomas Maier). For iPad Sample Sites Colly Related:  MEDIA QUERIES

Pure CSS Image Hover | Kyle Schaeffer - Web Design and SharePoint Branding Many site designs will feature varying types of image “hover” states, where an image or background image changes when you move your mouse cursor into that area of the page. Traditionally, this change in image is handled via JavaScript. It’s fairly easy to write a small script that swaps out images on mouseover, but there are a number of disadvantages to this approach that have pushed many web developers toward using a CSS-only method of achieving this exact same effect. This tutorial describes exactly how to implement a pure CSS image hover effect. The Image The biggest difference between a traditional JavaScript image hover and a pure CSS image hover is the image, itself. Let’s look at an image that could be used as a CSS hover image. Simplistic Markup As you can see, both static and hover images are contained within the same file. <a class="myButtonLink" href="#LinkURL">Leaf</a> The CSS As you can see, the HTML is extremely simple. The Result

Awesome Media Queries in JavaScript - enquire.js The Lowdown What is it? enquire.js is a lightweight, pure JavaScript library for responding to CSS media queries. JavaScript callbacks for media queries matching and unmatching. Clean & intuitive API Absolutely tiny - around 0.8kb minified & gzipped! Why should I use it? In responsive design, CSS media queries can only take you so far. enquire.js allows you to harness media queries in JavaScript, giving you the tools to create advanced responsive sites. Dependencies? None! The most you will need to do is provide a matchMedia polyfill if you wish to support old/incapable browsers. Downloads & All That Jazz Latest Build Grab the latest code, ready to go, from one of the locations below: Development — unminified Production — minified If you wish to browse/fork the source, you can do so on GitHub. Install via Bower To install via bower, enter the following at the command line: bower install enquire Install via npm To install via npm, enter the following at the command line: npm install enquire.js Match

Media Queries Abstract HTML4 and CSS2 currently support media-dependent style sheets tailored for different media types. For example, a document may use sans-serif fonts when displayed on a screen and serif fonts when printed. ‘screen’ and ‘print’ are two media types that have been defined. A media query consists of a media type and zero or more expressions that check for the conditions of particular media features. Status of This Document This section describes the status of this document at the time of its publication. A W3C Recommendation is a mature document that has been widely reviewed and has been shown to be implementable. This document has been reviewed by W3C Members, by software developers, and by other W3C groups and interested parties, and is endorsed by the Director as a W3C Recommendation. Please see the Working Group's implementation report and the Media Queries Test Suite. Also see the Disposition of comments and a list of changes relative to the previous Proposed Recommendation. 1. 3.

Pinboard Documentation Documentation » Installing The Theme To install themes with the WordPress theme uploader: Download the theme.zip from the member areaLogin to wp-adminGo to Appearance > ThemesClick on the "Install Themes" tab, then click on the "Upload" linkUpload the theme.zip (note: it is the theme.zip, not theme-psd.zip) that you just downloaded from the member areaActivate the theme You can also install the theme with a FTP software, read this tutorial for more details. Sample Content If you are starting a new site and would like to import the sample content as seen on the demo site, here are the steps: Go to Tools > Import (yoursite.com/wp-admin/import.php). NOTE: The images shown on the demo site are not part of the theme package, nor are they included in the sample content. To set up the social media links: Go to Themify > Settings > Social Links tabThe theme comes with some pre-filled social links. Displaying The Social Media Links Exclude Search Form To create a custom navigation menu: Site Logo

media queries for common device breakpoints | Responsive Web Design The @media query is 1/3 of the recipe for responsive design. It is the key ingredient that, in it’s simplest form, allows specified CSS to be applied depending on the device and whether it matches the media query criteria. Before you start copying and pasting below, read why you don’t need device specific viewports. CSS3 Media Queries Разрешение экрана в наши дни колеблется от 320px (iPhone) до 2560px (большие мониторы) или даже выше. Пользователи больше не просматривают сайты только на настольных компьютерах. Теперь пользователи используют мобильные телефоны, небольшие ноутбуки, планшетные устройства, такие как iPad или Playbook для доступа в интернет. Поэтому, традиционный дизайн с фиксированной шириной больше не работает. Дизайн должен быть адаптивным. Структура должна автоматически изменяться с учетом всех разрешений дисплеев. Для начала посмотрим это в действии. Пред началом посмотрите на финальное демо, что бы увидеть, как хорошо это выглядит. Другие примеры Если вы хотите увидеть больше примеров, посмотрите следующие темы для WordPress, которые я сделал используя media queries: iTheme2, Funki, Minblr и Wumblr. Обзор Контейнер страницы имеет ширину 980px для любого разрешения, больше 1024px. Не будем останавливаться на подробном описании HTML. HTML5.js Обратите внимание, что в демо используется HTML5. Шаг 1

How to Convert a PSD Web Design to HTML and CSS Not long after our newest Tuts+ site, Webdesigntuts+, launched, they posted an excellent tutorial that details the process of designing a warm and cheerful home page in Photoshop. After high demand, we'll take that completed design and convert it into a standards-compliant HTML and CSS web page. Along the way, we'll review a variety of nifty techniques that will help you to improve your own workflow. Even better, when we hit 80,000 RSS subscribers, we'll take things even further and convert the finished product into a custom WordPress theme. Rather than overload you with a massive 4-5 part series all at once, I'll post a new episode in this miniseries every day. It's my hope that, if you're at the point in your career where you can benefit from a series like this, you'll work along with me each lesson. The Full Series Chapter 2: Create the Markup Chapter 3: Slice the PSD Chapter 4: Integrate the 960 Grid System Chapter 5a: Build the Header Section Chapter 5b: Build the Banner Section

Responsive design – harnessing the power of media queries Webmaster Level: Intermediate / Advanced We love data, and spend a lot of time monitoring the analytics on our websites. Any web developer doing the same will have noticed the increase in traffic from mobile devices of late. Over the past year we’ve seen many key sites garner a significant percentage of pageviews from smartphones and tablets. These represent large numbers of visitors, with sophisticated browsers which support the latest HTML, CSS, and JavaScript, but which also have limited screen space with widths as narrow as 320 pixels. Stacked content, tweaked navigation and rescaled images – Chromebooks Implementation As a starting point, simple, semantic markup gives us pages which are more flexible and easier to reflow if the layout needs to be changed. Liquid layout is a good start, but can lack a certain finesse. Viewports When is a pixel not a pixel? In reality you may find you need to use different breakpoints depending on how your site flows and looks on various devices.

Related: