Skip to Content
Menu
This question has been flagged
2 Replies
1776 Views

Hello, first, please forgive me for the broken English, I am using a translator.


I'm new to development, and I'm having a problem centering my content.


I have a container that contains two divs, one with an SVG map inside and the other with text that changes depending on where you click on the map.


I want the two to be side by side, which works in my browser, but when I integrate my code into Odoo, everything goes all over the place.


Can you guide me?


(HTML, CSS, JS, Odoo16)


Avatar
Discard
Best Answer

Hi Bro,
If you want both divs in the same row you can use style=" display: flex". This will default make both divs in a row. I you want to make both divs aligned in the column, then you can use, style=" display: flex; flex-direction: column".
If you want to center align row-wise then you can use, style="justify-content: center" and if you want to align column-wise, then you can use, style="align-item: center".

Avatar
Discard
Author

Hi Pratyush Ratan,

First, thank you for your answer.
Unfortunately, When I apply your advice the map is at the top, but my text appears at the bottom (I have to scroll a little to find it…)

If you have time to take a look at the code on my Github to tell me where I'm wrong... (https://github.com/Matthis-LM/map-svg-odoo16/blob/main/indexx.html)

Best Answer

Hi

If you need to make two divs side by side you can use the style= display:flex ! important; inside your container.This important is giving to makes priority for your style.You can provide this style as inline.example:<div class="container"></div>
Or you can create a directory inside your module and provide this CSSexample:.container{ display:flex !important;}
and you can specify the path  in assets inside the manifest  like
'assets': {
        'web.assets_backend': [
               module_name/static/src/css/style.css        ]}


Hope it helps

Avatar
Discard
Related Posts Replies Views Activity
1
Jul 24
997
1
Jul 24
1088
1
Dec 22
1885
2
Mar 18
19167
1
Mar 15
3505