Theme Night

Css Float

Home » Css » Css Float

css float right

	Puts your div on the right side of the screen

  float: right;
  width: 50%;
  background-color: #f00;

Float element should have parent element that defined clear property.

<div class="clearfix">
    <div style="float: left;">Div 1</div>
    <div style="float: left;">Div 2</div>

.clearfix::after { 
   content: " ";
   display: block; 
   height: 0; 
   clear: both;

CSS Floats

img { 
	float: right;
	margin: 10px;

css float

/* Keyword values */
float: left;
float: right;
float: none;
float: inline-start;
float: inline-end;

/* Global values */
float: inherit;
float: initial;
float: revert;
float: revert-layer;
float: unset;

Css Related Post