No replies
mourdeveloper
mourdeveloper's picture
Offline
newbie
Last seen: 5 years 48 weeks ago
Timezone: GMT+5.5
Joined: 2014-11-27
Posts: 1
Points: 2

hi see below link http://liveweave.com/I6JyFT

when i assign canvas width like 100% it takes 100px width why so ,

become

what to do to make canvas match width of parent width , i could not find how to solve it , think bit tricky css issue

html code

<table><tr valign="top"><td>
</td><td>
<table align="center">
<tr valign="top">
<td>
left
</td><td>
            <div id="content">
              <table border="1" width="100%">
                <tr  width="100%"><td style="border:1px solid red">
                    <canvas id="canvas" width="100%" height="100%" style="width: 100%; height: 100%; position: relative">
                    </canvas>
                <div id="canvas-drop-area"></div>
                </td></tr>
              <tr><td style="border:1px solid red">
                    <canvas id="canvas1" width="320" height="256">
                    </canvas>
                <div id="canvas-drop-area1"></div>  
                </td></tr>              
            </table>
            </div>
</td><td>
right
</td></tr>
 
</table>

css code below

body{
    background-color:#FBFBFB;
    width:800px;
}
#wrapper{
    margin: 0 auto;
    width: 100%;
    border: 1px solid #999;
    padding: 5px;
    overflow: hidden;
}
#content{
    float:left;
}
#canvas{
    width:320px;
    height:256px;
    overflow:hidden;
    float:left;
    border:1px solid #000000;
}
#canvas1{
    width:320px;
    height:256px;
    overflow:hidden;
    float:left;
    border:1px solid #000000;
}