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>

    运行截图:

  • 相关阅读:
    RHCE考试(Linux7)
    RHCSA考试(Linux7)
    调整Linux最大文件打开数
    记一次渗透测试面试题
    反序列化漏洞
    cisp-pte靶场通关思路分享----xss篇
    cisp-pte靶场通关思路分享----远程文件包含篇
    利用python轻松搭建http服务器
    cisp-pte靶场通关思路分享----综合题篇
    cisp-pte靶场通关思路分享----日志分析篇
  • 原文地址:https://www.cnblogs.com/zyj3955/p/13848025.html
Copyright © 2011-2022 走看看