How to align the block to the center if the block position: fixed; ?
position: fixed;
margin 0; - does not work. Width is fixed.
margin 0;
For adaptive layout -
.fixed { position: fixed; left: 0; right: 0; top: 0; margin: 0 auto; width: 50%; height: 50px; background: gray; line-height: 50px; text-align: center; }
<div class="fixed">lorem </div
div { left: calc(50% - 'половина ширины внутреннего блока'px); }
Source: https://ru.stackoverflow.com/questions/586492/More articles:How many streams are running parallelStreamHow to use Dagger2 correctly?How to run a simple web application?What is the constructor with the Parcel parameter used for?A preprocessor directive that only defines a macro.Automatic opening of the window after it is closed JavaScriptWhy do we need variable tables and when should I use them?Why is the button below another?Click on the button of another program.onActivityResult (...) is not calledAll Articles