Question: I have a few divs inside a parent section and I'm trying to do an alignment so that the divs are centered within the section. As they are right now, the divs are left aligned. I've tried doing `margin: 0 auto` but that's not working. Can anyone explain how I could accomplish this?

[Pen](http://codepen.io/RobbyT15/pen/xqeoEL)

```css
section {
  margin-bottom: 10px;
  width: 100vw;
  height: 100vh;
}

.notice {
  width: 50vw;
  height: 10vh;
}

section .socialmedia{
    background-color: red;
    width: 100vw;
    height: 15vh;
}
//The divs I'm trying to center
section .icon{
    margin: 0 auto;
    width: 15vw;
    height: 15vh;
    background-color: green;
}
```

```html
<section>
  <div class="notice">
    <h1>Our website is currently undergoing construction, please feel free to contact us on social media.</h1>
  </div>
  <div class="socialmedia">
    <div class="icon"></div>
    <div class="icon"></div>
    <div class="icon"></div>
    <div class="icon"></div>
  </div>
</section>
```

Answer: 
Eventually I found an answer in [this thread](https://stackoverflow.com/a/27298880). The method I was looking for is [run\_in\_executor](https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.run_in_executor). This allows a synchronous function to be run asynchronously without blocking an event loop.

In the `sleep` example I posted above, it might look like this:

```
import asyncio
from time import sleep

async def sleep_async(loop, delay):
    # None uses the default executor (ThreadPoolExecutor)
    await loop.run_in_executor(None, sleep, delay)
    return 'I slept asynchronously'

```

Also see the following answer -> [How do we call a normal function where a coroutine is expected?](https://stackoverflow.com/questions/38557768/how-do-we-call-a-normal-function-where-a-coroutine-is-expected)
Maybe someone will need my solution to this problem. I wrote my own library to solve this, which allows you to make any function asynchronous using a decorator.

To install the library, run this command:

```
$ pip install awaits

```

To make any of your functions asynchronous, just add the @awaitable decorator to it, like this:

```
import time
import asyncio
from awaits.awaitable import awaitable

@awaitable
def sum(a, b):
  # heavy load simulation
  time.sleep(10)
  return a + b

```

Now you can make sure that your function is really asynchronous coroutine:

```
print(asyncio.run(sum(2, 2)))

```

"Under the hood" your function will be executed in the thread pool. This thread pool will not be recreated every time your function is called. A thread pool is created once and accepts new tasks via a queue. This will make your program run faster than using other solutions, because the creation of additional threads is an additional overhead.