• 『HTMl5』学习日志


    w3g提供在线校验页面:http://validator.w3.org/

    1.文本框获取焦点

    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    <!DOCTYPE html">
    <html>
      <head>
        <base href="<%=basePath%>">
        <title>HTML5</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      </head>
      <body>
      <!-- 标签mark用于强调被标记的文本 -->
      <mark>当前时间:</mark>
      <!-- 标签time只是增强语义,跟直接用div一样的效果 -->
      <time><b>2014-03-15<b/></time> 
     
      <br/><br/>
      <!-- 文本框获取输入焦点 -->
      图书:<input type="text" name="book" id="book" autofocus/><br/><br/>
      价格:<input type="text" name="price" id="price" value="30.82"/><br/><br/>
      <!-- img,input,br,hr都是空元素,不需要结束标签 ,其中request.getContextPath()是获取webroot路径-->
      封面:<img src="<%=request.getContextPath()%>/image/book.jpg"/><br/><br/>
      简介:<area id="content" value="这本书不错"/>
      
      </body>
    </html>

    2.文本格式化标签

     1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
     2 <%
     3 String path = request.getContextPath();
     4 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
     5 %>
     6 <!DOCTYPE html">
     7 <html>
     8   <head>
     9     <base href="<%=basePath%>">
    10     <title>文本格式化标签</title>
    11     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    12   </head>
    13   <body>
    14   <span><b>加粗字体</b></span><br/>
    15   <span><i>斜体字体</i></span><br/>
    16   <span><em>强调字体</em></span><br/>
    17   <span><big>大字号字体</big></span><br/>
    18   <span><small>小字号字体</small></span><br/>
    19   <!-- sup:上标字体 -->
    20   <span>2<sup>3</sup>=8</span><br/>
    21   <!-- sub:下标字体 -->
    22   <span>2<sub>3</sub></span><br/>
    23   <div><bdo dir="ltr">从左往右</bdo></div>
    24   <div><bdo dir="rtl">左往右从</bdo></div>
    25   </body>
    26 </html>
    View Code
  • 相关阅读:
    洛谷 P2370 P2370 yyy2015c01的U盘
    洛谷 P1214 等差数列
    洛谷 P1483 序列变换
    洛谷 P2032 扫描
    洛谷 P2846 光开关
    洛谷 P2872 道路建设
    Codeforces Round #510 #C Array Product
    Codeforces Round #510 #B
    Codeforces Round #510 #A
    关于各种数字倍数的判断
  • 原文地址:https://www.cnblogs.com/zhutouying/p/3602128.html
Copyright © 2020-2023  润新知