Preface This article mainly summarizes some of the problem-solving skills encountered in daily web page production, and shares them for your reference and learning. I won’t say much below. Interested friends can take a look at the detailed introduction below: To summarize: 1. Box-sizing: allows you to define specific elements that match a certain area in a specific way. content-box: Add padding and borders to a box in addition to the specified width and height. border-box: (Default value for textarea and select) Add padding and borders to the box within the specified width and height. /*It depends on your personal preference, but the default attribute of general tags is content-box, except for textarea and select*/ box-sizing: content-box; -moz-box-sizing: content-box; -webkit-box-sizing: content-box; 2. Beautify the input box /*In IE10+ browsers, use CSS to hide the cross on the right side of the input text input box*/ input[type=text]::-ms-clear,::-ms-reveal{display:none;} input::-ms-clear,::-ms-reveal{display:none;} input{ /*Remove the outline color when clicking*/ outline: none; /*The padding has been removed in the reset style. If it is not removed, remember to have padding*/ } 3. Beautify the textarea text field textarea{ /*Don't forget that the box-sizing property value of the text area is border-box; all borders and padding are drawn based on your fixed width and height*/ /*Remove the outline color when clicking*/ outline: none; /*If necessary, remove the resizable icons and functions in the lower right corner*/ resize: none; /*The padding has been removed in the reset style. If it is not removed, remember to have padding*/ } 4. Change the font color and size of the placeholder input::-webkit-input-placeholder { /* WebKit browsers */ font-size:14px; color: #333; } input:-moz-placeholder { /* Mozilla Firefox 4 to 18 */ font-size:14px; color: #333; } input::-moz-placeholder { /* Mozilla Firefox 19+ */ font-size:14px; color: #333; } input:-ms-input-placeholder { /* Internet Explorer 10+ */ font-size:14px; color: #333; } 5. Beautify selection /* Clear IE's default selection box style and hide the drop-down arrow */ select::-ms-expand { display: none; } select { /*The borders in Chrome and Firefox are different, so I copied them*/ border: solid 1px #333; /*Clear the default select box style*/ appearance:none; -moz-appearance:none; -webkit-appearance:none; /*Display a small arrow image in the middle of the rightmost selection box*/ background: url("small arrow image path") no-repeat right center transparent; /*Leave some space for the drop-down arrow to avoid being covered by text*/ padding-right: 14px; /*Remove the outline color when clicking*/ outline: none; } 6. Beautify button button{ /*It has a 2px border, and ordinary buttons do not need a border*/ border: none; /*The original background color can be replaced by other colors*/ background: #333; /*The padding has been removed in the reset style. If it is not removed, remember to have padding*/ } 7. Beautify radio buttons, multiple-selection boxes, or upload file buttons /*Because you can't directly change the style of input[type="radio"] and input[type="cheakbox"], you need to use label tag association, then hide the input tag and directly give the label tag style. Selecting label means selecting this label*/ <label for="sex">Male</label> <input type="radio" id="sex" value="Male" /> 8. Use ellipsis to indicate extra text white-space: nowrap; /* Force no line break */ overflow:hidden; /*Hide the excess content when the content exceeds the width*/ text-overflow:ellipsis;/* Displays an ellipsis mark (...) when the text in the object overflows. It must be used together with overflow:hidden;. */ 9. How to remove the blue background when clicking text on a CSS page -moz-user-select: none; /* Firefox*/ -webkit-user-select: none; /* webkit browser */ -ms-user-select: none; /* IE10 */ -khtml-user-select: none; /* Early browsers */ user-select: none; 10. Use this property when the vertical position of the icon is difficult to adjust vertical-align: 30%; vertical-align: middle; 11. How to center a div in the page div{ width:400px; height:300px; position:absolute; top:50%; left:50%; margin:-150px 0 0 -200px; } 12.js // Return key written in js onclick = 'history.go(-1)'; // Force refresh page window.location.reload(true); 13. Line break, no line break, word spacing Summarize The above is the full content of this article. I hope that the content of this article can bring some help to your study or work. If you have any questions, you can leave a message to communicate. Thank you for your support for 123WORDPRESS.COM |
<<: How to create a table in mysql and add field comments
>>: Docker enables seamless calling of shell commands between container and host
Three-way handshake phase Number of retries for c...
Introduction to four commonly used MySQL engines ...
background I have a project service that uses AWS...
Table of contents 1. Installation preparation 1. ...
We simply need to open any text editor, copy the f...
Wildcard categories: %Percent wildcard: indicates...
A simple license plate input component (vue) for ...
vue scaffolding -> vue.cli Quickly create a la...
Table of contents Preface Features of Vue Native ...
Preface The reason for writing this article is mai...
Today I will share with you a source code contain...
Table of contents What is a listener in vue Usage...
This article shares the specific code of the firs...
1. Data desensitization explanation In daily deve...
Traceroute allows us to know the path that inform...