WeCode
Academy
Tutorials
Web Development
Bootstrap
CSS
HTML
JavaScript
jQuery
Node.js
PHP
React
TypeScript
Programming
C
C#
C++
Go
Java
Python
Rust
Data and Databases
NumPy
Pandas
SQL
Tools
Bash
Git
Projects
Project: A Tiny Shell in C
Project: Bank Account System
Project: Library Management System
Project: Portfolio Page
Project: Quiz App in React
Project: Sales Data Analysis
Project: Server Log Analyser
Project: To-Do REST API
Project: URL Shortener
Project: Word Counter in Four Languages
All tutorials ❯
Paths
References
Practice
Try it editor
Quizzes
How To recipes
Tools
Glossary
My Learning
🌙
Dark mode
Home
›
References
›
CSS Properties
❮ z-index
clear ❯
float
Floats an element left or right.
Group: Layout
Syntax
float: left | right | none;
Example
Example
html
<div style="float:left;width:60px;height:60px;background:teal;margin:0 10px 0 0"></div><p>Text flows around the floated box. Text flows around the floated box.</p>
Run ❯
Reset
Open in editor »
← All of CSS Properties