• HTML样式


    学习内容:

    1.HTML样式实例——设置背景颜色

    代码示例

    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <base href="<%=basePath%>">

    <title>My JSP 'MyJsp.jsp' starting page</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->

    </head>

    <body>
    <h1>字体样式</h1>
    <p style="font-family:arial;color:red;font-size:20px;">Hello!</p>
    <body style="background-color:green">
    <h2 style="background-color:red">背景颜色</h2>
    <p style="background-color:yellow">HelloWord!</p>
    </body>
    </html>

    运行截图:

     2..HTML样式实例——设置百度超链接

    代码实例:

     3..HTML样式实例——设置图像标签

    代码实例:

    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <base href="<%=basePath%>">

    <title>My JSP 'Picture.jsp' starting page</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->

    </head>

    <body>
    <div>
    <img src="2.jpg" alt="图像显示">
    </div>
    </body>
    </html>

    运行截图:

  • 相关阅读:
    CSUOJ 2192: Wells弹键盘 (dp)
    Gym101981I Magic Potion(最大流)
    BZOJ2588: Count on a tree 主席树
    C#添加多个Sheet表
    DataTable排序,检索,合并
    检索 COM 类工厂中 CLSID 为 {} 的组件时失败,原因是出现以下错误: 80070005
    C#获取URL参数值
    JQuery爱好者们的福音 jQuery EasyUI 开源插件套装 完全替代ExtJS
    12个ajax弹出层效果
    CSS完美兼容IE6/IE7/FF的通用方法
  • 原文地址:https://www.cnblogs.com/zyj3955/p/13848025.html
Copyright © 2020-2023  润新知