CSS Basics

CSS Floating and Clearing

Floats in CSS are properties used to float HTML elements and take the element out of the normal flow in order to position it either left or right of its surrounding container.
A simple example of floats in use is seen when text is wrapped around an image. Consider the following HTML.
<!DOCTYPE html>

CSS Specificity

CSS Specificity determines what CSS rule should be applied in the browser. It is common belief that rules have higher priority if they are declared further down in the CSS file. This is not always the case. Consider the following code below.
:et’s assume that the following rule within a CSS file is in place.