- Removes all spaces in the string.
var ss=" fsd fsdaf 23 "; ss.replace(/[ ]/g,"");
- Remove the dotted border after tag a is clicked
$(‘a‘).focus(function(){this.blur()});
- The simplest way to convert a string to a value is-0 (cannot + 0)
var a = ‘123.45‘; var b = a - 0;
- In Div, set the vertical text Center Method:
- Use the line-height method to center a single line of text and set the line-height of the text to be equal to the height of the container.
height:100px; line-height:100px;
- Use display: Table-cell to center multiple lines of text and then set vertical-align to center and align
display:table-cell; vertical-align:middle
- Align the checkbox and text horizontally: add the style
vertical-align:middle
As follows:
<Input style = "color: red; Vertical-align: middle;" type = "checkbox"/> <label style = "vertical-align: middle; "> I have read <label/>
I have read
- Three solutions with invalid span width settings
- 1. Change span to block type. Add the display attribute to the CSS of span and set span to the block type. The effect is that span completely becomes a div.
span { background-color:#fc0; display:block; width:150px; }
- 2. Add another CSS attribute float on the basis of "1. Basically meet daily needs, similar to Div plus float
span { background-color:#fc0; display:block; float:left; width:150px; }
- III. (perfect method: directly paste code. The principle can be used to learn CSS in depth)
span { background-color:#fc0; display:-moz-inline-box; display:inline-block; width:150px; }
- Unfinished...
Experience and skills frequently used in front-end work