Learn HTML

CSS Introduction

CSS Basic Syntax

CSS Selector

CSS Units

CSS Text

CSS Border

CSS Outline

CSS Padding

CSS Margin

CSS Height & Width

CSS Overflow

CSS Resize

CSS Background

CSS Box Sizing

CSS Position

CSS Float

CSS Clear

CSS Clip Path & Shape Outside

CSS Display

CSS Media Queries

CSS Pseudo Classes & Elements

CSS Filter

CSS Transition

CSS Transform

CSS Animation

CSS List Style

CSS Table

CSS Scrollbar Styling

CSS Icon

CSS Cursor

CSS Variable & Calc

CSS User Select

CSS Flexbox

Learn Javascript

Learn Django

Everything about css float property

What is float?

If we create two div or two boxes then it will set one after another.
But it's never set beside one another. To set it beside one another,
we use float property.

It has three value:
float:left;
Use this value to set box or div on the left side.
float:right;
Use this value to set box or div on the right side.
float:none;
This is a default value. We use this value to set box or
div one after another

<!DOCTYPE html>
<html>
<head>
<title> </title>
<style>
    #first_heading{
        border:solid 5px red;
        float:left;
    }
    .last_heading{
        border:solid 5px blue;
        float:right;
    }
</style>
</head>
<body>

<div id="first_heading">
    Welcome to this website
    Welcome to this website
    Welcome to this website
    Welcome to this website
    Welcome to this website
</div>
<div id="first_heading">
    Welcome to this website
    Welcome to this website
    Welcome to this website
    Welcome to this website
    Welcome to this website
</div>
<div class="last_heading">
    Welcome to this website
    Welcome to this website
    Welcome to this website
    Welcome to this website
    Welcome to this website
</div>

</body>
</html>

CodersAim is created for learning and training a self learner to become a professional from beginner. While using CodersAim, you agree to have read and accepted our terms of use, privacy policy, Contact Us

© Copyright All rights reserved www.CodersAim.com. Developed by CodersAim.