One of many HTML components that often comes into collision with CSS is the img
component. As we realized in Request Metrics’ Fixing Cumulative Structure Shift Issues on DavidWalshBlog article, offering picture dimensions inside the picture
tag will assist to enhance your web site’s rating. However in a world the place responsive design is king, we want CSS and HTML to work collectively.
Most responsive design type changes are carried out through max-width
values, however whenever you present a peak
worth to your picture, you may get a distorted picture. The purpose ought to at all times be a show pictures in relative dimensions. So how will we make sure the peak
attribute does not battle with max-width
values?
The reply is as straightforward as peak: auto
!
/* assuming any media question */ img { /* Make sure the picture does not go offscreen */ max-width: 500px; /* Make sure the picture peak is responsive no matter HTML attribute */ peak: auto; }
The dance to please customers and search engines like google is at all times a enjoyable stability. CSS and HTML had been by no means meant to battle however in some instances they do. Use this code to optimize for each customers and search engines like google!
Fb Open Graph META Tags
It is no secret that Fb has turn out to be a significant visitors driver for every type of internet sites. These days even massive firms steer customers towards their Fb pages as a substitute of the company web sites immediately. And naturally there are Fb “Like” and “Suggest” widgets on each web site. One…
CSS Choice Styling
The purpose of CSS is to permit styling of content material and construction inside an online web page. Everyone knows that, proper? As CSS revisions arrive, we’re supplied extra alternative to manage. One of many little recognized styling possibility obtainable inside the browser is textual content choice styling.
MooTools onLoad SmoothScrolling
SmoothScroll is a unbelievable MooTools plugin however easy scrolling solely happens when the anchor is on the identical web page. Making SmoothScroll work throughout pages is as straightforward as a couple of further line of MooTools and a querystring variable. The MooTools / PHP In fact, this can be a…
Source link