Commit deb643fc by Patryk Czarnik

arkusz stylu CSS

parent 95d0f5e7
......@@ -23,13 +23,14 @@ public class Kalkulator extends HttpServlet {
<html>
<head>
<title>Rozmowa z serwletem</title>
<link rel="stylesheet" type="text/css" href="styl.css">
</head>
<body>
<h1>Rozmowa z serwletem</h1>
""");
out.append("""
<form>
<form class='kalkulator'>
Podaj pierwszą liczbę: <input type='number' name='liczba1'><br>
Podaj drugą liczbę: <input type='number' name='liczba2'><br>
Podaj znak działania:
......@@ -58,9 +59,9 @@ public class Kalkulator extends HttpServlet {
case "%" -> x % y;
default -> 0;
};
out.append("<div>Wynik: " + wynik + "</div>");
out.append("<div class='wynik'>Wynik: " + wynik + "</div>");
} catch (Exception e) {
out.append("<div>Błąd: " + e + "</div>");
out.append("<div class='error'>Błąd: " + e + "</div>");
}
}
......
......@@ -2,6 +2,7 @@
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="styl.css">
<title>Aplikacja serwletowa</title>
</head>
<body>
......
......@@ -6,6 +6,7 @@
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="styl.css">
<title>Przykład pliku JSP</title>
</head>
<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