css| Skills | tutorials
Previous section: external Call
Why should we call it alone?
"Call alone" is to add the style attribute. is to apply the CSS declaration to a single page element (any text, picture, table ...). And so on, are page elements), at this point, CSS will no longer be a style sheet to display the results, but use the style attribute added to the label. Why do you want to "call" CSS individually? The reason is: more flexible ... For a simple example, do we want to make the input form's background not white?
About the Style property
In fact, almost every HTML tag has its own attributes, such as <p align= "center" > where align is the align alignment attribute of label <p>, plus the align attribute, you can set the paragraph to be left, center or right. The same, style can also be regarded as a property, as added to the label, in terms of our above question, its original syntax should be this:
syntax: <input type= "text" value= "Am I light green? "> Results: |
Now, we add the style attribute to the input form, which is to add the style attribute to the <input> tag:
syntax: <input type= "Text" value= "I have a light green background this time." style= "Background-color: #ccffcc"> Results: |
"Style=" "is the use of STYLE as a property, followed by the same CSS declaration in the" "Inside, as for the inside of the Background-color: #ccffcc意思就是" background color: #ccffcc "meaning, now not familiar with the matter, will continue to explain in the future.
What tags can be added to the style attribute?
Basically, any label can add a style attribute. So you don't have to worry about tags that won't be accepted. However, a separate call to add a style attribute to a page element is very flexible, but it loses one of the advantages of CSS, and that is uniformity. So, you are using, unless only some of the page elements need to use the CSS format alone, otherwise, as far as possible in the use of the call method described before, so, in the future maintenance will be relatively simple.
Next section: Custom Categories