码迷,mamicode.com
首页 > Web开发 > 详细

html 内联函数宽度设置

时间:2014-10-15 15:23:10      阅读:341      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   http   color   io   ar   sp   div   

width and/or height in tables are not standard anymore; as Ianzz says, they are depreciated. Instead the best way to do this is to have a block element inside your table cell that will hold the cell open to your desired size:

<table>
    <tr>
        <td valign="top">
            <div class="left_menu">
                <div class="menu_item">
                    <a href="#">Home</a>
                </div>
            </div>
        </td>
        <td valign="top" class="content">Content</td>
    </tr>
</table>

css

.content {
    width: 1000px;
}

.left_menu {
    background: none repeat scroll 0 0 #333333;
    border-radius: 5px 5px 5px 5px;
    font-family: Arial,Helvetica,sans-serif;
    font-size: 12px;
    font-weight: bold;
    padding: 5px;
    width: 200px;
}

.menu_item {
    background: none repeat scroll 0 0 #CCCCCC;
    border-bottom: 1px solid #999999;
    border-radius: 5px 5px 5px 5px;
    border-top: 1px solid #FFFFCC;
    cursor: pointer;
    padding: 5px;
}

 

原文地址:

http://stackoverflow.com/questions/11090544/td-widths-not-working

html 内联函数宽度设置

标签:des   style   blog   http   color   io   ar   sp   div   

原文地址:http://www.cnblogs.com/silentjesse/p/4026085.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!