Home  >  Article  >  Web Front-end  >  What does minwidth mean? How to set min-width

What does minwidth mean? How to set min-width

云罗郡主
云罗郡主Original
2019-01-28 17:07:1214197browse

Many people are new to CSS and don’t know what minwidth means? How to set min-width? The following PHP Chinese website will lead you to learn about min-width.

What does minwidth mean? How to set min-width

1: What does minwidth mean

In css, minwidth is to set the minimum width of a paragraph. Using this attribute is to set a The minimum restriction is that the set element can be wider than the specified element, and negative values ​​cannot be specified.

The default value of min-width is none, which can be used on responsive websites.

Two: How to set min-width

For example, create a responsive website and set the width of the content to 30%, and it can be easily viewed at any size For browsers, if you use a small browser such as a mobile phone to view content, it will be displayed as a percentage of min-width by setting a value (px), and the actual size will not be smaller than this value.

css:

.box{
  width: 30%;
  height: 200px;
  min-width: 200px;
  background-color: #66b6d5; 
}

Currently, some website browsers support the min-width attribute. min-width has three values, namely length, % and inherit. The length is mainly used to define the minimum Width mainly depends on the browser, while % is the percentage that defines the element, and inherit is the value of the element attribute inherited from the parent element.

What does the above mean for minwidth? A full introduction to how to set min-width. If you want to know more about CSS video tutorial, please pay attention to the php Chinese website.


The above is the detailed content of What does minwidth mean? How to set min-width. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn