Resize an image in HTML

Preserving the aspect ratio while resizing images When you specify both height and width, the image might lose its aspect ratio. You can preserve the aspect ratio by specifying only width and setting height to auto using CSS property. img { width: 400px, height: auto }   This will render a 400px wide image. The height is adjusted accordingly to preserve the aspect ratio […]

Read More

add external link icon before link

a[href*=”//”]:not([href*=”yourwebsite.com”]) { /* Apply style here */ } This CSS selector takes all a tags which href attribute contains two forward slashes (to filter out relative URLs) and which doesn’t contain the URL of your website. article

Read More

A Comprehensive Look at jQuery Selectors

A Comprehensive Look at jQuery Selectors By Baljeet Rathi August 02, 2016 This article was peer reviewed by Matt Smith and Tim Severien. Thanks to all of SitePoint’s peer reviewers for making SitePoint content the best it can be! More from this author A History of CSS Image Replacement Five Ways to Hide Elements in […]

Read More

A list of everything that could go in the of your document

HEAD A list of everything that could go in the <head> of your document Table of Contents Recommended Minimum Elements Meta Meta: Not Recommended Link Link: Not Recommended Favicons Social Facebook / Open Graph Facebook / Instant Articles Twitter Google+ / Schema.org OEmbed Browsers / Platforms Apple iOS Apple Safari Google Android Google Chrome Microsoft […]

Read More

HTML5 Elements

HTML5 Elements home This is the global <header> element for this page, including the<nav> element. Global <nav> link within the <header> Global <nav> link within the <header> main header Article header Download the HTML and asset files (ZIP does not include audio or video to reduce file size. You can download them from this page […]

Read More