Commit deb643fc by Patryk Czarnik

arkusz stylu CSS

parent 95d0f5e7
...@@ -23,13 +23,14 @@ public class Kalkulator extends HttpServlet { ...@@ -23,13 +23,14 @@ public class Kalkulator extends HttpServlet {
<html> <html>
<head> <head>
<title>Rozmowa z serwletem</title> <title>Rozmowa z serwletem</title>
<link rel="stylesheet" type="text/css" href="styl.css">
</head> </head>
<body> <body>
<h1>Rozmowa z serwletem</h1> <h1>Rozmowa z serwletem</h1>
"""); """);
out.append(""" out.append("""
<form> <form class='kalkulator'>
Podaj pierwszą liczbę: <input type='number' name='liczba1'><br> Podaj pierwszą liczbę: <input type='number' name='liczba1'><br>
Podaj drugą liczbę: <input type='number' name='liczba2'><br> Podaj drugą liczbę: <input type='number' name='liczba2'><br>
Podaj znak działania: Podaj znak działania:
...@@ -58,9 +59,9 @@ public class Kalkulator extends HttpServlet { ...@@ -58,9 +59,9 @@ public class Kalkulator extends HttpServlet {
case "%" -> x % y; case "%" -> x % y;
default -> 0; default -> 0;
}; };
out.append("<div>Wynik: " + wynik + "</div>"); out.append("<div class='wynik'>Wynik: " + wynik + "</div>");
} catch (Exception e) { } catch (Exception e) {
out.append("<div>Błąd: " + e + "</div>"); out.append("<div class='error'>Błąd: " + e + "</div>");
} }
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="styl.css">
<title>Aplikacja serwletowa</title> <title>Aplikacja serwletowa</title>
</head> </head>
<body> <body>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="styl.css">
<title>Przykład pliku JSP</title> <title>Przykład pliku JSP</title>
</head> </head>
<body> <body>
......
@charset "UTF-8";
body {
background-color: #FFFFDD;
}
.kalkulator {
background-color: #CCEEFF;
border: solid 2px blue;
margin: 1em 2em;
padding: 1em;
}
.wynik {
background-color: #C8FFD0;
border: solid 2px green;
margin: 1em 2em;
padding: 1em;
}
.error {
background-color: white;
color: red;
border: solid 2px red;
margin: 1em 2em;
padding: 1em;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment