CSS -webkit-box-orient: vertical property lost after compilation

CSS -webkit-box-orient: vertical property lost after compilation

1. Cause

The requirement is to display two lines, and the extra text is replaced by three dots, so these less standardized attributes are used.

display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;

Later I found that the code was written well, but it didn't respond when it was on the page, as if I hadn't written it at all. I checked it with F12 and found that the -webkit-box-orient: vertical; attribute was missing, causing it to fail to take effect. I just added this attribute in Styles, so I concluded that the compilation process caused this attribute to be lost.

2. Solution

I found a feasible solution on the Internet. To turn off autoprefixer, there is a way to write it:

/*!autoprefixer: off */
-webkit-box-orient: vertical;
/* autoprefixer: on */

This does solve the problem of missing compilation, but a warning will be reported during the compilation process. Finally, the best solution was found on GitHub, as follows

/* autoprefixer: ignore next */
-webkit-box-orient: vertical;

The problem is solved perfectly and no warning is reported.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

<<:  Markup validation for doctype

>>:  Solution to MySQL replication failure caused by disk fullness

Recommend

js to realize a simple disc clock

This article shares the specific code of js to im...

Detailed steps to build a file server in Windows Server 2012

The file server is one of the most commonly used ...

MySQL Optimization Summary - Total Number of Query Entries

1. COUNT(*) and COUNT(COL) COUNT(*) usually perfo...

Mysql accidental deletion of data solution and kill statement principle

mysql accidentally deleted data Using the delete ...

Theory Popularization——User Experience

1. Concept Analysis 1: UE User Experience <br ...

Docker installs the official Redis image and enables password authentication

Reference: Docker official redis documentation 1....

How to mark the source and origin of CSS3 citations

I am almost going moldy staying at home due to th...

How to use positioning to center elements (web page layout tips)

How to center an element in the browser window He...

VPS builds offline download server (post-network disk era)

motivation Due to learning needs, I purchased a v...

HTML table border control implementation code

Generally, when we use a table, we always give it...

Summary of MySQL database like statement wildcard fuzzy query

MySQL error: Parameter index out of range (1 >...

Example analysis of mysql non-primary key self-increment usage

This article uses an example to illustrate the us...