div can input content without using input as input box to block automatic input style. Detailed explanation

高洛峰
Release: 2017-03-06 17:22:12
Original
1914 people have browsed it

When you click input, the style automatically added by the browser is very inconsistent with the overall style of the website, which affects the consistency of the overall design. It is okay to not use input as the input box. There is a good example below. You can refer to it. Today I designed a dynamic window style, and found that when the mouse clicks on the input, the style automatically added by the browser is very inconsistent with the overall style of the website. Although the intelligent function of the browser is very advanced, sometimes it will inevitably affect the consistency of the overall design.

Then I thought about whether it would be possible not to use input as the input box, and replaced it with

The code is as follows:

<p class="content" contenteditable="true"></p>
Copy after login


I thought it could avoid the browser's "Smart" function, I didn't expect that the browser is too smart, the effect is exactly the same, I can only go to Du Niang, but later found out that my css is still not enough, it is pitiful (self-examination)

There is such an attribute in css

The code is as follows:

.content{outline:none;}
Copy after login


And this is css3 and its brother has already had it, I actually...
div can input content without using input as input box to block automatic input style. Detailed explanation

More divs can be used to input content without input as an input box. Automatic input styles are blocked for detailed explanations. Please pay attention to the PHP Chinese website for related articles!

Related labels:
div
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!