Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #container {
- width: 800px;
- }
- #fixed {
- position: fixed;
- width: 100%;
- }
- <div id="container">
- <div id="fixed">Sitename</div>
- <p>
- blaat
- </p>
- </div>
- #container {
- width: 400px;
- border: 1px solid red;
- }
- #fixed {
- position: fixed;
- width: inherit;
- border: 1px solid green;
- }
- <div class="head">
- <div id="fx">123</div>
- </div>
- <div class="head">
- <div class="area_for_fix">
- <div id="fx">123</div>
- </div>
- </div>
- .head{
- min-width:960px;
- width:960px;
- nax-width:1400px;
- height:300px;
- border: 1px solid #000;
- **position:relative;**
- margin:0 auto;
- margin-top:50px;
- padding:20px;
- text-align:right;
- height:1500px;
- }
- .area_for_fix{
- **position:absolute;**
- right:0;
- width:150px;
- height:200px;
- background-color:red;
- }
- #fx{
- width:150px;
- height:75px;
- background-color:#ccc;
- **position:fixed;**
- }
- -webkit-transform: translateZ(0);
- var new_width = $('#container').width();
- $('#fixed').width(new_width);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement