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>

    运行截图:

  • 相关阅读:
    50个好用的前端框架,千万收好以留备用!
    嫦娥五号顺利升空,NASA、欧洲航天局回应
    【电脑故障排查】第1章 BIOS和主板故障
    我的老博客——我在chinaunix的家
    Linux操作系统(第二版)(RHEL 8/CentOS 8)
    Java Web整合开发(21) -- 宏观把握Hibernate
    3 远程仓库
    PHP设计模式-策略模式 转
    ubuntu server设置时区和更新时间
    ubuntu 重启 nginx 失败,* Restarting nginx nginx ...fail!
  • 原文地址:https://www.cnblogs.com/zyj3955/p/13848025.html
Copyright © 2011-2022 走看看