Sunday, April 14th, 2019
To get rid of the horrible spacing between the last two elements on a row of elements which are being aligned with
justify-content: space-between
… try the following:
.grid {
display: flex;
flex-flow: row wrap;
justify-content: space-between;
}
.grid::after {
content: "";
flex: auto;
}
Tags: CSS, flex, flexbox, justify content, space-between, white space
Posted in CSS | No Comments »
Friday, February 22nd, 2019
In this example .article-grid
will be block
unless the browser has support for display: grid
, at which case, the styles within the @supports
block will kick in and override the previous display
declaration.
.article-grid {
display: block;
}
@supports (display: grid) {
.article-grid {
display: grid;
}
}
Tags: @supports, browser support, CSS, css3, Display, Grid
Posted in CSS | No Comments »
Tuesday, February 12th, 2019
Drop this in to your console in dev tools and all elements with position: absolute
will render with a border.
var absElements = [];
$("*").css("position", function(i, pos){
if(pos==="absolute") absElements.push(this);
});
$(absElements).css({border:"5px solid red"});
Tags: attribute, CSS, elements, find, jQuery, propert, search by property, search for
Posted in CSS, jQuery | No Comments »
Tuesday, June 26th, 2018
Add the following in your mixins .scss file:
// RESPONSIVE FONTS @include fluid-type(1.3rem, 1.7rem);
@mixin fluid-type($min-font-size: 1.3rem, $max-font-size: 2.2rem, $lower-range: 540px, $upper-range: 960px) {
font-size: calc(#{$min-font-size} + #{(($max-font-size / ($max-font-size * 0 + 1)) - ($min-font-size / ($min-font-size * 0 + 1)))} * ( (100vw - #{$lower-range}) / #{(($upper-range / ($upper-range * 0 + 1)) - ($lower-range / ($lower-range * 0 + 1)))}));
@media screen and (max-width: $lower-range) {
font-size: $min-font-size;
}
@media screen and (min-width: $upper-range){
font-size: $max-font-size;
}
}
Then call that mixin within your theme .scss files with:
.div {
@include fluid-type(1rem, 3rem);
font-weight: 300;
}
Finally, make sure you set your html tag to have a set font-size as a percentage e.g. 62.5%…
html {
font-size: 62.5%;
}
Tags: CSS, Fluid type, mixin, SASS, SCSS
Posted in CSS | No Comments »
Thursday, November 16th, 2017
Use this snippet to highlight all images with no alt tag – good way to highlight everywhere you’ve missed a tag!
img[alt=""], img:not([alt]) {
border: 5px solid red;
}
Original post below:
http://twitter.com/AllThingsSmitty/status/930617039085035520
Tags: Alt tag, CSS, empty, images
Posted in CSS | No Comments »
Wednesday, August 16th, 2017
Ever wondered how you can stop underlines going over the top of descenders i.e. a word with letters that hang down… such as… empathy?
Underlined, that word looks like this empathy
In Chrome and Firefox it’s now possible! With text-decoration-skip…
.underline {
text-decoration: underline;
text-decoration-skip-ink: auto;
}
The same word empathy now looks like this empathy
Enjoy.
Tags: CSS, Decenders, decorations, styling, Text, text-decoration, text-decoration-skip
Posted in CSS | No Comments »
Tuesday, June 13th, 2017
Tags: Background video, Full page, video
Posted in CSS, HTML | No Comments »
Saturday, July 9th, 2016
Tags: Content, CSS, Justify, Left align, Property, Right align, text-align-last
Posted in CSS | No Comments »
Default comments SCSS | WordPress
Monday, January 2nd, 2017
Tags: Comments, CSS, SCSS, WordPress
Posted in CSS, WordPress | No Comments »