在css比html更好地创建框架? [英] How is better to create frames in css than html?

查看:112
本文介绍了在css比html更好地创建框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新的css,想知道如何更好地创建框架在CSS比HTML框架?对于学习我想创建一个屏幕有2个相等大小的帧,第一帧分为2列。

I am new to css and want to know how is it better to create frames in css than html frames? For learning I want to create a screen with 2 equal sized frames, with the first frame divided into 2 columns. Can someone please guide me how do I start with it?

推荐答案

您可以使用 div来模拟框架 c>

演示: http://jsfiddle.net/wdm954/wPywB/

HTML ...

<div id="a">
    <div class="col1">testing col1</div>
    <div class="col2">testing col2</div>
</div>
<div id="b">
    Test test test.
</div>

CSS ...

#a, #b {
    width: 50%;
    height: 400px;
    float: left;
    overflow-y: scroll;
}
#a .col1, #a .col2 {
    width: 50%;
    float: left;  
}

您可以使用一些jQuery动态设置框架的高度列...

Optionally you can using some jQuery to dynamically set the height of the frame-like columns...

$(document).ready(function() {

    $('#a, #b').height( $(window).height() );
    $(window).resize(function() {
        $('#a, #b').height( $(window).height() );
    });

});

这篇关于在css比html更好地创建框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆