Close

Sign in to your account



This field is required


forgot your password?


New to the site? Create an account →

Floating is different than alignment

tcr! · Jun 22, 2015 at 1:40 pm

Below is a screenshot of some CSS code I stumbled on a few hours ago:

floating is different than alignment

When I saw it, I just wanted to smack the nearest “hacker” with a keyboard.

Floating elements have text content wrapped around it and then alignment is to control the text direction for the whole element. So you float an image left or right and then have the text wrap around the image. Or you center align your text or left align it.

See better examples on CSS-Tricks: float and text-align.

This may be semantics but when you’re writing code other people are going to deal with, using proper and meaningful naming conventions can save them hours of time.

#devhell #webdev

Add a comment

It’d be better if you signed in before commenting


Post



Latest articles for #devhell

Jun 6th, 2019 at 11:47:17 am

Jun 6th, 2019 at 11:47:17 am

Jun 6, 2019 at 11:47 am

The function/method MUST return the number of bytes written.Why? I’m…

Developer laments, a Cobain quote, and more!

Developer laments, a Cobain quote, and more!

Jan 10, 2019 at 12:46 pm

Being a dork web developer who: loves code is forced to use WordPress…

Phone number optionally required

Phone number optionally required

Dec 1, 2018 at 12:05 pm

Good one Google. 🙄 #devhell #google

Aug 20th, 2018 at 3:16:17 pm

Aug 20th, 2018 at 3:16:17 pm

Aug 20, 2018 at 3:16 pm

Writing a valid, functional, and strict MySQL regular expression for…