" tag in the jsp page to link the css style sheet; 2. Use the "

How to add css style to jsp page

#The operating environment of this tutorial: Windows 7 system, CSS3 version, Dell G3 computer.

Recommended: css video tutorial

There are three ways to insert CSS styles into JSP pages, and their priorities are different. The details are as follows: external style, internal style, and inline style. The priority increases in order!


【1】External styles
When styles need to be applied to many pages, external style sheets will be the ideal choice. With external style sheets, you can change the look of your entire site by changing one file. Each page links to the style sheet using the <link> tag.

<link rel="stylesheet" type="text/css" href="<%=uiPath%>hwtt_ui/skins/<%=skinName%>/css/login.css" />

The rel attribute specifies the relationship between the current document and the linked document. In this example, the rel attribute indicates that the linked document is a style sheet.


【2】Internal styles
When a single document requires special styles, an internal style sheet should be used. Internal style sheets can be defined at the head of the document using the <style></style> tag.

    <style type="text/css">
        .loginBtn{
            display:block;
            cursor: pointer;
            height: 32px;
            margin-bottom: 1px;
            width: 100px;
        }
    </style>

[3] Inline styles
Inline styles lose many of the advantages of style sheets because they mix presentation and content. Use this approach with caution, for example when the style only needs to be applied once to an element. To use inline styles, you need to use the style attribute within the relevant tag. The Style property can contain any CSS property.

<input type="text" name="authCode" style="vertical-align: middle" />

For more programming-related knowledge, please visit: Programming Learning! !

The above is the detailed content of How to add css style to jsp page. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Related Article
如何使用HTML和CSS创建一个幻灯片布局页面如何使用HTML和CSS创建一个幻灯片布局页面Oct 16, 2023 am 09:07 AM

如何使用HTML和CSS创建一个幻灯片布局页面引言:幻灯片布局在现代web设计中被广泛使用,在展示信息或图片时具有很大的吸引力和交互性。本文将介绍如何使用HTML和CSS创建一个幻灯片布局页面,并提供具体的代码示例。一、HTML布局结构首先,我们需要创建一个HTML布局结构,包含一个幻灯片容器和多个幻灯片项。代码如下所示:&lt;!DOCTYPEhtml&

如何使用:nth-child(-n+5)伪类选择器选择位置小于等于5的子元素的CSS样式如何使用:nth-child(-n+5)伪类选择器选择位置小于等于5的子元素的CSS样式Nov 20, 2023 am 11:52 AM

如何使用:nth-child(-n+5)伪类选择器选择位置小于等于5的子元素的CSS样式在CSS中,伪类选择器是一种强大的工具,可以通过特定的选择方式来选取HTML文档中的某些元素。其中,:nth-child()是一种常用的伪类选择器,可以选择特定位置的子元素。:nth-child(n)可以匹配HTML中的第n个子元素,而:nth-child(-n)可以匹配

如何使用HTML和CSS实现一个简单的聊天页面布局如何使用HTML和CSS实现一个简单的聊天页面布局Oct 18, 2023 am 08:42 AM

如何使用HTML和CSS实现一个简单的聊天页面布局随着现代科技的发展,人们越来越依赖于互联网来进行沟通和交流。而在网页中,聊天页面是一种非常常见的布局需求。本文将向大家介绍如何使用HTML和CSS来实现一个简单的聊天页面布局,并给出具体的代码示例。首先,我们需要创建一个HTML文件,可以使用任何文本编辑器。以index.html为例,先创建一个基本的HTML

如何使用HTML和CSS创建一个响应式卡片墙布局如何使用HTML和CSS创建一个响应式卡片墙布局Oct 25, 2023 am 10:42 AM

如何使用HTML和CSS创建一个响应式卡片墙布局在现代网页设计中,响应式布局是一项非常重要的技术。通过使用HTML和CSS,我们可以创建一个响应式的卡片墙布局,以适应不同屏幕尺寸的设备。下面将详细介绍如何使用HTML和CSS创建一个简单的响应式卡片墙布局。HTML部分:首先,我们需要在HTML文件中设置基本结构。我们可以使用无序列表(&lt;ul&gt;)和

如何使用HTML和CSS实现一个详细页面布局如何使用HTML和CSS实现一个详细页面布局Oct 20, 2023 am 09:54 AM

如何使用HTML和CSS实现一个详细页面布局HTML和CSS是创建和设计网页的基础技术,通过合理使用这两者,我们可以实现各种复杂的网页布局。本文将介绍如何使用HTML和CSS来实现一个详细页面布局,并提供具体的代码示例。创建HTML结构首先,我们需要创建一个HTML结构来放置我们的页面内容。以下是一个基本的HTML结构:&lt;!DOCTYPEhtml&g

如何使用HTML和CSS创建一个响应式视频播放页面布局如何使用HTML和CSS创建一个响应式视频播放页面布局Oct 18, 2023 am 10:48 AM

如何使用HTML和CSS创建一个响应式视频播放页面布局在当今互联网时代,视频已经成为我们日常生活中不可或缺的一部分。越来越多的网站和应用都提供了视频播放功能。而为了提供更好的用户体验,开发人员需要创建一个响应式的视频播放页面布局,以适应不同设备和屏幕尺寸。本文将详细介绍如何使用HTML和CSS来实现这一目标,并提供具体的代码示例。步骤1:HTML结构首先,我

如何使用HTML和CSS创建一个响应式音乐播放器布局如何使用HTML和CSS创建一个响应式音乐播放器布局Oct 19, 2023 am 10:02 AM

如何使用HTML和CSS创建一个响应式音乐播放器布局在如今信息科技迅速发展的时代,音乐作为娱乐的一种形式,已经深入人们的生活中。为了更好地体验音乐,许多网站和应用程序提供了在线音乐播放器。本文将介绍如何使用HTML和CSS创建一个响应式的音乐播放器布局,并提供具体的代码示例。首先,我们需要使用HTML创建基本结构。以下是一个简单的HTML布局示例:&lt;!

HTML嵌入CSS样式的方法HTML嵌入CSS样式的方法Sep 20, 2023 am 11:37 AM

HTML嵌入CSS样式的方法有内联样式、内部样式表和外部样式表。详细介绍:1、内联样式是指将CSS样式直接写在HTML标签中,通过style属性来设置元素的样式,这种方法的优点是简单、直观,能够快速地为某个特定元素设置样式,但它的缺点也很明显,样式与HTML结构紧密耦合,难以维护和复用,同时当样式需要修改时,需要遍历整个HTML文档,效率较低;2、内部样式表等等。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function