Dev

CSS Trick: Clearing the Div Float

If the sidebar is floated to the right and is shorter than the main area the footer then is required to jump up into that available space, like below:

To fix it, you can 

#footer {
Clear: both;
}

or add an empty div before the footer block with the style set to:

<div style="clear:both;">

or, even better and more clever using a CSS pseudo selector (:after) to clear the floats. It’s extremely helpful in situations where making changes to the stylesheet is the only way to fix the problem.

.floatblock:after {
content: ".";
visibility: hidden;
display: block;
clear: both;
}

/via CSS-Tricks/

edge

Share
Published by
edge
Tags: CodingCSS

Recent Posts

Disable Copilot on Windows 11 via Group Policy GPO

If using Copilot right from the Taskbar isn't your thing, you should disable it. Even…

8 months ago

Setting Default Fonts in Word, Excel, Outlook, and PowerPoint via Group Policy

In an environment where standardizing things does matter, setting default fonts in Microsoft Office apps…

9 months ago

Wake-On-LAN (WOL) with Windows and PowerShell

Wake-On-LAN is a networking standard that lets you wake up a computer from either a…

9 months ago

How To Remove Restrictions Set in A Password-Protected PDF File

First of all, this is not to bypass a PDF file that requires a password…

10 months ago

How To Move My Outlook Navigation Bar Back From Left Back To the Bottom

Microsoft has been lurking about the idea of placing the Outlook navigation bar to the…

2 years ago

Headset with Microphone Echoing My Own Voice on Windows, What To Do?

One colleague came up to me the other day asking me to take look at…

2 years ago