How to keep title of div content?

I have a web page built in angularjs.

<html>
<head></head>
<body ng-app="app1" ng-controller = "ctrl1">

<header></header>

<div ng-view></div>

<footer></footer>

</body>
</html>

Here, the header and footer are always fixed, but in the content section, when I am routing, and in one of the views, I have a header that I always want to correct.

The problem is that when you use position:fixedcontent for this title and when you move the scroll of the main page, the content under the title seems to move up.

so my question is how can I create this title so that when scrolling through the content section or the main section, the title should always be fixed. enter image description here

Any help is appreciated !!!

thank

+4
3

, padding-top , . ,

.content-header {
height: 30px;
position: absolute;
top: 0px;
}
.content-container {
padding-top: 30px;
overflow: scroll;
position: relative;
}
+1

overflow: scroll; div.

<div class="content" ng-view></data>

.content {
    width: 150px;
    height: 150px;
    overflow: scroll;
}

: http://www.w3schools.com/cssref/pr_pos_overflow.asp

0

Source: https://habr.com/ru/post/1657579/


All Articles