Dynamic Additions to Styles:
(where the red font is a dynamically added-style statement), a function that dynamically generates unordered lists to display the search for WiFi signals, which have 3 parameters, the name of the WiFi, the encryption method, the signal strength.
The
code is as follows:
//Create a network list item
function Newlistitem (Network, averagesignalstrength) {
/**
* A Wi-Fi list item has the following HTML structure:
* <li>
* <div> "signalstrength" + dbm</div>
* <small> Network security </small>
* <a [class= "wifi-secure"]> network SSID </a>
* </li>
*/
//SSID
var _ = Navigator.mozL10n.get;
var ssid = document.createelement (' a ');
ssid.textcontent = Network.ssid;
var div = document.createelement (' div ');
<span style= "color: #FF0000;" >var str_css = "position:absolute;left:50%; Right:3rem; top:45%; Padding-top:0.4rem; Font-size:1.4rem; Color: #505859; Pointer-events:none; "; </span>
<span style= "color: #FF0000;" >div.style = str_css;</span>
if (!averagesignalstrength)
div.textcontent = ' strength: ' + network.signalstrength + ' dbm ';
Else
div.textcontent = ' strength: ' + averagesignalstrength + ' dbm ';
//Supported authentication Methods
var small = document.createelement (' small ');
var keys = network.capabilities;
if (keys && keys.length) {
small.textcontent = _ (' Securedby ', {capabilities:keys.join (', ')});
small.textcontent = Keys.join (', ');
} else {
small.textcontent = _ (' Securityopen ');
small.dataset.l10nId = ' Securityopen ';
}
//Create List item
var li = document.createelement (' li ');
Li.appendchild (DIV);
Li.appendchild (small);
Li.appendchild (SSID);
return li;
}
Display and hide of styles:
Traversal tag exp = document.getElementById ("exp");
Hidden label Exp.style.display = "None";
Display label Exp.style.display = "List-item";
The Padding property defines the space between the element border and the element content.
The padding shorthand property sets all the inner margin properties in a declaration. Sets all current or specified element interior margin properties. This property can have 1 to 4 values
The
code is as follows:
<span style= "FONT-SIZE:14PX;" > Grammatical Structure
padding-top:20px, upper inner margin
padding-right:30px, right inner margin
padding-bottom:30px, lower inner margin
padding-left:20px, left inner margin
padding:1p quadrilateral uniform inner margin
padding:1px1px up and down, the left and right inner margin
padding:1px1px1px, left and right, lower inner margin
PADDING:1PX1PX1PX1PX, right, bottom, left inner margin </span>