background preloader

CSS

Facebook Twitter

CSS 3D Image Flip Gallery With Dynamic Shadows. My recent book Pro CSS3 Animation walked the reader through a simple version of a 3D flip image gallery. After publication, I wanted to take it further: thus, this article. The UI challenge addressed here is the same focused on in many of my other CSS 3D works, such as the Origami UI: we live in a world of increasingly diversified screens, with smaller sizes rapidly becoming the norm. That demands a reconsideration of space: rather than placing captions below photographs, we might want to place them behind the image, to be revealed with a mouseover or tap action.

Creating The Basic Gallery The markup for the image flip gallery couldn’t be much simpler: <figcaption>Yacht</figcaption> <figcaption>Bee</figcaption> <figcaption>Queens-town</figcaption> Note the outer div for each figure, which will be used to create a 3D context for the gallery content. To gain the 3D effect shown in the example, we need to do three things: The Initial CSS div.flip-3d { perspective: 1200px; width: 30%; float: left; How to create slick effects with CSS3 box-shadow. Drop shadows and inner shadows are some of the effects I learned to apply using Photoshop's Blending options. But now, since CSS3 "hit the charts", you don't need Adobe's design tool to add a drop shadow or an inner shadow to a box.

Nowadays, the cool thing is that you create beautiful CSS3 shadows without actually needing Photoshop anymore. View demo box-shadow property Thebox-shadow property allows you to add multiple shadows (outer or inner) on box elements. To do that you must specify values as: color, size, blur and offset. <shadow> = inset? Rocket science? Not at all, here's an quick example: box-shadow: 3px 3px 10px 5px #000; This CSS declaration will generate the following shadow: A positive value for the horizontal offset draws a shadow that is offset to the right of the box, a negative length to the left.The second length is the vertical offset. The above theory it's just a small amount, if you want to read more, than be my guest and check the W3C specs.

Add depth to your body. Responsive Images Done Right: A Guide To <picture> And srcset. Responsive Images: If you're just changing resolutions, use srcset. | CSS-Tricks. By Chris Coyier On September 30, 2014 responsive images If you're implementing responsive images (different images in HTML for different situations) and all you are doing is switching between different versions of the same image (the vast majority of usage), all you need is the srcset attribute on the <img>.

Gaze upon this easy syntax: It's not just the syntax that is easy, it does a better job than <picture> with <source>s with explicit media attributes (we'll cover why in a moment). Plus it has the opportunity to be much better in the future with browser settings and browser improvements. I've screencasted about this before, but it clicked better watching Mat Marquis's talk at An Event Apart Austin and with Jason Grigsby's post. I'm writing about it again here because I think it's important for all of us to understand.

#With srcset, the browser does the work of figuring out which image is best Mat Marquis demonstrated this by showing how the browser approaches it with math. #Also, sizes. 19 tips y trucos para CSS. El CSS es la manera más perfecta de ponerle estilos y efectos a tus diseños web, y ahora con CSS3 trae más posibilidades de afectar y mejorar tus diseños. Es por eso que aquí te traigo algunos tips y trucos para CSS, para que puedas implementarlos fácilmente en tu diseño web. Cambiar el color de la selección de texto Cuando seleccionas un texto por defecto el texto se convierte en color blanco y el fondo en color azul, pero que pasa si quieres que esto sea diferente en tu web. Solo debes pegar esto en tu CSS: Demostración Letra capital Con este código puedes hacer que la primera letra de un párrafo sea más grande que las demás: Demostración Enlaces que gradualmente se desvanecen Con este código harás que cuando un usuario ponga el cursor encima de un enlace (en este caso el enlace del título), éste se desvanezca: Demostración Rotar una imagen Este Código CSS te permite rotar una imagen los grados que gustes: Demostración Mover 1px el enlace al hacer clic Demostración CSS3 Media Queries [/css] [css]

Pointer-events. The pointer-events property allows for control over how HTML elements respond to mouse/touch events – including CSS hover/active states, click/tap events in Javascript, and whether or not the cursor is visible. While the pointer-events property takes eleven possible values, all but three of them are reserved for use with SVG. The three valid values for any HTMl element are: none prevents all click, state and cursor options on the specified HTML elementauto restores the default functionality (useful for use on child elements of an element with pointer-events: none; specifiedinherit will use the pointer-events value of the element's parent As demonstrated above, the prime use case for pointer-events is to allow click or tap behaviour to “pass through” an element to another element below it on the Z axis.

For example, this would be useful for graphic overlays, or hiding elements with opacity (eg. tooltips) and still allowing text-selection on the content below it. Points of Interest. Pointer-events - CSS | MDN. Summary The CSS property pointer-events allows authors to control under what circumstances (if any) a particular graphic element can become the target of mouse events. When this property is unspecified, the same characteristics of the visiblePainted value apply to SVG content. In addition to indicating that the element is not the target of mouse events, the value none instructs the mouse event to go "through" the element and target whatever is "underneath" that element instead. Initial value auto Applies to all elements Inherited yes Media visual Computed value as specified Animatable *Value 'animatable-pointer-events' not found in DB* Canonical order *Value 'order-pointer-events' not found in DB* Syntax pointer-events: auto;pointer-events: none;pointer-events: visiblePainted;pointer-events: visibleFill;pointer-events: visibleStroke;pointer-events: visible;pointer-events: painted;pointer-events: fill;pointer-events: stroke;pointer-events: all; pointer-events: inherit; Values auto none visible.

Css - Prevent body scrolling but ALLOW overlay scrolling. How to create Full screen Overlay Popup using CSS only. Full screen Overlay using CSS only Sometimes you need your entire browser window with a black tint in the background and make a popup at the center of the screen. Normally this technique is used for displaying a login window without moving from existing page or displaying a video, when a user clicks on a link or button in a web page. Full screen Overlay Effects When you search for a solution for fullscreen overlay, most website provide solutions using JavaScript or jQuery.

The following solution is using only CSS and not using any JavaScript of jQuery. Full Page Overlay Window Click the following button then you will get a full screen overlay with a pop-up window. The popup screen is a Login screen (its an image) and at the right above of the window there is a closing button also. More about CSS Overlay....CSS Overlay Techniques. CSS Overlay Techniques, How to create an overlay in css. Transparent Image Overlay The following CSS code shows how to transparent color overlay on images.

Also you can see how to overlay one div over another div. Move mouse over the image... Overlay a transparent div on an image Source Code Transparent Background Images In CSS, there is no property such as transperancy. More about .... Add color overlay to images The following css code shows how to make color overlay on image hover. CSS image hover color overlay Move mouse over the image... Add multiple color overlay to images You can add multiple color overlay on images while image hover. Move mouse over the image....... Text background overlay The following code shows how to give a Text Background color overlay while mouse hover. Move mouse over the textbox....... Greenpeace is a non-governmental environmental organization with offices in over forty countries and with an international coordinating body in Amsterdam, the Netherlands CSS Text hover Color Overlay Position one image on top of another.

Should I add the height and width to the img src tag? Yes. Adding the height and width attributes to your IMG SRC HTML tag allows the browser to know how much space to leave for an image. Without these values, the browser gives an image no space until the image is loaded, which means anything surrounding the image is adjusted after the image has loaded. As seen in the above example, the first three pages show a page loading that does not specify the image dimensions. As the pages loads, the text surrounding the images is adjusted to accommodate the image. However, with the image dimensions specified as shown in the next three pages, the browser knows how big of space to leave for the image, so the text remains in the same place as the images load. If you have a fast Internet connection you may not notice this loading process. Below is an example of how an IMG tag should look in your HTML code with the height and width specified in the code.

Filter. CSS Filters are a powerful tool that authors can use to achieve varying visual effects (sort of like Photoshop filters for the browser). The CSS filter property provides access to effects like blur or color shifting on an element’s rendering before the element is displayed. Filters are commonly used to adjust the rendering of an image, a background, or a border. The syntax is: Where blur()brightness()contrast()drop-shadow()grayscale()hue-rotate()invert()opacity()saturate()sepia()url() - for applying SVG filterscustom() - "coming soon" Multiple functions can be used, space separated. Example of a single filter being used: Example of multiple filters being used: #Filter Functions To use the CSS filter property, you specify a value for one of the following functions listed above.

Below we'll use a variety of different filter functions on this image: #grayscale() filter: grayscale([ <number> | <percentage> ]) Converts the input image to grayscale. #sepia() filter: sepia([ <number> | <percentage> ]) Css - Print styles: How to ensure image doesn't span a page break. CSS at the Top. Absolute Positioning Inside Relative Positioning | CSS-Tricks. A page element with relative positioning gives you the control to absolutely position children elements inside of it. To some, this is obvious. To others, this may be one of those CSS “Ah-ha!” Moments. I remember it being a big deal for me when I first “got it”. Here is a visual: The relative positioning on the parent is the big deal here.

Look what would happen if you forgot that: This is a significant change. Once you “wrap” your head around this concept (rim-shot) you will find little uses for it all over the place, and start noticing examples of other places using it. You can play with the above demo here: How about some examples? I’d be delighted. View Demo Download Files. Centrar verticalmente con CSS; 6 formas diferentes de lograrlo.

A veces, por motivos de estética, nos viene bien alinear verticalmente un sitio web. En los tiempos en que las webs se hacían con tablas, esto era sencillo gracias a la propiedad vertical-align de las mismas; pero con la aparición de las capas (Divs) y desaparición de las tablas esta propiedad murió. Hoy traigo 6 formas diferentes de alinear una web verticalmente con CSS sin morir en el intento, totalmente validadas por el W3C y que dará ese toque que le falta a tu web. Método con flexbox (más moderno y recomendado) Este método es el más recomendado y fácil de implementar, basta con asignar al padre de nuestro html el siguiente código CSS: <div class="padre"><div class="hijo">Contenido aquí.

Con la propiedad justify-content: center hacemos que se centre horizontalmente, mientras que con align-items: center hacemos lo propio verticalmente. Método del alto de linea (Line-height method) La forma de implementarlo sería la siguiente: <div class="padre"><div class="hijo">Texto alineado aquí. Fuente. Dix trucs CSS que vous ne connaissez peut-être pas | W3Québec. 1. Abréger l'écriture des règles CSS de police Lorsque vous donnez un style à une police en CSS, vous le faites peut-être comme ceci : font-size: 1em; line-height: 1.5em; font-weight: bold; font-style: italic; font-variant: small-caps; font-family: verdana,serif; Non seulement ce n'est pas nécessaire, mais le raccourci suivant existe : font: 1em/1.5em bold italic small-caps verdana,serif; Bien mieux!

2. Habituellement, les attributs ne sont assignés qu'à une classe, mais cela ne signifie pas qu'il ne soit pas permis de faire autrement. <p class="text side">... Utiliser ces deux classes ensemble (séparées par une espace et non par une virgule) signifie que le paragraphe va appliquer les règles assignées à text et à side. 3. Lorsque vous écrivez une règle de bordure, vous en spécifiez généralement la couleur, la largeur et le style (dans n'importe quel ordre). Si vous indiquez simplement border: solid; les valeurs par défaut pour cette bordure seront utilisées. 4. ! Margin-top: 3.5em ! 5. 6. 7. Aplica css a los ‘title’ de tus enlaces.. no seas aburrido! | Jugando entre diseñadores. Hoy he tenido una mañana horrible, todo lo veía feo, todo me descuadraba.. ufff! Menos mal que he tenido un ratito para relajarme y he dicho.. basta, hora de solucionar cosas. Mi problema era el siguiente:“Tengo un formulario con X campos, y hay campos que pido información que no todo el mundo sabe lo que és, por lo tanto he puesto un signo de interrogación (?)

Al lado. Lo que quiero es: que cuando pase el cursor por encima del interrogante aparezca un mensaje de ayuda al usuario.” Con el atributo title tengo una solución un tanto chapucera para el problema, a malas podría pasar. Pero me surgen más problemas: – Es poco llamativo, podría pasar desapercibido para mis usuarios. – Necesito poner una foto dentro de ese title (un poco complicado eh) ya que con el texto igual no terminan de entenderlo. Así que cómo casi todo está inventado me he puesto a buscar y buscar por mi amigo Google a ver quién me podía dar una solución, hasta que me he topado con esto: nice titles de 1976desing. por: Box Sizing | CSS-Tricks. The box-sizing property can make building CSS layouts easier and a lot more intuitive. It's such a boon for developers that here at CSS-Tricks we observe International Box-Sizing Awareness Day in February. But, how is it so helpful and beloved that it deserves its own internet holiday? Time for a little bit of CSS history.

Box Model History Since the dawn of CSS, the box model has worked like this by default: width + padding + border = actual visible/rendered width of an element's box height + padding + border = actual visible/rendered height of an element's box This can be a little counter-intuitive, since the width and height you set for an element both go out the window as soon as you start adding padding and borders to the element. Back in the old days of web design, early versions of Internet Explorer (<= IE6) handled the box model differently when it was in "quirks mode". Width = actual visible/rendered width of an element's box height = actual visible/rendered height of an element's box. Ayuda al usuario a rellenar formularios con CSS. @Font-face y sus problemas. Guía de uso y solucción de problemas.

FORM

How to avoid extra blank page at end while printing? Printing - Extra blank page when I print (except in IE) - is it my print css? How to force CSS background images to print in web browsers | Printing - How can I force browsers to print background images in CSS? Une feuille de styles de base pour le media print. 10 Tips for Better Print Style Sheets. 12 errores comunes que cometen los desarrolladores de páginas web. PHP, CSS, HTML5, Rendimiento. @page :nth( ) Selector Css de página en medios paginados. No olvides tu hoja de estilo CSS para impresión - Pablo Román | Diseño y desarrollo web. 13.2. Versión para imprimir. Orphans | CSS-Tricks.

mPDF Manual. La regla @page en los medios paginados. Media=”print” (actualizado) | CSSLab | Laboratorio de ideas web. Cómo calcular tamaños tipográficos para Web. Las medidas em y rem en CSS3. Unitless line-heights. Line-height global en CSS. ¡Practica con line-height. CSS, HTML5, Programacionweb, Diseño web. 10 errores comunes en los css.

Hyphens | CSS-Tricks. Word-wrap en CSS 3. The CSS white-space Property Explained. Hyphens extendido. Mayor control con Css en el corte de palabras. How to Size Text in CSS. Px - em - % - pt - keyword | CSS-Tricks. CSS Sticky Footer. Html - div height set with max-height => make contained div takes full height using css. Html - Relative div height. CSS Text Level 3: Novedades. Propiedad text-indent de CSS | Properties by Example. A grouped pure CSS parallax demo by Keith Clark. El misterioso espacio extra en divs sin altura declarada. Su porqué y 3+1 soluciones. Display: inline-block y sus espacios en blanco de separación. 8 soluciones más 1 universal. Css - jQueryUI slider: absolutely positioned element & parent container height.

Aclarando la cuestión de si "los ids y class pueden comenzar por un número" 13.7. Recomendaciones generales sobre CSS. La fonction calc() en CSS. La función calc() en CSS3 ‹ Digital Icon: Desarrollo web versátil. Declaring character encodings in CSS. CSS-Tricks. CSS Reference.

CSS3: Cómo crear líneas diagonales. Creating Intrinsic Ratios for Video. Edit fiddle. Edit fiddle. Code 34m0: Simplifying a javascript jump menu. Remove Button Focus Outline Using CSS | Karl Rixon. Unicode Codepoint Chart. Cómo usar caracteres especiales o símbolos a través de Css. Errores comunes del desarrollo web.

Browser CSS hacks. CSS Browser Hacks | Fix CSS Problems. Is there a css hack for safari only NOT chrome? Distinguir entre Google Chrome y Safari con CSS. Understanding CSS 3D Transforms 1 | eleqtriq. Tres Hacks Css para Webkit. CSS hacks for Google Chrome web browser. Filtros para imágenes con CSS3. 1.10. Rollovers y sprites (CSS avanzado) Imagen el gris y al pasar el mouse en color!. CSS para decolorar imágenes a escala de grises. Es/Referencia de notación abreviada de CSS - Web Education Community Group.

Uso de las unidades Css vw y vh en el diseño de sitios web modernos. Create a Responsive CSS-only Masonry layout. Masonry layout con puro CSS | CybMeta. CSS3: Cómo crear líneas diagonales. An Introduction To The CSS3 Multiple Column Layout Module. Cambiar el color del texto seleccionado. Deshabilitar selección. Masonry in CSS. Técnicas de tipografía con CSS. Centrar verticalmente con CSS; 6 formas diferentes de lograrlo. Create Headings with Lines in CSS. Horizontal Line Behind a Heading with CSS. Centered Heading Overlaying a Horizontal Line with CSS. Html - CSS Title with Horizontal Line on either side.