Jump to content

width = 100% between two floated divs possible?


dadamssg

Recommended Posts

basically im trying to implement rounded corners that have a transparent background so my question is can i float a div with the transparent corner left and then float one right and then have a middle div that will stretch until it hits the edges of of the floated divs? cause i want to add a wrapper div to all of this and then set the width of the wrapper so i can control the width and it stretch and look fine. i want the outside of the corners to be transparent so they show the background image of the body so i cant set the background-color of the wrapper div or any div that the corners are in because then the transparent would be the color of the div and not the image....anyways hope that makes since and THANKS

Link to comment
Share on other sites

<div style="width: 30%; position: relative; background: yellow;">
    <div style="-moz-opacity: 0.4; background: lime; height: 25px; width: 25px; position: absolute; left: 0;"></div>
    <div style="-moz-opacity: 0.5; background: red;  height: 25px; margin: 0 23px;"></div>
    <div style="-moz-opacity: 0.4; background: lime; height: 25px; width: 25px; position: absolute; right: 0; top: 0;"></div>
</div>

That's one way (yes the 2px overlap is intentional so you can see it's pixel perfect :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.