Ir al contenido principal

Entradas

Limitar texto con CSS

HTML: <span class= "text" > Hello world this is a long sentence </span> CSS: .text {   display : block ;   width : 100px ;   overflow : hidden ;   white-space : nowrap ;   text - overflow : ellipsis; }  RESULTADO: Hello world t...

Centrar un verticalmente un Span dentro de un contenedor Div

En caso de ser una sola línea:     div {       height : 200px ;     }          span {       line-height : 200px ;     } En caso de desconocer cuantas líneas serán:     div {       display : table;     }           span {       display : table-cell ;       vertical-align : middle ;     }

line after div LESS

div {     position : relative ;     width : 300px ;     height : 150px ;     &: after {         content : "" ;         width : 2px ;         height : 100 % ;         background : red;         top : 0 ;         right : 0 ;         position : absolute ;         display : inline - block ;     } }

Estilo generico para select (todos los navegadores)

select :not ([multiple]) {     - webkit - appearance : none ;     - moz - appearance : none ;     background-position : right 50 % ;     background-repeat : no-repeat ;     background-image : url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG...

Selector :nth-child CSS

Selector :nth-child CSS https://css-tricks.com/examples/nth-child-tester/ /* Seleccionar el elemento 5 */ li :nth-child (5) { ...   }   /* Seleccionar todos menos los primeros 5 elementos */ li :nth-child (n+6) {   ... }   /* Seleccionaar los primeros 5 elementos */ li :nth:child (-n+5) {   ... }   /* Seleccionar un elemento cada 4 */ li :nth-child (4n) {   ... }   /* Seleccionar solo los elementos impares */ li :nth-child (odd) {   ... }   /* Seleccionar solo los elementos pares */ li :nth-child (even) {   ... }   /* Seleccionar el último elemento */ li :last-child {   ... }   /* Seleccionar el penúltimo elemento */ li :nth-last-child (2) { ... }

resize amCharts

<! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < title > AmCharts < /title>     < style >         # chartdiv {             width         : 90 % ;             height         : 500 px ;             font - size     : 11 px ;               overflow     : auto ;             position     : absolute ;             resize       : both ;         }          ...

Scroll Horizontal Selector

LESS: div .container {     width : 100 % ;     height : 100 % ;     overflow-x : scroll ;     overflow-y : hidden ;     white-space : nowrap ;     div . item {         width : 40px ;         height : 30px ;         margin-right : 1px ;         background-color : yellow;         display : inline ;     } } Javacsript: Element . prototype . hScroll = function ( options ) {     var selector = this ;     function scroll ( obj , evt ) {             var direction = evt . detail ? evt . detail * ( - 120 ) : evt . wheelDelta ;         ...