My page layout is like this
The height is split into 3 pieces:
top
, middle
, bottom
I want the page to fit the device height and width 100%, so there are no scroll bars on height or width
Right now I'm doing
#top {
...
height: 10%;
...
}
#middle {
...
height: 80%;
...
}
#bottom {
...
height: 10%;
...
}
And this works perfectly height-wise
Now I'm trying to split the bottom
part horizontally to have 3 elements shown in green on the picture - 2 circles on the sides, and a square element in the middle
And this is where I'm struggling to understand how to make it work, so I have 2 questions:
- Since the height of the page will be dynamic,
bottom
will have different height. If the height is 1000px - bottom will be 100px, the circles should haveheight: 100px; width: 100px; border-radius: 50%;
. If the height is 500px, it should to beheight: 50px; width: 50px; border-radius: 50%;
. Is there a way to make it dynamic? - For splitting the page into
top
,middle
,bottom
, I'm using simpleheight
CSS property, but for thebottom
row split into 3 I'm usingflex
, since that seems to be better. Is any way more preferred than the other? Should I just useheigth
andwidth
, or should I useflex
for the entire page?