background preloader

Centering in CSS: A Complete Guide

By Chris Coyier On centering, layout, vertical-align Centering things in CSS is the poster child of CSS complaining. Why does it have to be so hard? They jeer. I think the issue isn't that it's difficult to do, but in that there so many different ways of doing it, depending on the situation, it's hard to know which to reach for. So let's make it a decision tree and hopefully make it easier. I need to center... Horizontally Is it inline or inline-* elements (like text or links)? You can center inline elements horizontally, within a block-level parent element, with just: This will work for inline, inline-block, inline-table, inline-flex, etc. Is it a block level element? You can center a block-level element by giving it margin-left and margin-right of auto (and it has a set width, otherwise it would be full width and wouldn't need centering). This will work no matter what the width of the block level element you're centering, or the parent. Note that you can't float an element to the center.

Related:  Tuto CSS 3Front-endWebdesignWebdevelope (tricks)

Creating Material Design Ripple Effects with SVG An in-depth tutorial on how to build the ripple effect outlined under Google Material Design's Radial Action specification and combine it with the powers of SVG and GreenSock. View demo Download source With the advent of Google’s Material Design came a visual language that set out to create a unified experience across platforms and devices. Google’s examples depicted through their Animation section of the Material Guidelines has become so identifiable in the wild that many have come to know these interactions as part of the Google brand. In this tutorial we’ll show you one way of building the ripple effect specifically outlined under Radial Action of the Google Material Design specification by combining it with the powers of SVG and GreenSock. Responsive Action

Good and Bad CSS Practices for Beginners With CSS3, we can manage media queries, utilize better background images and even handle animations that can be loaded faster on your website – depending on the host you use. These features have made the life of every web designer and developer easier. That being said, not all web designers and developers follow best practices. If you want to be a good web designer/developer, writing clean, manageable CSS is a healthy habit to make your code easier to maintain as your project development progresses. Even if you’ve been building web pages for a quite a while, you may still have a few bad CSS writing habits that you’re better off forgetting. This post will also introduce you to some techniques that will help you get the most out of CSS and write beautiful, manageable stylesheets.

Magnific Popup: Responsive jQuery Lightbox Plugin Magnific Popup is a responsive lightbox & dialog script with focus on performance and providing best experience for user with any device(for jQuery or Zepto.js). Examples Single image lightbox Three simple popups with different scaling settings. 1 — fits horizontally and vertically, 2 — only horizontally, 3 — no gaps, zoom animation, close icon in top-right corner. Lightbox gallery :placeholder-shown The :placeholder-shown pseudo-class selects the input element itself when placeholder text exists in a form input. Think of it as a nice way to distinguish between inputs that are currently showing placeholder text versus those that are not. The idea behind placeholders

Detailed Positioning - Learn to Code Advanced HTML Lesson 2 When it comes to building layouts and positioning content on a page there are a handful of different techniques to use. Which technique to use largely depends on the content and the goals of the page, as some techniques may be better than others. For example, the ability to float elements side by side provides a nice, clean layout that is receptive to the different elements on a page. However, when more strict control is needed, elements may be positioned using other techniques, including relative or absolute positioning. In this lesson, we’ll start by taking a look at how to contain floats. 50+ Beautiful CSS HTML5 Login Form Templates In this article we’ll show you some creative css html5 login forms templates using modern design with CSS3 and HTML5. In fact, nowadays, popular web service, web application are allows or requires user subscription, which means that they will need some kind of forms for users to register and sign in on their website. To help you, so I tried to find beautiful some different login forms, some of which are inspired by design concepts on the web design. I believe that css / hmtl login form templates web design should be clean and efficient. With in mind that the form design should have different style, the principals login form need including just three elements: a username, a password , and a submit input. Because the markup is so simple, it allows for more flexibility when we code it into HTML and CSS.

The CSS Transitions Cheatsheet When it comes to CSS Transitions, you don't need a bazillion pages of content or even a book to quickly figure out something. If you are in a rush or just want something you can refer to really quickly, I've created this handy cheatsheet that provides snippets for common CSS Transitions situations. If you find something missing that should be here, post here and I'll get to it shortly :P Enjoy!

Building a Responsive Mega Menu with Foundation Mega menus are a design trend often used on large sites such as e-commerce and educational sites. For example, eBay’s mega menu: But what exactly is a mega menu? Well, let’s see how Jakob Nielsen describes it: A mega menu (a big, 2-dimensional drop-down panel) groups navigation options to eliminate scrolling and use typography, icons, and tooltips to explain users’ choices. So, with that in mind, this article aims to help you understand how to build a simple responsive mega menu with Foundation. Simple and Nice Blockquote Styling The blockquote displays in standards-compliant browsers with the "big quotes before" effect, and in IE with a thick left border and a light grey background. Unlike other blockquote techniques, this style does not require a nested block-level element (like p). As such, it turns a paragraph into an inline-styled element to keep the content from dropping below the quote. Example

CSS: centering things See also the index of all tips. Centering lines of text The most common and (therefore) easiest type of centering is that of lines of text in a paragraph or in a heading. 50 Amazing jQuery Plugins That You Should Start Using Right Now Martin Angelov jQuery has a wonderful community of programmers that create incredible things. However, it may become difficult to sift through everything that is released and find the gems that are absolute must-haves. This is why, in this post, you will find a collection of 50 new jQuery plugins and JavaScript libraries that, when applied with good measure, can make your sites a joy to use. The plugins are organized into categories for easier browsing.