CSS: Object Fit
The CSS property object-fit scales an element to within the width and height of the container it’s in. Background images are the most common element that you will come across as a developer that uses this property. There are five…
Centering Text in HTML
How to Center Text in HTML One of the first things we learn as programmers is how to align blocks of text. In this article, we’ll take a look at how to align text in the center of your container…
CSS Span
<span> elements are a generic HTML element similar to <div>. If you recall, divs are a generic container primarily used for the layout of a webpage and take up as much space as they can because they are a block…
CSS Sticky Footer
Sticky footers are not to be confused with fixed footers – a sticky footer is a pattern where the footer always sticks either to the bottom of the screen (in cases where content does not fill up the page) or…
CSS Border Image
The border-image property in CSS is a bit tricky to wrap your mind around at first. In this article, we’ll discuss what the border-image property is, how to use it and its idiosyncrasies when it comes to using it in…
How to Create HTML Image Links
Images are common components of any web page. They are also a great way to create a link to another page. By using a combination of anchor tags with an href attribute and image tags, we can create an image…
What are HTML divs and how are they used?
The <div> is a generic container that is used in HTML to group elements together so style can be applied to them using CSS; div elements are empty by default and have to be filled with HTML elements to work.…
Center Elements With CSS Using Text-Align, Margins and More
In this CSS tutorial, we will go over how to center text and block elements. There are several tricks you can use to center elements horizontally and vertically in a layout. Center Align Text Elements To center align text inside…
CSS Flexbox
The CSS Flexbox Model was created to improve the established CSS Box Model. The Flexbox Model still contains the major elements of the Box Model (margin, padding, border and content), but offers flexibility to best fill the space with the…
How to Link CSS to HTML to Make Markup More Readable
As coders who have just learned CSS, we first start to incorporate CSS to our web pages as inline-styling. We use the style attribute to inject the CSS directly on our HTML element: <!DOCTYPE html> <html> <head> <title>Inline Style</title> </head>…
How to Insert Icons Using a CDN
Icons work well for illustrating actions a user can take in an application. There are several icon libraries readily available. Here are a few of the many: Font Awesome - https://fontawesome.com/Flaticon - https://www.flaticon.com/Material Design Icons - https://material.io/resources/icons/ There are certainly…
CSS Padding: A Step-By-Step Guide
The CSS padding property creates a space between an element’s borders and content contained inside of that element. Padding has subproperties that allow for unique padding sizes on all sides and accepts inherit, length, and percentage as values. When you’re…
CSS Inline-Block
The display property is integral to the layout of a webpage. The display property determines how an element is displayed in relation to the elements around it. There are several values for this CSS property; the most used values include…
CSS Vertical Align Property
When writing CSS, you may encounter a situation where you would like to change how an element is aligned on the page. In this article, we will explore the CSS property and the property values that will alter how an…
Declaring an HTML Doctype
When starting a new HTML document, one of the first things to do is write your document type declaration. A doctype declaration tells the browser that the page to be rendered is written in HTML. To declare an HTML5 doctype,…
Adding HTML Space Tags
When writing HTML, you’ll notice additional spaces made when you press the spacebar do not appear when text is rendered in the browser. For example: <p>April is the cruelest month,</p> <p>April is the cruelest month,</p> In the first <p> tag,…