CSS

xiaoxiao2021-03-06  92

CSS has some years. In web design, it is indispensable, unified web elements. It is also the product of the DOM. Script and Style are moving, a quiet, modified the web's document, so that the entire web is more vivid. Let programmability and interactibility.

Don't talk nonsense, the CSS that I know is nothing more than a few fonts, what is the color of color. The average person is also only used. Microsoft extends crazy, let any part of the entire DOM document can be modified, IE5, basically Mozilla is not compatible, so I am too lazy to explore him.

Nowadays, 95% of the entire Internet use IE to browse, more than 100% for low-level users, and Mozilla is also slowly close to IE. Now do the performance layer of the BS program, in order to make the program more flexible, have to re-turn MSDN, see the CSS style library. I really didn't pay attention before.

Refer to CSS. MSDN's Web Development is detailed.

As described below, I will use the vulgar to understand the part of the self-feeling of writing procedures.

1 location

Document declaration: The life cycle is only this document, and the modification is only this document. For the style of unify the whole site, the meaning is not large, and it is useful for special pages. > HTML 4.0 CSS Style Class Example </ title> <style type = "text / css"> Declaration </ stop> ......</p> <p>Outline: By specifying the text file, the Web relative way or absolute road, the entire website, the approximate page, using a unified style library, the separation display effect and code, very useful <HTML> <head > <Title> calling an external css style> <link rel = "stylesheet" href = "myStyles.css" type = "css / text"> </ head> ......</p> <p>2: Writing standard h1 {font: bold italic 20px Georgia, Times New Roman, Times, Serif; Margin-Top: 20px; Background: Transparent;} H2 {} HTML ELEMENT {Attribute: Value;} Model: H1, H2, His description uses {} contains each modified semicolon separated, or wraps, but simple standardization, semicolon wrap, if described in one line, such as specified style <div style = "in a special HTML tag: Bold; Background: Transparent; "> Sectional separation.</p> <p>The modified property is between the modified content, separated by a semicolon.</p> <p>For specific modification, if you have any modification, you can see MSDN, if you want to know the TD style property directly to find TD's description page: TD Element | TD ObjectStyles section: Style Attribute: is CSS, TD's modifying property (attributive) style Property: It is different attribute (nature), which should be associated with the Property, which is dynamically specified in the program, which is the formal name specified by the formally available Script. You can also use an external program to specify objects in the DOM, and it is also Property. Element.style.property = value; pay special attention to this place, Attribute and Property often name different, so Obj.Style.Property = XXX when writing programs; and the style of the style described in CSS: YYY should pay special attention to the name Cheter MSDN I.e. 3: Type of Modified Tag 1) HTML Tag Style Specify a unified modification of the specified HTML tag. For example, the modified h1 {text-align: center; color: red;} is modified to modify the content of the H1 tag of the entire document {Attibute: value;} The style is generally used to do default style designation, and special modifications are as follows:</p> <p>2) In a tab in a tab in the modified web page, use class = classname, such as <span class = myspan> at this time, IE is specified to match the style library. MYSPAN style specified The content contained in this span. . Category Name {Attribute: Value;} The program can dynamically specify its category, for the purpose of changing the effect, such as <span style = "s1" οnmοuseοut = "this.classname = 's1'" οnmοuseοver = "this.classname = 's2'" > </ span> This object is referenced by the S2 style when the mouse is in response to the mouse, and the S1 style is referenced when leaving. ONMOUSEOUT, ONMOUSEOVER and other events can also be integrated into style libraries, which is the Style's BEHAVIOR attribute and HTC (HTML component library) later.</p> <p>Therefore, this modification is most commonly used in writing programs.</p> <p>3) Modified objects to the specified object, if you want to modify the name of the object, <span id = myid> can specify in the style library: #myid, modify all ID = myid Objects # 对 i attribute: Value This is also commonly used for modified uniform type elements.</p> <p>4) Style Library Name Space Namespace (I understand) Think about the category of the above 2), why is it used. ? Often see: Table.MyStyle {Attribute: value;}. MyStyle {attibute: value;} What is different, in <Table Class = MyCTyle>, Applying Table.Mystyle and <Div Class = MyStyle> is .myStyle is valid for the entire body.</p> <p>#mydiv p {attribute: value;} # Mydiv A: Link {attribute: value;} Independent valid space 5) A property, 4 state modification a {} A: link {} A: visited { } a: hover {} a: active {}</p> <p>I think this, can be enhanced, and it is also very good to expand in a document.</p> <p>4: In the document, the default style is specified by 1) class in the above style library. Specify the style by the ID by specifying the class to specify the style by the id by ID.</p> <p>5: Several detail style libraries use external files, such as pictures, designated background picture Background-Image: URL (SURL); // location of the background image, WHERE SURL IS An Absolute or Relative URL Application is relative to current CSS The URL of the file is not a relative way to the web page to apply this CSS.</p> <p>Behavior: URL (Sbehavior); This type, related dynamic response code, behavior? Dynamic application script: Object.Style.behavior [= sbehavior]</p> <p>3 in the following types of sBehavior:. Url (sLocation) Script implementation of a Dynamic HTML (DHTML) behavior, where sLocation is an absolute or relative URL url (#objID) Binary implementation of a DHTML behavior, where objID is the ID attribute specified In an Object Tag. URL (# Default # BehaviorName) Microsoft® Internet Explorer Default Behavior, Identified by ITS</p> <p>In the slocation, you can be a relatively HTC component, HTML Components, you can package the relevant scripts of the unified type of objects, and are specified by style libraries. These scripts are of course the script of the web display. Is a considerable content.</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-105519.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="105519" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.043</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'TzLFRF56W9lgTZJjk7f6NYu_2FE1SUeciF4QKK9mztkX_2FmyBn22XEWzvDqZC4i_2Fk0othlLVeLn_2Fi67_2Bl3OIbnITA_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>