最适合网络开发者的网站

CSS 教程

CSS 主页 CSS 简介 CSS 语法 CSS 选择器 CSS 如何 CSS 注释 CSS 颜色 CSS 背景 CSS 边框 CSS 边距 CSS 填充 CSS 高度/宽度 CSS 盒子模型 CSS 大纲 CSS 文本 CSS 字体 CSS 图标 CSS 链接 CSS 列表 CSS 表格 CSS 显示 CSS 最大宽度 CSS 位置 CSS Z 索引 CSS 溢出 CSS 浮动 CSS 内联块 CSS 对齐 CSS 组合器 CSS 伪类 CSS 伪元素 CSS 不透明度 CSS 导航栏 CSS 下拉菜单 CSS 图片库 CSS 图像精灵 CSS Attr 选择器 CSS 表单 CSS 计数器 CSS 网站布局 CSS 单位 CSS 特殊性 CSS !重要 CSS 数学函数

CSS 高级

CSS 圆角 CSS 边框图像 CSS 背景 CSS 颜色 CSS 颜色关键字 CSS 渐变 CSS 阴影 CSS 文本效果 CSS Web 字体 CSS 2D 变换 CSS 3D 变换 CSS 过渡 CSS 动画 CSS 工具提示 CSS 样式图像 CSS 图像反射 CSS 对象适合 CSS 对象位置 CSS 遮罩 CSS 按钮 CSS 分页 CSS 多列 CSS 用户界面 CSS 变量 CSS 盒子尺寸 CSS 媒体查询 CSS MQ 示例 CSS 弹性框

CSS 响应式

RWD 简介 RWD 视口 RWD 网格视图 RWD 媒体查询 RWD 图像 RWD 视频 RWD 框架 RWD 模板

CSS 网格

网格简介 网格容器 网格项

CSS 南苏丹援助协会

SASS 教程

CSS 例子

CSS 模板 CSS 示例 CSS 测验 CSS 练习 CSS 证书

CSS 参考

CSS 参考 CSS 选择器 CSS 函数 CSS 参考 Aural CSS Web 安全字体 CSS 动画 CSS 单位 CSS PX-EM 转换器 CSS 颜色 CSS 颜色值 CSS 默认值 CSS 浏览器支持

初学者的 CSS 课程

尿素

CSS User Interface


CSS 用户界面

In this chapter you will learn about the following CSS user interface properties:

  • resize
  • outline-offset

Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
resize 4.0 79.0 5.0 4.0 15.0
outline-offset 4.0 15.0 5.0 4.0 9.5

CSS Resizing

The resize property specifies if (and how) an element should be resizable by the user.

This div element is resizable by the user!

To resize: Click and drag the bottom right corner of this div element.

The following example lets the user resize only the width of a <div> element:

例子

div {
 resize: horizontal;
  overflow: auto;
}
亲自尝试 »

The following example lets the user resize only the height of a <div> element:

例子

div {
  resize: vertical;
  overflow: auto;
}
亲自尝试 »

The following example lets the user resize both the height and width of a <div> element:

例子

div {
  resize: both;
  overflow: auto;
}
亲自尝试 »

In many browsers, <textarea> is resizable by default. Here, we have used the resize property to disable the resizability:

例子

textarea {
  resize: none;
}
亲自尝试 »

CSS Outline Offset

The outline-offset property adds space between an outline and the edge or border of an element.

This div has an outline 15px outside the border edge.

Note: Outline differs from borders! Unlike border, the outline is drawn outside the element's border, and may overlap other content. Also, the outline is NOT a part of the element's dimensions; the element's total width and height is not affected by the width of the outline.

The following example uses the outline-offset property to add space between the border and the outline:

例子

div.ex1 {
  margin: 20px;
  border: 1px solid black;
  outline: 4px solid red;
  outline-offset: 15px;
}

div.ex2 {
  margin: 10px;
  border: 1px solid black;
  outline: 5px dashed blue;
  outline-offset: 5px;
}
亲自尝试 »

CSS User Interface Properties

The following table lists all the user interface properties:

Property Description
outline-offset Adds space between an outline and the edge or border of an element
resize Specifies whether or not an element is resizable by the user