I am trying to make a chat ui using tailwind css. What i am trying to create is a sidebar annotated with a message list view and lastly, a input to send message. I am unable to get the desired view. If you run this code using tailwind css input_message
div doesn’t match the width of parent div, also when I use w-full
for input_message
, width becomes more than parent. Following is only the dummy design to tone down the issue I am facing currently.
<div class="flex h-screen">
<div class="sidebar m-0 h-full w-1/5 border border-gray-500">Side Bar for chat list</div>
<div class="m-0 h-full w-4/5 border border-gray-500">
<div class="messages border border-gray-900">messages list</div>
<div class="input_message absolute bottom-0 border border-gray-900">input message</div>
</div>
</div>
Link to try the same: https://play.tailwindcss.com/aERqae8v1B
Can anyone please tell me solution for the same? What i want is to make input_message
width to be same as that of parent. I am new to html and css and I have tried a lot of things but nothing seems to be working
Thanks in advance!
2
Answers
I will work with grid and flex in this case.
Something like that:
https://play.tailwindcss.com/x119T4d7JQ
You can do something like this