Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set the width of the div until browser side

Tags:

html

css

I begin with two examples:

13" macbook pro: macscreen 21" philips monitor philipscreen

Is it possible to set up full width for parent element with position:fixed, but for children elements set width until browser site, so in all sizes text would be until browser site or with max width.

CSS:

div#wrapper{
    width: 100%;
    height: 100%;
    padding-top: 70px;
}

header#left-panel, header#right-panel{
    background: none repeat scroll 0 0 #000000;
    min-height: 40px;
    padding: 10px;
    opacity: 0.8;
}

header#left-panel{
    width: 185px;
    position: fixed;
}

header#right-panel{
    /*width: 100%;*/ /*here is the problem*/
    left: 755px;
    position: fixed;
}

HTML:

<body>
    <div id="wrapper">
        <header id="left-panel">
            <section id="contacts">
            </section>
        </header>
        <header id="right-panel">
            <section id="comments">
                <div>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
                <div style="float:right">Lorem ipsum</div>
            </section>
        </header>
    </div>
</body>
like image 275
user1692333 Avatar asked Jan 17 '26 17:01

user1692333


1 Answers

Use right:0 on the header#right-panel element.

You can play around with it on this jsFiddle.

like image 183
Austin Mullins Avatar answered Jan 20 '26 09:01

Austin Mullins



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!