div 表格布局_探索Div和表格布局的乐趣

div 表格布局

内容 (Contents)

介绍 (Introduction)

This is a straightforward article demonstrating some very basic UI layout concepts using either DIV or TABLE elements. The impetus for this is simply that I often struggle with figuring out the nuances of how to position elements in the UI so I get both the look and behavior that I want. By look, I mean the positioning of sections of the UI and the elements within those sections, and by behavior, I mean how the UI behaves when the browser window is resized. I'm not covering things like device screen sizes or replacing a menu bar with a "triple bar" dropdown -- there are component libraries like Bootstrap to handle that.

这是一篇简单的文章,演示了使用DIVTABLE元素的一些非常基本的UI布局概念。 这样做的动力很简单,就是我经常要弄清楚如何在UI中放置元素的细微差别,以便获得所需的外观和行为。 通过外观,我是指UI的各个部分的位置以及这些部分中的元素,并且通过行为,是指调整浏览器窗口大小时UI的行为。 我没有介绍设备屏幕尺寸或用“三栏”下拉菜单替换菜单栏的问题,而是通过Bootstrap这样的组件库来处理。

All of these examples can be coded in Visual Code and viewed side-by-side with Quick HTML Previewer, which of all the HTML preview plugins that I looked at is the only one that I found actually works.

所有这些示例都可以用Visual Code编码,并可以与Quick HTML Previewer并排查看,在我查看的所有HTML预览插件中,我发现这是唯一可以实际使用的插件。

基本布局 (Basic Layout )

Let's start with something basic -- two inline divs. The HTML:

让我们从基本的东西开始-两个内联div 。 HTML:

<p>Two inline divs:</p>
<div class='border1 quarter inline'>Div 1</div>
<div class='border1 quarter inline m10'>Div 2</div>

And the CSS I'm using to define the border, width, margin, and inline styles:

我用来定义边框,宽度,边距和内联样式CSS:

.border1 {
  border-style:solid;
  border-width: 1px;
}

.quarter {
  width: 25%; 
}

.inline {
  display: inline-block;
}

.m10 {
  margin-left:10px;
}

Yielding:

屈服:

Image 1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值