In this chapter you will learn about the following CSS user interface properties:
The initial version of the browser that fully supports the attribute is indicated by the numbers in the table.
The resize property indicates whether or not an element may be resized by the user, as well as how.
In the example below, the user can only adjust the <div> element’s width:
div {
resize: horizontal;
overflow: auto;
}
In the example below, the user can only adjust the height of a <div> element:
div {
resize: vertical;
overflow: auto;
}
The user can adjust a <div> element’s height and width by using the following example:
div {
resize: both;
overflow: auto;
}
<textarea> is resizable by default in a lot of browsers. Here, the resize property has been utilized to turn off the resizability:
textarea {
resize: none;
}
An outline and an element’s border or edge are separated by more space thanks to the outline-offset attribute.
Note: borders are not the same as outline! In contrast to border, which is created inside the element’s border, outline may cross over into other content. Furthermore, the width of the outline has no bearing on the element’s overall width or height; it is not a component of the element’s measurements.
The outline-offset attribute is used in the example below to create gap between the outline and border:
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;
}
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 |
CodingAsk.com is designed for learning and practice. Examples may be made simpler to aid understanding. Tutorials, references, and examples are regularly checked for mistakes, but we cannot guarantee complete accuracy. By using CodingAsk.com, you agree to our terms of use, cookie, and privacy policy.
Copyright 2010-2024 by Refsnes Data. All Rights Reserved.