跳转到帖子
在手机APP中查看

一个更好的浏览方法。了解更多

OKCCN - XenForo & IPS Plugin Marketplace

主屏幕上的全屏APP,带有推送通知、徽章等。

在iOS和iPadOS上安装此APP
  1. 在Safari中轻敲分享图标
  2. 滚动菜单并轻敲添加到主屏幕
  3. 轻敲右上角的添加按钮。
在安卓上安装此APP
  1. 轻敲浏览器右上角的三个点菜单 (⋮) 。
  2. 轻敲添加到主屏幕安装APP
  3. 轻敲安装进行确认。
  • 选择语言

CSS User Interface

推荐的帖子

  • 行政经理

CSS User Interface


CSS User Interface

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

  • resize
  • outline-offset

CSS Resize

The resize property specifies if (and how) an element can be resized by a user.

This property can have one of the following values:

  • horizontal - user can resize the element horizontally (the width)
  • vertical - user can resize the element vertically (the height)
  • both - user can resize the element both vertically and horizontally
  • none - user cannot resize the element

You can resize this div element in a vertical way!

To resize: Click and drag at the bottom-right corner!

CSS Resize - Only Width

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

Example

div {
  resize: horizontal;
  overflow: auto;
}
Try it Yourself »

CSS Resize - Only Height

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

Example

div {
  resize: vertical;
  overflow: auto;
}
Try it Yourself »

CSS Resize - Both Width and Height

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

Example

div {
  resize: both;
  overflow: auto;
}
Try it Yourself »

CSS Disable Resize in Textarea

A <textarea> is often resizable by default.

Here, we have used the resize property to disable the resizability in <textarea>:

Example

textarea {
  resize: none;
}
Try it Yourself »


CSS Outline Offset

The outline-offset property adds a space between an outline and the edge/border of an element. The space between an element and its outline is transparent.

The following example specifies an outline 15px outside the border edge:

This paragraph has a black border and a red 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:

Example

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;
}
Try it Yourself »


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

参与讨论

你可立刻发布并稍后注册。 如果你有帐户,立刻登录发布帖子。

游客
回帖…

帐户

导航

搜索

搜索

配置浏览器推送通知

Chrome (安卓)
  1. 轻敲地址栏旁的锁形图标。
  2. 轻敲权限 → 通知。
  3. 调整你的偏好。
Chrome (台式电脑)
  1. 点击地址栏中的挂锁图标。
  2. 选择网站设置。
  3. 找到通知选项并调整你的偏好。