# Why float is not working inside the contact

**URL:** <https://forum.freecodecamp.org/t/why-float-is-not-working-inside-the-contact/435996>\
**Category:** Curriculum Help\
**Tags:** html, css\
**Created:** [December 17, 2020, 5:11pm UTC](https://forum.freecodecamp.org/t/why-float-is-not-working-inside-the-contact/435996 "2020-12-17T17:11:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ap\_limon](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ap_limon/32/194196_2.png) [@ap\_limon](https://forum.freecodecamp.org/u/ap_limon)\
**Post date:** [December 17, 2020, 5:11pm UTC](https://forum.freecodecamp.org/t/why-float-is-not-working-inside-the-contact/435996/1 "2020-12-17T17:11:40Z")

</div>

```auto
<!doctype html>
<html>
<head>
<style>
#contact {
    border: 1px solid red;
    height: auto;
    width: 100%;
    padding: 20px 5px;
    background-color: rgba(252, 252, 203, .8);
    font-size: x-large;
}
#col-45 {
    border: 1px solid red;
    float: left;
    height: 160px;
    width: 45%;
}
#col-55 {
    border: 1px solid red;
    float: right;
    padding: 0 10px;
    height: 160px;
    width: 55%;
}
</style>
</head>
<body>
<div id="contact">
        <div id="col-45">
            <address>
                AP'S FOOD <br>
                Shop no38, Sanmar Ocean city, Southern street <br>
                Bahaddarhat, Chandgaon, Chittagong shadar <br>
                Chattagram
            </address>
            <p>contact: <i class="fab fa-facebook"></i> <i class="fab fa-github"></i> <i class="fab fa-twitter"></i> <i class="fas fa-phone-volume"></i></p>
        </div>
        <div id="col-55">
            <fieldset>
                <legend> If you anything to say or report anything you can send a mail to us from here.</legend>
                <form action="https://www.freecodecamp.com/email-submit" id="form">
                    <label for="email" class="col-20">Email:</label>
                    <input type="email" name="email" id="email" placeholder="your Email" class="col-80"><br>
                    <label for="text" class="col-20">Your massage:</label>
                    <textarea name="text" id="text" class="col-80"></textarea> <br>
                    <input type="submit" name="submit" id="submit" value="submit">
                </form>
            </fieldset>
        </div>
    </div>
	</body>
	</html>

```

---

<div class="post-metadata">

**Author:** ![bbsmooth](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/bbsmooth/32/203556_2.png) [@bbsmooth](https://forum.freecodecamp.org/u/bbsmooth)\
**Post date:** [December 17, 2020, 6:05pm UTC](https://forum.freecodecamp.org/t/why-float-is-not-working-inside-the-contact/435996/2 "2020-12-17T18:05:42Z")

</div>

It actually is working. If you get rid of the side padding and borders you will see that the col-55 div floats to the right of the col-45 div.

But you don’t want to use floats for this. You probably want to use flexbox:

> **[A Complete Guide to Flexbox | CSS-Tricks](https://css-tricks.com/snippets/css/a-guide-to-flexbox/)**
>
> Our comprehensive guide to CSS flexbox layout. This complete guide explains everything about flexbox, focusing on all the different possible properties for the parent element (the flex container) and the child elements (the flex items). It also...

---

<div class="post-metadata">

**Author:** ![ap\_limon](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ap_limon/32/194196_2.png) [@ap\_limon](https://forum.freecodecamp.org/u/ap_limon)\
**Post date:** [December 17, 2020, 6:11pm UTC](https://forum.freecodecamp.org/t/why-float-is-not-working-inside-the-contact/435996/3 "2020-12-17T18:11:29Z")

</div>

got this bro… height was the prblm

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [May 31, 2021, 2:35pm UTC](https://forum.freecodecamp.org/t/why-float-is-not-working-inside-the-contact/435996/4 "2021-05-31T14:35:58Z")

</div>

Closed on May 31, 2021, 2:35pm UTC


