zoukankan      html  css  js  c++  java
  • 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>

    运行截图:

  • 相关阅读:
    登录、注册、忘记密码 流程图
    用心每一天,不忘初心,方能走远
    HttpContext.Current.Request.ServerVariables
    Bootstrap实现弹出框和提示框效果代码
    jquery.each()
    js获取页面url
    jquery获取ul中的第一个li
    sql server 取文件名函数 转载
    jquery手风琴
    给母亲的信
  • 原文地址:https://www.cnblogs.com/zyj3955/p/13848025.html
Copyright © 2011-2022 走看看