📄 html.lib
字号:
# Image ################################################################################sub Image { my ($URL, $Width, $Height, $HSpace, $VSpace, $Border, $Alt, @Other)=@_; my $HTML; $URL =qq~ src="$URL"~ if $URL ne ""; $Width =qq~ width="$Width"~ if $Width ne ""; $Height =qq~ height="$Height"~ if $Height ne ""; $HSpace =qq~ hspace="$HSpace"~ if $HSpace ne ""; $VSpace =qq~ vspace="$VSpace"~ if $VSpace ne ""; $Border =qq~ border="$Border"~ if $Border ne ""; $Alt =qq~ alt="$Alt"~ if $Alt ne ""; my($Other) = @Other ? " @Other" : ""; $HTML=qq~<img$URL$Width$Height$HSpace$VSpace$Border$Alt$Other>~; return $HTML;}################################################################################ Form ################################################################################sub Form { my ($Action, $Method, $Target, $Enctype, @Other)=@_; my $HTML; $Action =qq~ action="$Action"~ if $Action ne ""; $Method =qq~ method="$Method"~ if $Method ne ""; $Target =qq~ target="$Target"~ if $Target ne ""; $Enctype =qq~ enctype="$Enctype"~ if $Enctype ne ""; my($Other) = @Other ? " @Other" : ""; $HTML=qq~<form$Action$Method$Target$Enctype$Other>~; return $HTML;}################################################################################ CForm ################################################################################sub CForm { return "</form>";}################################################################################ HiddenBox ################################################################################sub HiddenBox { my ($Name, $Value, @Other)=@_; my $HTML; $Name =qq~ name="$Name"~ if $Name ne ""; $Value =qq~ value="$Value"~ if $Value ne ""; my($Other) = @Other ? " @Other" : ""; $HTML=qq~<input type="Hidden"$Name$Value$Other>~; return $HTML;}################################################################################ TextBox ################################################################################sub TextBox { my ($Name, $Value, $Size, $MaxLength, $Style, @Other)=@_; my $HTML; $Name =qq~ name="$Name"~ if $Name ne ""; $Value =qq~ value="$Value"~ if $Value ne ""; $Size =qq~ size="$Size"~ if $Size ne ""; $MaxLength =qq~ maxlength="$MaxLength"~ if $MaxLength ne ""; $Style =qq~ style="$Style"~ if $Style ne ""; my($Other) = @Other ? " @Other" : ""; $HTML=qq~<input type="Text"$Name$Value$Size$MaxLength$Style class="TextBox"$Other>~; return $HTML;}################################################################################ PasswordBox ################################################################################sub PasswordBox { my ($Name, $Value, $Size, $MaxLength, $Style, @Other)=@_; my $HTML; $Name =qq~ name="$Name"~ if $Name ne ""; $Value =qq~ value="$Value"~ if $Value ne ""; $Size =qq~ size="$Size"~ if $Size ne ""; $MaxLength =qq~ maxlength="$MaxLength"~ if $MaxLength ne ""; $Style =qq~ style="$Style"~ if $Style ne ""; my($Other) = @Other ? " @Other" : ""; $HTML=qq~<input type="Password"$Name$Value$Size$MaxLength$Style class="PasswordBox"$Other>~; return $HTML;}################################################################################ TextArea ################################################################################sub TextArea { my ($Name, $Value, $Cols, $Rows, $Wrap, $Style, @Other)=@_; my $HTML; $Name =qq~ name="$Name"~ if $Name ne ""; $Value =qq~$Value~ if $Value ne ""; $Cols =qq~ cols="$Cols"~ if $Cols ne ""; $Rows =qq~ rows="$Rows"~ if $Rows ne ""; $Wrap =qq~ wrap="$Wrap"~ if $Wrap ne ""; $Style =qq~ style="$Style"~ if $Style ne ""; my($Other) = @Other ? " @Other" : ""; $HTML=qq~<textarea$Name$Cols$Rows$Wrap$Style class="TextArea"$Other>$Value</textarea>\n~; return $HTML;}################################################################################ Select ################################################################################sub Select { my ($Name, $Size, $Style, $Multiple, $Select, @Option)=@_; my ($HTML, $i); $Name =qq~ name="$Name"~ if $Name ne ""; $Size =qq~ size="$Size"~ if $Size ne ""; $Style =qq~ style="$Style"~ if $Style ne ""; $Multiple =qq~ multiple~ if $Multiple ne ""; $HTML=<<HTML;<select$Name$Size$Style class="Select"$Multiple>\nHTML for ($i=0;$i<=$#Option;$i++) { if ($Select eq $Option[$i+1]) { $Selected = qq~ selected~; }else{ $Selected = ""; } $HTML.="<option value=\"".$Option[$i+1]."\"$Selected>".$Option[$i]."</option>\n"; $i++; } $HTML.=<<HTML;</select>\nHTML return $HTML;}################################################################################ Checkbox ################################################################################sub Checkbox { my ($Name, $Value, $Style, $Checked, @Other)=@_; my $HTML; $Name =qq~ name="$Name"~ if $Name ne ""; if (($Value eq $Checked)&&($Checked ne "")) { $Checked =qq~ checked~; }else{ $Checked =""; } $Value =qq~ value="$Value"~ if $Value ne ""; $Style =qq~ style="$Style"~ if $Style ne ""; my($Other) = @Other ? " @Other" : ""; $HTML=qq~<input type="Checkbox"$Name$Value$Checked$Style class="Checkbox"$Other>~; return $HTML;}################################################################################ Radio ################################################################################sub Radio { my ($Name, $Value, $Checked, $Style, @Other)=@_; my $HTML; if (($Value eq $Checked)&&($Checked ne "")) { $Checked =qq~ checked~; }else{ $Checked =""; } $Name =qq~ name="$Name"~ if $Name ne ""; $Value =qq~ value="$Value"~ if $Value ne ""; $Style =qq~ style="$Style"~ if $Style ne ""; my($Other) = @Other ? " @Other" : ""; $HTML=qq~<input type="Radio"$Name$Value$Checked$Style class="Radio"$Other>~; return $HTML;}################################################################################ Submit ################################################################################sub Submit { my ($Name, $Value, $Style, @Other)=@_; my $HTML; $Name =qq~ name="$Name"~ if $Name ne ""; $Value =qq~ value="$Value"~ if $Value ne ""; $Style =qq~ style="$Style"~ if $Style ne ""; my($Other) = @Other ? " @Other" : ""; $HTML=qq~<input type="Submit"$Name$Value$Style class="Button"$Other>~; return $HTML;}################################################################################ Reset ################################################################################sub Reset { my ($Value, $Style, @Other)=@_; my $HTML; $Value =qq~ value="$Value"~ if $Value ne ""; $Style =qq~ style="$Style"~ if $Style ne ""; my($Other) = @Other ? " @Other" : ""; $HTML=qq~<input type="Reset"$Value$Style class="Button"$Other>~; return $HTML;}################################################################################ Button ################################################################################sub Button { my ($Name, $Value, $Style, @Other)=@_; my $HTML; $Name =qq~ name="$Name"~ if $Name ne ""; $Value =qq~ value="$Value"~ if $Value ne ""; $Style =qq~ style="$Style"~ if $Style ne ""; my($Other) = @Other ? " @Other" : ""; $HTML=qq~<input type="Button"$Name$Value align="MIDDLE"$Style class="Button"$Other>~; return $HTML;}################################################################################ HR ################################################################################sub HR { my ($Align, $Size, $Width, $Style, $NoShade, @Other)=@_; my $HTML; $Align =qq~ align="$Align"~ if $Align ne ""; $Size =qq~ size="$Size"~ if $Size ne ""; $Width =qq~ width="$Width"~ if $Width ne ""; $Style =qq~ style="$Style"~ if $Style ne ""; $NoShade =qq~ noshade~ if $NoShade ne ""; my($Other) = @Other ? " @Other" : ""; $HTML=qq~<hr$Align$Size$Width$Style class="HR"$NoShade$Other>\n~; return $HTML;}###############################################################################1;# End of HTML.lib file###############################################################################
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -